Tutorials / Model Reference Adaptive Control (MRAC)

Model Reference Adaptive Control (MRAC)

May 23, 2026

MRACadaptive controlLyapunovMIT rulestability

🚧 Under Development This tutorial is actively being updated. Check back for more content and refinements.

Introduction

Model Reference Adaptive Control (MRAC) is a powerful technique for controlling systems with unknown or slowly varying parameters. Instead of designing a controller for a fixed plant model, MRAC designs a controller that adapts its own parameters in real time so the closed-loop plant behaves like a desired reference model.

This tutorial covers two approaches:

  1. Lyapunov-based Gradient β€” Guaranteed stability, simpler to implement
  2. MIT Rule β€” Gradient-based, historically significant

Try the interactive MRAC Demo while reading this tutorial β€” adjust plant parameters mid-simulation and watch the controller adapt.


The Problem Setup

Plant (Unknown Parameters)

We have a first-order SISO plant with unknown parameters aa and bb:

yΛ™=βˆ’aβ‹…y+bβ‹…u\dot{y} = -a \cdot y + b \cdot u
SymbolMeaning
yyPlant output
uuControl input
aaUnknown pole location (stable if a>0a > 0)
bbUnknown input gain

Reference Model (Desired Behavior)

We want the plant to behave like this reference model with known parameters ama_m and bmb_m:

yΛ™m=βˆ’amβ‹…ym+bmβ‹…r\dot{y}_m = -a_m \cdot y_m + b_m \cdot r
SymbolMeaning
ymy_mReference model output
rrReference command input
ama_mDesired pole location
bmb_mDesired DC gain

Control Law Structure

The adaptive controller has the structure:

u=ΞΈ1β‹…r+ΞΈ2β‹…yu = \theta_1 \cdot r + \theta_2 \cdot y

where ΞΈ1\theta_1 and ΞΈ2\theta_2 are adaptive parameters that will be updated in real time.


Derivation: Lyapunov-Based Approach

Step 1: Define the Error

The tracking error is the difference between the plant output and the reference model output:

e=ymβˆ’ye = y_m - y

We want eβ†’0e \to 0 as tβ†’βˆžt \to \infty.

Step 2: Find the Ideal Parameters

If the plant parameters aa and bb were known, we could choose ΞΈ1\theta_1 and ΞΈ2\theta_2 so that the closed-loop dynamics match the reference model exactly.

Substitute the control law u=ΞΈ1β‹…r+ΞΈ2β‹…yu = \theta_1 \cdot r + \theta_2 \cdot y into the plant:

yΛ™=βˆ’aβ‹…y+bβ‹…(ΞΈ1β‹…r+ΞΈ2β‹…y)=βˆ’(aβˆ’bΞΈ2)β‹…y+bΞΈ1β‹…r\dot{y} = -a \cdot y + b \cdot (\theta_1 \cdot r + \theta_2 \cdot y) = -(a - b\theta_2) \cdot y + b\theta_1 \cdot r

To match yΛ™m=βˆ’amβ‹…ym+bmβ‹…r\dot{y}_m = -a_m \cdot y_m + b_m \cdot r, we need:

aβˆ’bΞΈ2βˆ—=amβ‡’ΞΈ2βˆ—=aβˆ’amba - b\theta_2^* = a_m \quad \Rightarrow \quad \theta_2^* = \frac{a - a_m}{b} bΞΈ1βˆ—=bmβ‡’ΞΈ1βˆ—=bmbb\theta_1^* = b_m \quad \Rightarrow \quad \theta_1^* = \frac{b_m}{b}

These ΞΈ1βˆ—\theta_1^* and ΞΈ2βˆ—\theta_2^* are the ideal parameters that would give perfect tracking if the plant were known.

Step 3: Error Dynamics with Adaptive Parameters

Since aa and bb are unknown, the ideal parameters ΞΈ1βˆ—\theta_1^* and ΞΈ2βˆ—\theta_2^* cannot be computed. Instead, we use the adaptive parameters ΞΈ1\theta_1 and ΞΈ2\theta_2 from the control law and define the parameter errors as the gap between the current adaptive values and their ideal counterparts:

ΞΈ~1=ΞΈ1βˆ’ΞΈ1βˆ—andΞΈ~2=ΞΈ2βˆ’ΞΈ2βˆ—\tilde{\theta}_1 = \theta_1 - \theta_1^* \quad \text{and} \quad \tilde{\theta}_2 = \theta_2 - \theta_2^*

Differentiate the tracking error:

