Skip to content

Commit 151b1bd

Browse files
committed
test: debug the new test
1 parent d760fad commit 151b1bd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎test/3_test_predictive_control.jl‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,16 +1131,17 @@ end
11311131
f(x,u,_,model) = model.A*x + model.Bu*u
11321132
h(x,_,model) = model.C*x
11331133
nlmodel = NonLinModel(f, h, linmodel.Ts, 1, 1, 1, 0, p=linmodel, solver=nothing)
1134+
nlmodel = setop!(nlmodel, yop=[10])
11341135
u, ym = let nlmodel=nlmodel, r=r, outdist=outdist
11351136
estim = UnscentedKalmanFilter(nlmodel, nint_u=[1])
1136-
nmpc_nint_ym = NonLinMPC(estim; Hp=10, transcription=MultipleShooting())
1137+
nmpc_nint_u_ms = NonLinMPC(estim; Hp=10, transcription=MultipleShooting())
11371138
nlmodel.x0 .= 0
11381139
ym, u = nlmodel() - outdist, [0.0]
11391140
for i=1:25
11401141
ym = nlmodel() - outdist
1141-
preparestate!(nmpc_nint_ym, ym)
1142-
u = moveinput!(nmpc_nint_ym, r)
1143-
updatestate!(nmpc_nint_ym, u, ym)
1142+
preparestate!(nmpc_nint_u_ms, ym)
1143+
u = moveinput!(nmpc_nint_u_ms, r)
1144+
updatestate!(nmpc_nint_u_ms, u, ym)
11441145
updatestate!(nlmodel, u)
11451146
end
11461147
u, ym

0 commit comments

Comments
 (0)