Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 36 ยท Control Design

Simulink Linearization, Operating Points and Frequency Response

Find an operating point, linearize a nonlinear Simulink model with linear analysis points, read poles, Bode plots and stability margins, and know what the results mean.

Simulink models are usually nonlinear: saturations, trigonometry, lookup tables. Classical control design (poles, Bode plots, margins) needs a linear model. Linearization replaces the nonlinear model by the best linear model near one operating point. This lesson shows how that works in Simulink and Simulink Control Design, how to read the results, and gives Python stand-ins that perform the same calculations numerically.

The MathWorks tools themselves cannot run on this site. Commands and menus are described, and every runnable example below is a labelled stand-in written with NumPy in the browser.

The idea

For a model x' = f(x, u), y = g(x, u) and an operating point (x0, u0) where f(x0, u0) = 0 (an equilibrium or trim point), the linear model describes small deviations dx, du, dy:

TEXT
dx' = A dx + B du
dy  = C dx + D du
A = df/dx, B = df/du, C = dg/dx, D = dg/du   (all evaluated at x0, u0)

Simulink does this block by block: it linearizes each block symbolically or numerically and combines the results according to the wiring. The answer is valid only near the operating point; far from it the nonlinear model behaves differently.

Step 1: find an operating point

An operating point is the state values and input values at which you linearize. Options:

  • Initial condition: the model's initial state (simplest, but rarely an equilibrium).
  • Snapshot: take the state at a given simulation time, for example after the plant settles, in the Model Linearizer app (Linearization tab > Operating Point > Take Snapshots).
  • Trim: let the software find an equilibrium. In the Model Linearizer choose Operating Point > Trim Model, or in code:
MATLAB
op = findop('myModel', operspec('myModel'));   % steady-state trim

In Simulink models with outputs that must hold a value (for example "speed must be 100 rad/s"), edit the operating point specification to set known states, fixed inputs and output constraints, then trim.

Step 2: mark the linear analysis points

A linear analysis point says where to inject a small signal and where to measure the response. Right-click a signal line > Linear Analysis Points and choose:

  • Input Perturbation: add a small test signal here (an input).
  • Output Measurement: read this signal (an output).
  • Loop Break (or Open Loop): cut the loop here during analysis only; the simulation is not changed. Use it to compute the open-loop transfer function L = C*P.
  • Loop Transfer points and combinations (for example Input Perturbation and Output Measurement on the same signal gives the sensitivity function when used correctly).

You can also set them with linio in code, or in the Model Linearizer's Linearization Plots and Analysis Points table.

Step 3: linearize

In the app: Linearize > choose the operating point and the plot types (Step, Bode, Pole-Zero). The result is a state-space (ss) object added to the Linear Analysis Workspace. In code:

MATLAB
io = getlinio('myModel');
sys = linearize('myModel', io, op);   % returns an ss model
bode(sys); step(sys); pzmap(sys);

Requirements and tips:

  • The model should have all dynamics in blocks that can be linearized. Blocks that cannot (MATLAB Function block with discrete logic, Stateflow, some lookup tables with large flat areas) give zero or misleading results. Replace them temporarily or provide a custom linearization in the block's properties.
  • Switches and saturations give different answers depending on which branch is active at the operating point.
  • Discrete blocks produce discrete models; the sample-time conversion happens automatically.
flowchart LR
    M["Nonlinear model"] --> T["Trim: operating point"]
    T --> L["Linearize at the point"]
    L --> S["State-space A, B, C, D"]
    S --> A["Poles, step, Bode, margins"]
    A --> D["Controller design"]
    D --> V["Verify on the full nonlinear model"]

Always close the loop: design on the linear model, verify on the nonlinear one.

A stand-in: linearizing a pendulum numerically

A damped pendulum theta'' = -(g/L) sin(theta) - c theta' + u/(m L^2) has two equilibria (down and up). The code below finds the Jacobians by finite differences and prints the eigenvalues. The same numbers come from the Model Linearizer for an equivalent model, but this is our own calculation.

Python Stand-in: numerical linearization of a damped pendulum

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The hanging position has eigenvalues with negative real parts (stable); the upright position has one positive real eigenvalue (unstable). A controller designed for the upright position has to hold an unstable equilibrium, and the linear model is valid only for small angles around it.

Reading the results

  • Poles (eigenvalues of A): stable if all real parts are negative (continuous time) or all magnitudes are less than 1 (discrete time). Complex pairs mean oscillation; the real part sets the decay, the imaginary part the frequency.
  • Step response: rise time, overshoot, settling time and steady-state value.
  • Bode plot: magnitude and phase versus frequency (rad/s, log scale). The bandwidth is where the loop magnitude crosses 0 dB, roughly the speed of the closed loop.
  • Gain margin and phase margin (shown by margin(L)): how much extra gain or phase lag the loop tolerates before instability. As a rule of thumb, a gain margin above 6 dB (factor 2) and a phase margin of 45 to 60 degrees give good robustness.
  • Sensitivity S = 1/(1 + L) and complementary sensitivity T = L/(1 + L): peaks above about 2 (6 dB) suggest poor robustness or high noise amplification.

A stand-in for frequency response and margins

The stand-in evaluates L(jw) = K / (s (s + 2)) over a range of frequencies and finds the crossover frequency and phase margin by scanning. It uses only complex arithmetic.

Python Stand-in: gain crossover and phase margin by frequency scan

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that raising the gain moves the crossover to higher frequency and reduces the phase margin; this is why a more aggressive loop is less robust. In Simulink, margin(sys) performs this analysis for you.

Frequency response estimation from a simulation

If your model cannot be linearized (for example because of Stateflow or a hand-written discrete block), you can estimate the frequency response: apply a sinusoidal, chirp or step test signal at an input perturbation point, simulate, and compare input and output spectra. In the Model Linearizer choose Estimate (Frequency Response Estimation) and set the frequency range; the result is a measured frequency response you can plot with Bode and use to fit a transfer function (System Identification Toolbox's tfest, or Fit commands in the app).

Common mistakes

  • Linearizing at the wrong point. The model is not at an equilibrium; results change with the snapshot time.
  • Unmarked or misplaced analysis points, so the open loop is wrong (a missing loop break gives the closed-loop response).
  • Trusting the linear model far from the operating point: always test the final controller on the nonlinear model.
  • Non-linearizable blocks (Stateflow, MATLAB Function with logic) silently contribute zero dynamics.
  • Mixing units (Hz versus rad/s) when reading the Bode plot; Simulink's default is rad/s.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What must an operating point usually satisfy for a trim linearization?

    A trim finds states and inputs for which the derivatives are zero, so the model stays at rest there.
  2. 2. What does a loop break linear analysis point do?

    It is used to compute open-loop responses and margins while the model itself is unchanged.
  3. 3. Which results suggest a robust loop?

    These margins leave room for model errors and delay.
  4. 4. What happens to a Stateflow chart during linearization?

    Stateflow logic is not differentiable, so it needs a custom linearization or must be replaced during analysis.

Summary

  • Linearization gives A, B, C, D valid near an operating point; find the point with a snapshot or trim (findop).
  • Mark inputs, outputs and loop breaks with linear analysis points, then linearize in the Model Linearizer or with linearize.
  • Read poles, step responses, Bode plots and gain and phase margins to judge speed and robustness.
  • If a model cannot be linearized, estimate the frequency response from simulation.
  • Verify every linear design on the full nonlinear model.

Next: State feedback, observers and LQR