eΛ™=yΛ™mβˆ’yΛ™=(βˆ’amym+bmr)βˆ’(βˆ’ay+bu)\dot{e} = \dot{y}_m - \dot{y} = (-a_m y_m + b_m r) - (-a y + b u)

Substitute the control law u=ΞΈ1r+ΞΈ2yu = \theta_1 r + \theta_2 y:

eΛ™=βˆ’amym+bmr+ayβˆ’b(ΞΈ1r+ΞΈ2y)\dot{e} = -a_m y_m + b_m r + a y - b(\theta_1 r + \theta_2 y)

Rearrange:

eΛ™=βˆ’am(ymβˆ’y)+(bmβˆ’bΞΈ1)r+(aβˆ’bΞΈ2)y\dot{e} = -a_m(y_m - y) + (b_m - b\theta_1)r + (a - b\theta_2)y

Now substitute ΞΈ1=ΞΈ~1+ΞΈ1βˆ—\theta_1 = \tilde{\theta}_1 + \theta_1^* and ΞΈ2=ΞΈ~2+ΞΈ2βˆ—\theta_2 = \tilde{\theta}_2 + \theta_2^*, using the ideal parameter relationships:

bmβˆ’bΞΈ1=bmβˆ’b(ΞΈ~1+ΞΈ1βˆ—)=βˆ’bΞΈ~1b_m - b\theta_1 = b_m - b(\tilde{\theta}_1 + \theta_1^*) = -b\tilde{\theta}_1 aβˆ’bΞΈ2=aβˆ’b(ΞΈ~2+ΞΈ2βˆ—)=amβˆ’bΞΈ~2a - b\theta_2 = a - b(\tilde{\theta}_2 + \theta_2^*) = a_m - b\tilde{\theta}_2

So:

eΛ™=βˆ’ameβˆ’bΞΈ~1r+(amβˆ’bΞΈ~2)yβˆ’amy\dot{e} = -a_m e - b\tilde{\theta}_1 r + (a_m - b\tilde{\theta}_2)y - a_m y

Simplify the yy terms:

eΛ™=βˆ’ameβˆ’bΞΈ~1rβˆ’bΞΈ~2y\dot{e} = -a_m e - b\tilde{\theta}_1 r - b\tilde{\theta}_2 y

This is the error dynamics in terms of the parameter errors:

eΛ™=βˆ’ameβˆ’b(ΞΈ~1r+ΞΈ~2y)\boxed{\dot{e} = -a_m e - b(\tilde{\theta}_1 r + \tilde{\theta}_2 y)}

Step 4: Choose a Lyapunov Function

To guarantee stability, we choose a Lyapunov function that includes both the tracking error and the parameter errors:

V=12e2+b2Ξ³1ΞΈ~12+b2Ξ³2ΞΈ~22V = \frac{1}{2}e^2 + \frac{b}{2\gamma_1}\tilde{\theta}_1^2 + \frac{b}{2\gamma_2}\tilde{\theta}_2^2

where Ξ³1,Ξ³2>0\gamma_1, \gamma_2 > 0 are adaptation gains that control how fast the parameters adapt.

Step 5: Compute VΛ™\dot{V} and Choose Adaptation Laws

Differentiate VV:

VΛ™=eβ‹…eΛ™+bΞ³1ΞΈ~1β‹…ΞΈ~Λ™1+bΞ³2ΞΈ~2β‹…ΞΈ~Λ™2\dot{V} = e \cdot \dot{e} + \frac{b}{\gamma_1}\tilde{\theta}_1 \cdot \dot{\tilde{\theta}}_1 + \frac{b}{\gamma_2}\tilde{\theta}_2 \cdot \dot{\tilde{\theta}}_2

Since ΞΈ1βˆ—\theta_1^* and ΞΈ2βˆ—\theta_2^* are constant, ΞΈ~Λ™1=ΞΈΛ™1\dot{\tilde{\theta}}_1 = \dot{\theta}_1 and ΞΈ~Λ™2=ΞΈΛ™2\dot{\tilde{\theta}}_2 = \dot{\theta}_2.

Substitute eΛ™=βˆ’ameβˆ’b(ΞΈ~1r+ΞΈ~2y)\dot{e} = -a_m e - b(\tilde{\theta}_1 r + \tilde{\theta}_2 y):

