Skip to content

Commit ec33fad

Browse files
committed
test: moveinput! test with TrapezoidalCollocation
1 parent e48ed89 commit ec33fad

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

test/3_test_predictive_control.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -799,17 +799,13 @@ end
799799
# execute update_predictions! branch in `geqfunc_i` for coverage:
800800
geq_end = nmpc5.optim[:geq_2].func
801801
@test_nowarn geq_end(5.0, 4.0, 3.0, 2.0)
802-
803802
f! = (ẋ,x,u,_,_) -> ẋ .= -0.001x .+ u
804803
h! = (y,x,_,_) -> y .= x
805-
nonlinmodel_c = NonLinModel(f!, h!, 100, 1, 1, 1)
804+
nonlinmodel_c = NonLinModel(f!, h!, 500, 1, 1, 1)
806805
nmpc5 = NonLinMPC(nonlinmodel_c, Nwt=[0], Hp=100, Hc=1, transcription=TrapezoidalCollocation())
807806
preparestate!(nmpc5, [0.0])
808807
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-
808+
@test u [1.0] atol=5e-2
813809
nmpc6 = NonLinMPC(linmodel3, Hp=10)
814810
preparestate!(nmpc6, [0])
815811
@test moveinput!(nmpc6, [0]) [0.0] atol=5e-2

0 commit comments

Comments
 (0)