We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
moveinput!
TrapezoidalCollocation
1 parent e48ed89 commit ec33fadCopy full SHA for ec33fad
test/3_test_predictive_control.jl
@@ -799,17 +799,13 @@ end
799
# execute update_predictions! branch in `geqfunc_i` for coverage:
800
geq_end = nmpc5.optim[:geq_2].func
801
@test_nowarn geq_end(5.0, 4.0, 3.0, 2.0)
802
-
803
f! = (ẋ,x,u,_,_) -> ẋ .= -0.001x .+ u
804
h! = (y,x,_,_) -> y .= x
805
- nonlinmodel_c = NonLinModel(f!, h!, 100, 1, 1, 1)
+ nonlinmodel_c = NonLinModel(f!, h!, 500, 1, 1, 1)
806
nmpc5 = NonLinMPC(nonlinmodel_c, Nwt=[0], Hp=100, Hc=1, transcription=TrapezoidalCollocation())
807
preparestate!(nmpc5, [0.0])
808
u = moveinput!(nmpc5, [1/0.001])
809
- #@test u ≈ [1.0] atol=5e-2
810
- println(u)
811
- using Plots; plot(sim!(nmpc5, 100, [1/0.001])) |> display
812
+ @test u ≈ [1.0] atol=5e-2
813
nmpc6 = NonLinMPC(linmodel3, Hp=10)
814
preparestate!(nmpc6, [0])
815
@test moveinput!(nmpc6, [0]) ≈ [0.0] atol=5e-2
0 commit comments