VΛ™=eβ‹…[βˆ’ameβˆ’b(ΞΈ~1r+ΞΈ~2y)]+bΞ³1ΞΈ~1β‹…ΞΈΛ™1+bΞ³2ΞΈ~2β‹…ΞΈΛ™2\dot{V} = e \cdot [-a_m e - b(\tilde{\theta}_1 r + \tilde{\theta}_2 y)] + \frac{b}{\gamma_1}\tilde{\theta}_1 \cdot \dot{\theta}_1 + \frac{b}{\gamma_2}\tilde{\theta}_2 \cdot \dot{\theta}_2

Expand:

VΛ™=βˆ’ame2βˆ’bΞΈ~1erβˆ’bΞΈ~2ey+bΞ³1ΞΈ~1ΞΈΛ™1+bΞ³2ΞΈ~2ΞΈΛ™2\dot{V} = -a_m e^2 - b\tilde{\theta}_1 e r - b\tilde{\theta}_2 e y + \frac{b}{\gamma_1}\tilde{\theta}_1 \dot{\theta}_1 + \frac{b}{\gamma_2}\tilde{\theta}_2 \dot{\theta}_2

Group the ΞΈ~1\tilde{\theta}_1 and ΞΈ~2\tilde{\theta}_2 terms:

VΛ™=βˆ’ame2+ΞΈ~1(bΞ³1ΞΈΛ™1βˆ’ber)+ΞΈ~2(bΞ³2ΞΈΛ™2βˆ’bey)\dot{V} = -a_m e^2 + \tilde{\theta}_1 \left(\frac{b}{\gamma_1}\dot{\theta}_1 - b e r\right) + \tilde{\theta}_2 \left(\frac{b}{\gamma_2}\dot{\theta}_2 - b e y\right)

Step 6: Choose Adaptation Laws to Make V˙≀0\dot{V} \leq 0

To ensure stability, we want V˙≀0\dot{V} \leq 0. The first term βˆ’ame2-a_m e^2 is already negative semi-definite (since am>0a_m > 0). We can make the remaining terms zero by choosing:

bΞ³1ΞΈΛ™1βˆ’ber=0β‡’ΞΈΛ™1=Ξ³1er\frac{b}{\gamma_1}\dot{\theta}_1 - b e r = 0 \quad \Rightarrow \quad \boxed{\dot{\theta}_1 = \gamma_1 e r} bΞ³2ΞΈΛ™2βˆ’bey=0β‡’ΞΈΛ™2=Ξ³2ey\frac{b}{\gamma_2}\dot{\theta}_2 - b e y = 0 \quad \Rightarrow \quad \boxed{\dot{\theta}_2 = \gamma_2 e y}

With these adaptation laws:

VΛ™=βˆ’ame2≀0\dot{V} = -a_m e^2 \leq 0

This proves that:

  • The tracking error ee converges to zero
  • The parameter errors ΞΈ~1\tilde{\theta}_1, ΞΈ~2\tilde{\theta}_2 remain bounded
  • The adaptive system is globally stable

Complete Lyapunov-Based MRAC Algorithm

Initialize: y(0)=0y(0) = 0, ym(0)=0y_m(0) = 0, ΞΈ1(0)=0\theta_1(0) = 0, ΞΈ2(0)=0\theta_2(0) = 0

At each time step tt:

  1. Read reference: r(t)r(t)

  2. Compute control:

    u=ΞΈ1β‹…r+ΞΈ2β‹…yu = \theta_1 \cdot r + \theta_2 \cdot y
  3. Integrate plant and reference model:

    yΛ™=βˆ’aβ‹…y+bβ‹…u(unknownΒ trueΒ plant)\dot{y} = -a \cdot y + b \cdot u \quad \text{(unknown true plant)} yΛ™m=βˆ’amβ‹…ym+bmβ‹…r\dot{y}_m = -a_m \cdot y_m + b_m \cdot r
  4. Compute error:

    e=ymβˆ’ye = y_m - y
  5. Update adaptive parameters:

    ΞΈΛ™1=Ξ³1β‹…eβ‹…r\dot{\theta}_1 = \gamma_1 \cdot e \cdot r ΞΈΛ™2=Ξ³2β‹…eβ‹…y\dot{\theta}_2 = \gamma_2 \cdot e \cdot y

Tuning the Adaptation Gains Ξ³\gamma

GainEffectTypical Value
Ξ³1\gamma_1Speed of ΞΈ1\theta_1 adaptation0.5–2.0
Ξ³2\gamma_2Speed of ΞΈ2\theta_2 adaptation0.5–2.0

Too low (Ξ³β‰ͺ0.1\gamma \ll 0.1): Adaptation is sluggish; error decays slowly.

