Accelerating the pace of engineering and science

# Documentation

## Analyzing Stability Margin of Simulink Models

Robust Control Toolbox™ provides the loopmargin command to analyze the stability margins of LTI models created in MATLAB® and Simulink® models. To use loopmargin with Simulink models, you must have the Simulink Control Design™ software. This section describes the difference between the MATLAB and Simulink approaches of using loopmargin and the workflow for computing the stability margin of Simulinkmodels. For more information on how to analyze the stability margins of LTI models, see MIMO Robustness Analysis.

### How Stability Margin Analysis Using Loopmargin Differs Between Simulink and LTI Models

When analyzing stability margins of LTI models using the syntax [cm,dm,mm] = loopmargin(P,C), the software assumes the input and output of the linear plant P as the margin analysis points, as shown in the following figure.

Analyzing stability margin of Simulink models differs from analyzing stability margin of LTI models because you can enter specific margin analysis points in the Simulink model. For more information on how to assign margin analysis points in Simulink models, see the "Usage with Simulink" section of the loopmargin reference page.

### Stability Margin of Simulink Model

The loopmargin command computes the following types of stability margins:

• Loop-at-a-time classical gain and phase margins

• Loop-at-a-time disk margins

• Multi-loop disk margin

The loopmargin command computes the stability margin based on linearization of Simulink models. To compute stability margins of a Simulink model:

1. Specify the block where you want to define a margin analysis point.

2. Specify the output port of the block where you want the margin analysis point.

The software performs the analysis by opening the loop at all specified margin analysis point.

3. Use the loopmargin command to compute the stability margins at the margin analysis point.

Optionally, you can compare the classical gain and phase margins obtained using loopmargin with the stability margins computed for the linearized model. The results using the two approaches should match for simple SISO models. For MIMO models, the loopmargin command provides richer robustness information. For an example, see Stability Margin of a Simulink Model.

Additionally, you can compute stability margins by specifying multiple margin analysis points and multiple operating points. For an example, see Loop Margins for an Airframe AutopilotLoop Margins for an Airframe Autopilot.