Skip to main content

Nonlinear Systems and Linearization

Nonlinear systems are the rule rather than the exception in realistic simulation. Friction changes sign, actuators saturate, valves have square-root flow laws, biological populations grow with limiting effects, and chemical reaction rates multiply concentrations. Linear tools are still valuable, but only after the modeler recognizes where the nonlinearities enter and what operating region is being studied.

Linearization builds a local linear approximation around an equilibrium or trajectory. It does not make the original system linear; it gives a model that predicts small deviations near the chosen point. This is especially useful for controller design, small-signal frequency response, and quick stability checks before running large nonlinear simulations.

Definitions

A nonlinear state model has the form

x˙=f(x,u),y=g(x,u).\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x},\mathbf{u}), \qquad \mathbf{y}=\mathbf{g}(\mathbf{x},\mathbf{u}).

An equilibrium (xˉ,uˉ)(\bar{\mathbf{x}},\bar{\mathbf{u}}) satisfies

0=f(xˉ,uˉ).\mathbf{0}=\mathbf{f}(\bar{\mathbf{x}},\bar{\mathbf{u}}).

Deviation variables measure small changes from the operating point:

δx=xxˉ,δu=uuˉ,δy=yyˉ.\delta\mathbf{x}=\mathbf{x}-\bar{\mathbf{x}}, \qquad \delta\mathbf{u}=\mathbf{u}-\bar{\mathbf{u}}, \qquad \delta\mathbf{y}=\mathbf{y}-\bar{\mathbf{y}}.

The first-order Taylor approximation gives

δx˙=Aδx+Bδu,δy=Cδx+Dδu,\delta\dot{\mathbf{x}} =A\delta\mathbf{x}+B\delta\mathbf{u}, \qquad \delta\mathbf{y}=C\delta\mathbf{x}+D\delta\mathbf{u},

where the Jacobian matrices are evaluated at the operating point:

A=fxxˉ,uˉ,B=fuxˉ,uˉ,C=gxxˉ,uˉ,D=guxˉ,uˉ.A=\left.\frac{\partial \mathbf{f}}{\partial \mathbf{x}}\right|_{\bar{x},\bar{u}}, \quad B=\left.\frac{\partial \mathbf{f}}{\partial \mathbf{u}}\right|_{\bar{x},\bar{u}}, \quad C=\left.\frac{\partial \mathbf{g}}{\partial \mathbf{x}}\right|_{\bar{x},\bar{u}}, \quad D=\left.\frac{\partial \mathbf{g}}{\partial \mathbf{u}}\right|_{\bar{x},\bar{u}}.

Common nonlinear elements include saturation, dead zone, relay, Coulomb friction, backlash, hysteresis, quantization, square-root flow, and products of states.

Key results

Linearization is a local approximation. For a scalar function f(x,u)f(x,u),

f(x,u)f(xˉ,uˉ)+fxxˉ,uˉ(xxˉ)+fuxˉ,uˉ(uuˉ).f(x,u)\approx f(\bar{x},\bar{u}) +\left.\frac{\partial f}{\partial x}\right|_{\bar{x},\bar{u}}(x-\bar{x}) +\left.\frac{\partial f}{\partial u}\right|_{\bar{x},\bar{u}}(u-\bar{u}).

At an equilibrium, f(xˉ,uˉ)=0f(\bar{x},\bar{u})=0, so the constant term disappears in deviation coordinates. Away from equilibrium, the constant term must be retained or the system must be linearized along a trajectory.

For a nonlinear scalar first-order model

x˙=f(x),\dot{x}=f(x),

an equilibrium xˉ\bar{x} is locally stable if

f(xˉ)<0,f'(\bar{x})<0,

unstable if f(xˉ)>0f'(\bar{x})\gt 0, and inconclusive by first-order linearization if f(xˉ)=0f'(\bar{x})=0.

Saturation changes effective system behavior. A commanded input ucu_c passed through saturation is