Too high (γ≫5\gamma \gg 5): Parameters oscillate; may cause instability with large rr or yy.

Best practice: Start with Ξ³1=Ξ³2=1.0\gamma_1 = \gamma_2 = 1.0 and adjust based on response.


MIT Rule: Derivation and Comparison

The MIT rule is the original approach to model-reference adaptive control, developed at the Instrumentation Laboratory at MIT. It is based on gradient descent on the squared error.

The MIT Rule

Let ee be the error between the output of the closed-loop system and the output of the reference model. One possibility is to adjust parameters in such a way that the loss function

J(ΞΈ)=12e2J(\theta) = \frac{1}{2} e^2

is minimized. The gradient method gives

ΞΈΛ™=βˆ’Ξ³βˆ‚Jβˆ‚ΞΈ=βˆ’Ξ³eβˆ‚eβˆ‚ΞΈ\boxed{\dot{\theta} = -\gamma \frac{\partial J}{\partial \theta} = -\gamma e \frac{\partial e}{\partial \theta}}

The partial derivative βˆ‚eβˆ‚ΞΈ\frac{\partial e}{\partial \theta}, which is called the sensitivity derivative of the system, tells how the error is influenced by the adjustable parameter. If it is assumed that the parameter changes are slower than the other variables in the system, then the derivative βˆ‚eβˆ‚ΞΈ\frac{\partial e}{\partial \theta} can be evaluated under the assumption that ΞΈ\theta is constant.

MIT Rule for First-Order Systems (Example 5.2)

Consider the first-order plant:

yΛ™=βˆ’ay+bu\dot{y} = -a y + b u

where uu is the control variable and yy is the measured output. Assume that we want to obtain a closed-loop system described by

yΛ™m=βˆ’amym+bmr\dot{y}_m = -a_m y_m + b_m r

Let the controller be given by

u=ΞΈ1rβˆ’ΞΈ2yu = \theta_1 r - \theta_2 y

The controller has two parameters. If they are chosen to be

ΞΈ1βˆ—=bmb,ΞΈ2βˆ—=aβˆ’amb\theta_1^* = \frac{b_m}{b}, \quad \theta_2^* = \frac{a - a_m}{b}

the input-output relations of the system and the model are the same. This is called perfect model-following.

To apply the MIT rule, introduce the error

e=yβˆ’yme = y - y_m

where yy denotes the output of the closed-loop system. It follows from the plant and controller equations that

y=bp+a+bΞΈ2β‹…ucy = \frac{b}{p + a + b\theta_2} \cdot u_c

where p=d/dtp = d/dt is the differential operator. The sensitivity derivatives are obtained by taking partial derivatives with respect to the controller parameters ΞΈ1\theta_1 and ΞΈ2\theta_2:

βˆ‚eβˆ‚ΞΈ1=bp+a+bΞΈ2β‹…r\frac{\partial e}{\partial \theta_1} = \frac{b}{p + a + b\theta_2} \cdot r βˆ‚eβˆ‚ΞΈ2=βˆ’bp+a+bΞΈ2β‹…y\frac{\partial e}{\partial \theta_2} = -\frac{b}{p + a + b\theta_2} \cdot y

These formulas cannot be used directly because the process parameters aa and bb are not known. Approximations are therefore required. One possible approximation is based on the observation that p+a+bΞΈ2β‰ˆp+amp + a + b\theta_2 \approx p + a_m when the parameters give perfect model-following. We will therefore use the approximation

p+a+bΞΈ2β‰ˆp+amp + a + b\theta_2 \approx p + a_m

which will be reasonable when parameters are close to their correct values. With this approximation we get the following equations for updating the controller parameters:

ΞΈΛ™1=Ξ³β‹…eβ‹…amp+amβ‹…r\boxed{\dot{\theta}_1 = \gamma \cdot e \cdot \frac{a_m}{p + a_m} \cdot r} ΞΈΛ™2=βˆ’Ξ³β‹…eβ‹…amp+amβ‹…y\boxed{\dot{\theta}_2 = -\gamma \cdot e \cdot \frac{a_m}{p + a_m} \cdot y}

In these equations we have combined the parameters Ξ³β€²\gamma' (the raw adaptation gain from the MIT rule) and ama_m with the adaptation gain Ξ³\gamma, since they appear as the product Ξ³β€²b/am\gamma' b/a_m. The sign of parameter bb must be known to have the correct sign of Ξ³\gamma. Notice that the filter has also been normalized so that its steady-state gain is unity.

(This follows Example 5.2 in Γ…strΓΆm & Wittenmark, 2008, p. 190–191.)

