Construction of explicit controller for LTI system
mpt_demo_lti4
A = [1 1; 0 1]; B = [1; 0.5];
lti = LTISystem('A', A, 'B', B);Define an MPC controller
horizon = 5; ctrl = MPCController(lti); ctrl.N = horizon; ctrl.model.x.min = [-5; -5]; ctrl.model.x.max = [5; 5]; ctrl.model.u.min = -1; ctrl.model.u.max = 1; ctrl.model.x.penalty = QuadFunction(eye(ctrl.model.nx)); ctrl.model.u.penalty = QuadFunction(eye(ctrl.model.nu));Compute the explicit solution
exp_ctrl = ctrl.toExplicit()
mpt_plcp: 21 regions Explicit MPC controller (horizon: 5, regions: 21)Plot the explicit feedback law
exp_ctrl.feedback.fplot()
exp_ctrl.cost.fplot()
exp_ctrl.partition.plot()
x0 = [-4; 0]; Uonl = ctrl.evaluate(x0), Uexp = exp_ctrl.evaluate(x0)
Uonl = 1 Uexp = 1
◀ | mpt_demo_functions2 | mpt_demo_sets2 | ▶ |
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk