Skip to content

Commit 9da439c

Browse files
committed
removed: less useful workload in precompile.jl
Trying to accelerate the precompilation of `MPC.jl`
1 parent 8daa441 commit 9da439c

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
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.11.0"
4+
version = "1.11.1"
55

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

src/precompile.jl

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,14 @@ mpc_im.estim()
1313
u = mpc_im([55, 30])
1414
sim!(mpc_im, 2)
1515

16-
mpc_kf = setconstraint!(LinMPC(KalmanFilter(model)), ymin=[45, -Inf])
16+
transcription = MultipleShooting()
17+
mpc_kf = setconstraint!(LinMPC(KalmanFilter(model); transcription), ymin=[45, -Inf])
1718
initstate!(mpc_kf, model.uop, model())
1819
preparestate!(mpc_kf, [55, 30])
1920
mpc_kf.estim()
2021
u = mpc_kf([55, 30])
2122
sim!(mpc_kf, 2, [55, 30])
2223

23-
transcription = MultipleShooting()
24-
mpc_lo = setconstraint!(LinMPC(Luenberger(model); transcription), ymin=[45, -Inf])
25-
initstate!(mpc_lo, model.uop, model())
26-
preparestate!(mpc_lo, [55, 30])
27-
mpc_lo.estim()
28-
u = mpc_lo([55, 30])
29-
sim!(mpc_lo, 2, [55, 30])
30-
31-
mpc_ukf = setconstraint!(LinMPC(UnscentedKalmanFilter(model)), ymin=[45, -Inf])
32-
initstate!(mpc_ukf, model.uop, model())
33-
preparestate!(mpc_ukf, [55, 30])
34-
mpc_ukf.estim()
35-
u = mpc_ukf([55, 3])
36-
sim!(mpc_ukf, 2, [55, 30])
37-
38-
mpc_ekf = setconstraint!(LinMPC(ExtendedKalmanFilter(model)), ymin=[45, -Inf])
39-
initstate!(mpc_ekf, model.uop, model())
40-
preparestate!(mpc_ekf, [55, 30])
41-
mpc_ekf.estim()
42-
u = mpc_ekf([55, 30])
43-
sim!(mpc_ekf, 2, [55, 30])
44-
4524
mpc_skf = setconstraint!(LinMPC(SteadyKalmanFilter(model)), ymin=[45, -Inf])
4625
initstate!(mpc_skf, model.uop, model())
4726
preparestate!(mpc_skf, [55, 30])
@@ -98,12 +77,6 @@ nlmodel = setop!(
9877
uop=[10, 10], yop=[50, 30]
9978
)
10079
y = nlmodel()
101-
nmpc_im = setconstraint!(NonLinMPC(InternalModel(nlmodel), Hp=10, Cwt=Inf), ymin=[45, -Inf])
102-
initstate!(nmpc_im, nlmodel.uop, y)
103-
preparestate!(nmpc_im, [55, 30])
104-
nmpc_im.estim()
105-
u = nmpc_im([55, 30])
106-
sim!(nmpc_im, 2, [55, 30])
10780

10881
transcription = MultipleShooting(f_threads=true)
10982
nmpc_ukf = setconstraint!(NonLinMPC(

0 commit comments

Comments
 (0)