Filter Implementation

The operator amp+am\frac{a_m}{p + a_m} represents a first-order filter with unity steady-state gain. In state-space form:

xΛ™1=βˆ’amx1+amr\dot{x}_1 = -a_m x_1 + a_m r xΛ™2=βˆ’amx2+amy\dot{x}_2 = -a_m x_2 + a_m y

The adaptation laws become:

ΞΈΛ™1=βˆ’Ξ³β‹…eβ‹…x1\dot{\theta}_1 = -\gamma \cdot e \cdot x_1 ΞΈΛ™2=Ξ³β‹…eβ‹…x2\dot{\theta}_2 = \gamma \cdot e \cdot x_2

Complete MIT Rule Algorithm

Initialize: y(0)=0y(0) = 0, ym(0)=0y_m(0) = 0, ΞΈ1(0)=0\theta_1(0) = 0, ΞΈ2(0)=0\theta_2(0) = 0, x1(0)=0x_1(0) = 0, x2(0)=0x_2(0) = 0

At each time step tt:

  1. Read reference: r(t)r(t)

  2. Compute control:

    u=ΞΈ1β‹…rβˆ’ΞΈ2β‹…yu = \theta_1 \cdot r - \theta_2 \cdot y
  3. Integrate plant and reference model:

    yΛ™=βˆ’aβ‹…y+bβ‹…u\dot{y} = -a \cdot y + b \cdot u yΛ™m=βˆ’amβ‹…ym+bmβ‹…r\dot{y}_m = -a_m \cdot y_m + b_m \cdot r
  4. Update filters:

    xΛ™1=βˆ’amx1+amr\dot{x}_1 = -a_m x_1 + a_m r xΛ™2=βˆ’amx2+amy\dot{x}_2 = -a_m x_2 + a_m y
  5. Compute error:

    e=yβˆ’yme = y - y_m
  6. Update adaptive parameters:

    ΞΈΛ™1=βˆ’Ξ³β‹…eβ‹…x1\dot{\theta}_1 = -\gamma \cdot e \cdot x_1 ΞΈΛ™2=Ξ³β‹…eβ‹…x2\dot{\theta}_2 = \gamma \cdot e \cdot x_2

Why the Lyapunov Approach is Preferred

The MIT rule is less robust than the Lyapunov approach because:

  • Stability not guaranteed: For arbitrary adaptation gains Ξ³\gamma, the MIT rule can become unstable
  • Approximation dependency: The filter approximation p+a+bΞΈ2β‰ˆp+amp + a + b\theta_2 \approx p + a_m is only valid near convergence
  • Parameter drift: Can occur with persistent excitation (mitigated by Οƒ\sigma-modification or leakage)
  • Sign requirement: The sign of bb must be known to choose the correct sign of Ξ³\gamma

The Lyapunov approach replaces the sensitivity derivative approximation with a stability proof, giving guaranteed convergence without requiring knowledge of the sign of bb.

Comparison: MIT Rule vs. Lyapunov

AspectMIT RuleLyapunov-based
Stability guarantee❌ Noβœ… Yes
Extra dynamics2 first-order filtersNone
TuningΞ³\gamma must be smallΞ³\gamma can be larger
DerivationGradient descentLyapunov stability theory
Sign of bbMust be knownNot required
Approximationp+a+bΞΈ2β‰ˆp+amp + a + b\theta_2 \approx p + a_mExact
Historical noteMIT Instrumentation Lab (1950s)Russian school (1960s)

Try It Yourself

Open the interactive MRAC Demo and experiment with:

  1. Changing plant parameters mid-simulation β€” drag the aa and bb sliders while the simulation is running. Watch ΞΈ1\theta_1 and ΞΈ2\theta_2 adapt to the new plant dynamics.

  2. Different reference signals β€” switch between square wave, sine wave, and step inputs.

  3. Adaptation gain tuning β€” increase Ξ³\gamma for faster adaptation (but watch for oscillations).


References

Primary Source

  • Γ…strΓΆm, K. J., & Wittenmark, B. (2008). Adaptive Control, 2nd ed. Dover. ISBN: 978-0-486-46278-3.

    The standard graduate-level text on adaptive control. Example 5.2 (pp. 190–191) in Chapter 5 (Model Reference Adaptive Control) derives the MIT rule for first-order systems using filtered sensitivity signals β€” the formulation used in this tutorial. The Lyapunov-based approach presented here draws on the stability framework developed in Chapter 4 (Lyapunov Stability).

Comments