Skip to content

Commit

Permalink
Merge pull request #122 from JuliaControl/mtk_compat
Browse files Browse the repository at this point in the history
Add compat details on MTK.jl bugfixes
  • Loading branch information
franckgaga authored Nov 8, 2024
2 parents 3833301 + 4fda91d commit b24332b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ JuMP = "1"
LinearAlgebra = "1.6"
Logging = "1.6"
Plots = "1"
ModelingToolkit = "~9.41"
ModelingToolkit = "9.50"
10 changes: 4 additions & 6 deletions docs/src/manual/mtk.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ the last section.
will work for all corner cases.

!!! compat
The example only work with `ModelingToolkit.jl` v9.41 releases.
The example relies on features and bugfixes of `ModelingToolkit.jl` v9.50.

We first construct and instantiate the pendulum model:

Expand Down Expand Up @@ -79,16 +79,14 @@ function generate_f_h(model, inputs, outputs)
end
return nothing
end
return_inplace = true
(_, h_ip) = ModelingToolkit.build_explicit_observed_function(
io_sys, outputs; inputs, return_inplace
io_sys, outputs; inputs, return_inplace = true
)
println(h_ip)
u_nothing = fill(nothing, nu)
function h!(y, x, _ , p)
try
# MTK.jl supports a `u` argument in `h_` function but not this package. We set
# `u` as a vector of nothing and `h_` function will presumably throw an
# MTK.jl supports a `u` argument in `h_ip` function but not this package. We set
# `u` as a vector of nothing and `h_ip` function will presumably throw an
# MethodError it this argument is used inside the function
h_ip(y, x, u_nothing, p, nothing)
catch err
Expand Down

0 comments on commit b24332b

Please sign in to comment.