softMin

Purpose

Soft lower bound constraint

Syntax


Description

This filter will soften the lower bound constraint on a selected signal in the MPC setup. Without this filter, lower bounds are hard, i.e., the signal has to satisfy ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin1.png. With this filter added, the lower bound is soft and can be violated by some positive margin ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin2.png, i.e., the new constraint becomes ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin3.png. The slack variables ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin4.png are then penalized in the MPC cost function by adding the term ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin5.png.

To enable this filter, first call model.signal.with('softMin'), where you replace signal by the actual system's signal (typically by x for state variables, u for inputs, and y for outputs).

With the filter enabled, you can set the maximal allowed violation of the constraint in model.signal.softMin.maximalViolation, and specify penalization of the slack variables by setting model.signal.softMin.penalty.

To remove this filter, call model.signal.without('softMin').

Example(s)

Example 1

Specify an LTI system ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin6.png, ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin7.png
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 = QuadFunction(1);
		sys.u.penalty = QuadFunction(1);
	
Define hard state constraints
sys.x.min = -1; sys.x.max = 1;
Make the lower bound soft with maximal violation of ../../../../../fig/mpt/modules/ui/@SystemSignal/filter_softmin8.png
      
		sys.x.with('softMin');
		sys.x.softMin.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]


© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk