Skip to content

Commit 9704c9b

Browse files
committed
debug: precompile InternalModel
1 parent 2511b08 commit 9704c9b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/precompile.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ y = model()
88

99
mpc_im = setconstraint!(LinMPC(InternalModel(model)), ymin=[45, -Inf])
1010
initstate!(mpc_im, model.uop, y)
11+
preparestate!(mpc_im, [55, 30])
1112
u = mpc_im([55, 30])
1213
sim!(mpc_im, 3)
1314

@@ -71,6 +72,7 @@ nlmodel = setop!(NonLinModel(f, h, Ts, 2, 2, 2, solver=nothing), uop=[10, 10], y
7172
y = nlmodel()
7273
nmpc_im = setconstraint!(NonLinMPC(InternalModel(nlmodel), Hp=10, Cwt=Inf), ymin=[45, -Inf])
7374
initstate!(nmpc_im, nlmodel.uop, y)
75+
preparestate!(nmpc_im, [55, 30])
7476
u = nmpc_im([55, 30])
7577
sim!(nmpc_im, 3, [55, 30])
7678

0 commit comments

Comments
 (0)