Soft upper bound constraint
sys = LTISystem('A', 0.9, 'B', 1, 'C', 1);Add unity quadratic penalties on states and inputs (but not on the terminal state)
sys.x.penalty = Penalty(1, 2); sys.u.penalty = Penalty(1, 2);
=========================================================== The Penalty object is deprecated. Use obj.penalty = QuadFunction(Q) to define z'*Q*z penalty. =========================================================== =========================================================== The Penalty object is deprecated. Use obj.penalty = QuadFunction(Q) to define z'*Q*z penalty. ===========================================================Define hard state constraints
sys.x.min = -1; sys.x.max = 1;Make the upper bound soft with maximal violation of
sys.x.with('softMax'); sys.x.softMax.maximalViolation = 3; M = MPCController(sys, 4); x0 = 3.5; [u, feasible, openloop] = M.evaluate(x0)
u = -2.15 feasible = 1 openloop = cost: 25018.3457016632 U: [-2.15 -0.525779625779547 -0.168399168399664 -7.04103442217274e-13] X: [3.5 0.999999999999999 0.374220374220451 0.168399168398741 0.151559251558165] Y: [3.5 1 0.37422037422045 0.168399168398741]
◀ | filter_penalty | filter_max | ▶ |
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk