@@ -396,7 +396,26 @@ savefig("plot10_NonLinMPC.svg"); nothing # hide
396396
397397![ plot10_NonLinMPC] ( plot10_NonLinMPC.svg )
398398
399- The closed-loop performance is still lower than the nonlinear controller, as expected, but
399+ Additionally, similar results are obtained by using a sparse [ ` MultipleShooting ` ] ( @ref )
400+ transcription, which is known to be more robust for unstable systems, with a solver that can
401+ explicilty handle sparsity like the default ` OSQP ` :
402+
403+ ``` @example man_nonlin
404+ mpc_ms = LinMPC(skf; Hp, Hc, Mwt, Nwt, Cwt=Inf, transcription=MultipleShooting())
405+ mpc_ms = setconstraint!(mpc_ms, umin=[-1.5], umax=[+1.5])
406+ ```
407+
408+ Superimposing the previous disturbance rejection plot shows almost identical results:
409+
410+ ``` @example man_nonlin
411+ res_ms = sim!(mpc_ms, N, [180.0]; plant, x_0=[π, 0], y_step=[10])
412+ plot!(res_ms)
413+ savefig("plot10b_NonLinMPC.svg"); nothing # hide
414+ ```
415+
416+ ![ plot10b_NonLinMPC] ( plot10b_NonLinMPC.svg )
417+
418+ The closed-loop performances are still lower than the nonlinear controller, as expected, but
400419computations are about 210 times faster (0.000071 s versus 0.015 s per time steps, on
401420average). However, remember that ` linmodel ` is only valid for angular positions near 180°.
402421For example, the 180° setpoint response from 0° is unsatisfactory since the predictions are
0 commit comments