Skip to content

Commit 08a2e36

Browse files
committed
Merge branch 'main' into custom_constraints
2 parents f0a8500 + c81fb37 commit 08a2e36

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelPredictiveControl"
22
uuid = "61f9bdb8-6ae4-484a-811f-bbf86720c31c"
33
authors = ["Francis Gagnon"]
4-
version = "1.0.1"
4+
version = "1.0.2"
55

66
[deps]
77
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ JuMP = "1"
1616
LinearAlgebra = "1.6"
1717
Logging = "1.6"
1818
Plots = "1"
19-
ModelingToolkit = "~9.41"
19+
ModelingToolkit = "9.50"

docs/src/manual/mtk.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the last section.
2323
will work for all corner cases.
2424

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

2828
We first construct and instantiate the pendulum model:
2929

@@ -79,16 +79,14 @@ function generate_f_h(model, inputs, outputs)
7979
end
8080
return nothing
8181
end
82-
return_inplace = true
8382
(_, h_ip) = ModelingToolkit.build_explicit_observed_function(
84-
io_sys, outputs; inputs, return_inplace
83+
io_sys, outputs; inputs, return_inplace = true
8584
)
86-
println(h_ip)
8785
u_nothing = fill(nothing, nu)
8886
function h!(y, x, _ , p)
8987
try
90-
# MTK.jl supports a `u` argument in `h_` function but not this package. We set
91-
# `u` as a vector of nothing and `h_` function will presumably throw an
88+
# MTK.jl supports a `u` argument in `h_ip` function but not this package. We set
89+
# `u` as a vector of nothing and `h_ip` function will presumably throw an
9290
# MethodError it this argument is used inside the function
9391
h_ip(y, x, u_nothing, p, nothing)
9492
catch err

docs/src/manual/nonlinmpc.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,8 @@ savefig("plot11_NonLinMPC.svg"); nothing # hide
402402

403403
![plot11_NonLinMPC](plot11_NonLinMPC.svg)
404404

405-
The computations of the successive linearization MPC are about 125 times faster than the
406-
nonlinear MPC (0.00012 s per time steps versus 0.015 s per time steps, on average), an
407-
impressive gain for similar closed-loop performances!
405+
The computations of the successive linearization MPC are about 75 times faster than the
406+
nonlinear MPC on average, an impressive gain for similar closed-loop performances!
408407

409408
```@setup 1
410409
global_logger(old_logger);

src/sim_model.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ detailstr(model::SimModel) = ""
187187
@doc raw"""
188188
initstate!(model::SimModel, u, d=[]) -> x
189189
190-
Init `model.x0` with manipulated inputs `u` and meas. dist. `d` steady-state and reset time.
190+
Init `model.x0` with manipulated inputs `u` and meas. dist. `d` steady-state.
191191
192192
The method tries to initialize the model state ``\mathbf{x}`` at steady-state. It removes
193193
the operating points on `u` and `d` and calls [`steadystate!`](@ref):
@@ -316,7 +316,7 @@ ms. Can be used to implement simple soft real-time simulations, see the example
316316
317317
# Examples
318318
```jldoctest
319-
julia> model = LinModel(tf(2, [0.3, 1]), 0.1);
319+
julia> model = LinModel(tf(2, [0.3, 1]), 0.25);
320320
321321
julia> function sim_realtime!(model)
322322
t_0 = time()
@@ -330,8 +330,8 @@ julia> function sim_realtime!(model)
330330
331331
julia> sim_realtime!(model)
332332
0.0
333-
0.1
334-
0.2
333+
0.25
334+
0.5
335335
```
336336
"""
337337
function periodsleep(model::SimModel, busywait=false)

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ DocMeta.setdocmeta!(
2424
)
2525
doctest(ModelPredictiveControl, testset="DocTest")
2626

27+
end;
2728

28-
end;
29+
nothing

0 commit comments

Comments
 (0)