## Passivity Enforcement for Control Design

A system is *passive* if it cannot produce energy on its
own, and can only dissipate the energy that is stored in it initially. In many cases, you can
enforce passivity on a closed loop system by modifying the actions of the controller such that
the system dissipates energy over time, and therefore has a stable equilibrium.

### Passivity Enforcement Block

The Passivity
Enforcement block, which requires Optimization Toolbox™ software, computes the modified control actions that are closest to specified
control actions subject to passivity constraints and action bounds. The block uses a
quadratic programming (QP) solver to find the control action *u* that
minimizes the function $${\left|u-{u}_{0}\right|}^{2}$$ in real time. Here, *u*_{0} is the
unmodified control action from the controller.

The solver applies the following constraints to the optimization problem.

$$\begin{array}{l}\rho {y}_{p}{}^{T}{y}_{p}+{y}_{p}{}^{T}{f}_{p}+{y}_{p}{}^{T}{g}_{p}u\le 0\\ {u}_{\mathrm{min}}\le u\le {u}_{\mathrm{max}}\end{array}$$

Here:

*ρ*is the passivity index.*y*_{p}is the passivity output function, defined as $${y}_{p}={h}_{p}(x)$$.*f*_{p}and*g*_{p}are the functions defined by the passivity input function $${u}_{p}={f}_{p}(x)+{g}_{p}(x)u$$.*u*_{min}is a lower bound for the control action.*u*_{max}is an upper bound for the control action.

Since the Passivity Enforcement block modifies the original control action, the final closed-loop system might not achieve the design objectives of the original controller, such as stability margins.

You must verify that the combined controller and Passivity Enforcement block meet your original control objectives. If the system does not meet your original objectives, consider updating your original controller design. For example, you can add additional gain and phase margins to compensate for any potential performance degradation.

### Passivity Functions

If the plant model is passive, then there exists a storage function such that:

$$\dot{V}(x)\le {u}^{T}y.$$

If the controller satisfies the following condition.

$$\begin{array}{cc}{u}^{T}y\le -\rho {y}^{T}y& (\rho >0)\end{array}$$

Then, the closed loop system becomes

$$\dot{V}(x)\le -\rho {y}^{T}y\le 0,$$

and if the plant model is zero-state observable ( if *u* = 0, and
*x* = 0 when *y* = 0), then the closed-loop system is
asymptotically stable.

In general, when you have a closed-loop system with a nominal controller, you can define the following based on the plant dynamics.

Passivity input function — $${u}_{p}={f}_{p}(x)+{g}_{p}(x)u$$

Passivity output function — $${y}_{p}={h}_{p}(x)$$

You can then make the closed-loop system satisfy the following inequality to enforce passivity.

$${u}_{p}{}^{T}{y}_{p}\le -\rho {y}_{p}{}^{T}{y}_{p}$$

The Passivity Enforcement block formulates this problem as a quadratic programming optimization problem as defined in the previous section. For more information, see About Passivity and Passivity Indices.

You can formulate passivity constraint depending on your control design goals, such as
feedback stability or reference tracking, depending on how you specify the passivity input
function *u*_{p} and passivity
output function *y*_{p}. For an
example that uses passivity constraints for stability, see Enforce Passivity Constraints for Quadruple-Tank System. For an example that
uses passivity constraints for vibration control in a beam, see Enforce Passivity Constraint for Flexible Beam.