u=sat(uc)={umax,uc>umax,uc,uminucumax,umin,uc<umin.u=\operatorname{sat}(u_c)= \begin{cases} u_\text{max}, & u_c>u_\text{max},\\ u_c, & u_\text{min}\le u_c\le u_\text{max},\\ u_\text{min}, & u_c<u_\text{min}. \end{cases}

Inside the linear range, the slope is one; outside, the slope is zero. A linearization taken in saturation therefore may predict loss of control authority.

The operating point must be stored together with the linear model. The matrices AA, BB, CC, and DD describe deviations, not absolute variables, unless the model has been written in absolute affine form. For example, a tank linearized at h=4h=4 meters and another tank linearized at h=1h=1 meter can have different outlet slopes. If their matrices are saved without the corresponding equilibrium heights and inputs, later comparisons can be misleading.

For simulation studies, a useful workflow is to run the nonlinear model and the linearized model side by side under the same small perturbation. Agreement near the operating point verifies the Jacobian and confirms that the perturbation is small enough. Disagreement under a larger perturbation is not necessarily a failure; it is often the expected evidence that nonlinear behavior is important. The time-response plot should therefore be read as an operating-range test, not only as a prediction.

Linearization can also be performed numerically when symbolic derivatives are inconvenient, but the perturbation size must be chosen carefully. Too large a perturbation measures curvature rather than local slope; too small a perturbation can be dominated by roundoff or solver noise. MATLAB and Simulink linearization tools automate much of this process, yet the resulting matrices still need physical review: signs, units, equilibrium values, and expected mode locations should all be checked.

Visual

NonlinearityMathematical featureSimulation effectLinearization warning
SaturationClipped input/outputLimited response and windup riskSlope may become zero
Dead zoneNo output near zeroDelayed responseLinear slope depends on operating point
Coulomb frictionSign functionStick-slip and discontinuityNot differentiable at zero velocity
Square-root flowh\sqrt{h}State-dependent time constantDerivative large near zero
Product termxyxy or xuxuCoupled gain changesJacobian depends on both variables

Worked example 1: Linearize a nonlinear tank outlet

Problem: A tank obeys

Ah˙=qinkhA\dot{h}=q_\text{in}-k\sqrt{h}

with A=2A=2, k=0.6k=0.6, and nominal inflow qˉin=1.2\bar{q}_\text{in}=1.2. Find the equilibrium height and the linearized model in deviation variables.

  1. Write the scalar state equation:
h˙=f(h,q)=1A(qkh).\dot{h}=f(h,q)=\frac{1}{A}(q-k\sqrt{h}).
  1. Find equilibrium by setting h˙=0\dot{h}=0:
0=qˉkhˉ.0=\bar{q}-k\sqrt{\bar{h}}.
  1. Solve for hˉ\bar{h}:
hˉ=qˉk=1.20.6=2,hˉ=4.\sqrt{\bar{h}}=\frac{\bar{q}}{k}=\frac{1.2}{0.6}=2, \qquad \bar{h}=4.
  1. Compute the Jacobian with respect to hh:
fh=1A(k12h)=k2Ah.\frac{\partial f}{\partial h} =\frac{1}{A}\left(-k\frac{1}{2\sqrt{h}}\right) =-\frac{k}{2A\sqrt{h}}.

At hˉ=4\bar{h}=4,

A=0.62(2)(2)=0.075.A_\ell=-\frac{0.6}{2(2)(2)}=-0.075.
  1. Compute the input Jacobian:
B=fq=1A=0.5.B_\ell=\frac{\partial f}{\partial q}=\frac{1}{A}=0.5.
  1. Write deviation model:
δh˙=0.075δh+0.5δq.\delta\dot{h}=-0.075\delta h+0.5\delta q.

Checked answer: the local time constant is 1/0.07513.33 s1/0.075\approx13.33\ \mathrm{s}. The time-response plot for a small inflow step should resemble a first-order exponential around h=4h=4. For a large step, the nonlinear square-root law changes the effective slope and the linear approximation becomes less accurate.

Simulink description: the nonlinear model uses a Sqrt block in the outlet feedback. The linearized model uses a Sum, Gain 0.50.5 on δq\delta q, Gain 0.075-0.075 on δh\delta h, and an Integrator for δh\delta h. Plot both absolute height responses using h=hˉ+δhh=\bar{h}+\delta h.

Worked example 2: Linearize a pendulum near downward equilibrium

Problem: A damped pendulum satisfies

θ¨+bm2θ˙+gsinθ=1m2τ.\ddot{\theta}+\frac{b}{m\ell^2}\dot{\theta}+\frac{g}{\ell}\sin\theta=\frac{1}{m\ell^2}\tau.

Let x1=θx_1=\theta, x2=θ˙x_2=\dot{\theta}, and input u=τu=\tau. Linearize about θˉ=0\bar{\theta}=0, θ˙ˉ=0\bar{\dot{\theta}}=0, uˉ=0\bar{u}=0.

  1. Write the state equations:
x˙1=x2,x˙2=bm2x2gsinx1+1m2u.\begin{aligned} \dot{x}_1 &= x_2,\\ \dot{x}_2 &= -\frac{b}{m\ell^2}x_2-\frac{g}{\ell}\sin x_1+\frac{1}{m\ell^2}u. \end{aligned}
  1. Compute partial derivatives for the first equation:
x˙1x1=0,x˙1x2=1,x˙1u=0.\frac{\partial \dot{x}_1}{\partial x_1}=0,\qquad \frac{\partial \dot{x}_1}{\partial x_2}=1,\qquad \frac{\partial \dot{x}_1}{\partial u}=0.
  1. Compute partial derivatives for the second equation:
x˙2x1=gcosx1,x˙2x2=bm2,x˙2u=1m2.\frac{\partial \dot{x}_2}{\partial x_1} =-\frac{g}{\ell}\cos x_1, \qquad \frac{\partial \dot{x}_2}{\partial x_2} =-\frac{b}{m\ell^2}, \qquad \frac{\partial \dot{x}_2}{\partial u} =\frac{1}{m\ell^2}.
  1. Evaluate at x1=0x_1=0:
cos0=1.\cos 0=1.
  1. Assemble matrices:
A=[01g/b/(m2)],B=[01/(m2)].A= \begin{bmatrix} 0 & 1\\ -g/\ell & -b/(m\ell^2) \end{bmatrix}, \qquad B= \begin{bmatrix} 0\\ 1/(m\ell^2) \end{bmatrix}.

Checked answer: the small-angle approximation sinθθ\sin\theta\approx\theta gives the same result. The nonlinear and linear time-response plots should agree for small initial angles such as 55^\circ, but diverge for large angles such as 6060^\circ because the sine curve is no longer close to its tangent.

Simulink description: create the nonlinear pendulum with a Trigonometric Function block for sin, damping feedback, torque input, and two integrators. The linear model can use a State-Space block. Scope both angles on the same plot.

Code

clear; clc; close all;

% Nonlinear tank versus local linear model
A = 2; k = 0.6; qbar = 1.2; hbar = (qbar/k)^2;
dfdh = -k/(2*A*sqrt(hbar));
dfdq = 1/A;

qstep = 0.1;
nonlinear_tank = @(t,h) (qbar + qstep - k*sqrt(max(h,0)))/A;
linear_tank = @(t,dh) dfdh*dh + dfdq*qstep;
[tn, hn] = ode45(nonlinear_tank, [0 80], hbar);
[tl, dhl] = ode45(linear_tank, [0 80], 0);

figure;
plot(tn, hn, 'b-', tl, hbar + dhl, 'r--', 'LineWidth', 1.4);
grid on; xlabel('Time (s)'); ylabel('Height (m)');
legend('Nonlinear', 'Linearized', 'Location', 'best');
title('Nonlinear tank and local linear approximation');

% Pendulum nonlinear versus linear for small initial angle
m = 1; ell = 1; b = 0.1; g = 9.81;
x0 = [5*pi/180; 0];
pend_nl = @(t,x) [x(2); -(b/(m*ell^2))*x(2) - (g/ell)*sin(x(1))];
Apend = [0 1; -g/ell -b/(m*ell^2)];
pend_lin = @(t,x) Apend*x;
[t1, xnl] = ode45(pend_nl, [0 10], x0);
[t2, xlin] = ode45(pend_lin, [0 10], x0);

figure;
plot(t1, xnl(:,1), 'b-', t2, xlin(:,1), 'r--', 'LineWidth', 1.4);
grid on; xlabel('Time (s)'); ylabel('\theta (rad)');
legend('Nonlinear', 'Linearized', 'Location', 'best');
title('Small-angle pendulum comparison');

The tank plot should show close agreement for the small inflow perturbation. The pendulum plot should show nearly identical small-angle motion; increasing the initial angle reveals the limits of linearization. These comparisons are stronger than simply deriving a Jacobian because they show the operating range over which the approximation is useful.

Common pitfalls

  • Linearizing before finding a valid operating point. The constant term will not vanish unless the point is an equilibrium.
  • Applying a small-signal model to a large transient, especially through saturation or dead-zone regions.
  • Differentiating discontinuous nonlinearities as if they were smooth. Friction, relays, and quantizers need special treatment.
  • Forgetting to convert deviation outputs back to physical variables before comparing with nonlinear simulation.
  • Assuming stability of the linearized model proves global nonlinear stability. It only gives local information under appropriate conditions.
  • Ignoring units in Jacobians. Each matrix entry has units determined by the derivative it represents.

Connections