---
title: Dynamic models
url: https://doc.liz6.com/en/theory/02-control-theory/02-dynamic-models
locale: en
area: theory
tags:
- Control theory
- Theory
date: 2026-09-10
modified: 2026-09-10
description: An equilibrium equation predicts the final temperature. Predicting how long it takes requires a dynamic model. Starting from feedback and control, we derive a state equation and its continuous and discrete solutions.
---

# Dynamic models

An equilibrium equation predicts the final temperature. Predicting how long it takes requires a dynamic model. Starting from [feedback and control](01-feedback-and-control.md), we derive a state equation and its continuous and discrete solutions.

## Energy balance becomes a derivative

Thermal capacitance $C_{\mathrm{th}}$ is the energy needed for a 1 K rise. Over a short interval, $C_{\mathrm{th}}\Delta\theta\approx p_{\mathrm{net}}\Delta t$. Dividing by time and taking a limit gives

$$C_{\mathrm{th}}\dot\theta=P_{\max}u-k(\theta-\theta_a)+d.$$

Temperature rate has units K/s, capacitance J/K, heat-loss coefficient W/K, and power W. The duty ratio $u$ is dimensionless. Positive $d$ adds heat; negative $d$ removes it. Both sides have units J/s.

Our baseline is $C_{\mathrm{th}}=2000$ J/K, $P_{\max}=1000$ W and $k=20$ W/K. At $\theta=30$, $\theta_a=20$, $u=0.4$, $d=0$, net heating is $400-200=200$ W, so $\dot\theta=0.1$ K/s. That is the current slope, not a promise of the same rise every second: warming increases heat loss.

## What makes a variable a state?

Within this lumped model, the present temperature and future inputs determine future temperature. Temperature is therefore a state. A state summarizes the past information needed for prediction; it is not the entire history.

If the vessel wall and liquid have different temperatures, liquid temperature alone is insufficient. Identical liquid temperatures with different wall temperatures produce different heat flows. At least two thermal states may be needed. Model order reflects retained dynamics, not sensor count. [State feedback](10-state-feedback-and-observers.md) develops this distinction.

## Deriving the time constant

For constant $u,\theta_a,d$, equilibrium and time constant are

$$\theta_\infty=\theta_a+\frac{P_{\max}u+d}{k},\qquad \tau=\frac{C_{\mathrm{th}}}{k}.$$

The equation becomes $\dot\theta=-(\theta-\theta_\infty)/\tau$, with solution

$$\theta(t)=\theta_\infty+[\theta(0)-\theta_\infty]e^{-t/\tau}.$$

Here $\tau=100$ s. Starting at 20 °C with $u=0.4$ gives a final 40 °C. After 100 s, temperature is $40-20/e\approx32.64$ °C: 63.2% of the total change. After 300 s it is approximately 39.00 °C, or 95.0%. A time constant is not the time of exact arrival.

**Dynamic models · Experiment**

Start at 20 °C with ambient 20 °C and constant 400 W heating. Exact temperature and net-power curves separate capacitance effects from the equilibrium and time-constant effects of heat loss.


Double capacitance, then double heat loss. Capacitance changes the time constant alone; heat loss changes both the time constant and equilibrium rise. A lower absolute temperature can still approach its own equilibrium more quickly.

## From a differential equation to updates

Forward Euler uses numerical step $h$:

$$\theta_{j+1}=\theta_j+\frac h{C_{\mathrm{th}}}[P_{\max}u_j-k(\theta_j-\theta_{a,j})+d_j].$$

When inputs stay constant over that interval, the exact update is

$$\theta_{j+1}=a\theta_j+(1-a)\theta_{\infty,j},\qquad a=e^{-h/\tau}.$$

For $h=10$ s from 20 °C, Euler gives 22 °C while the exact value is 21.903 °C. For the unforced deviation equation, Euler's multiplier is $1-h/\tau$ and is asymptotically stable only for $0<h<2\tau$. Divergence caused by a large numerical step is not physical instability. [Digital control](07-sampling-and-delay.md) separates integration steps from actual control periods.

## Linearization and physical analogies

Around an equilibrium $(\theta_0,u_0)$, define $x=\theta-\theta_0$, $v=u-u_0$. With unchanged ambient and load,

$$\dot x=-\frac k{C_{\mathrm{th}}}x+\frac{P_{\max}}{C_{\mathrm{th}}}v.$$

This transformation is exact for our affine model. Radiation, temperature-dependent capacitance or nonlinear actuation generally require a local approximation. For $\dot x=f(x,u)$, local matrices come from $A=\partial f/\partial x$ and $B=\partial f/\partial u$ at the operating point; they need not describe every temperature.

The RC equation $C\dot V=(V_{\mathrm{in}}-V)/R$ likewise combines storage and dissipation, with time constant $RC$. Transfer the structure while preserving physical units and limits; see [Capacitors](../../hardware/02-passive-components/02-capacitor.md).

## Check your understanding

What changes when capacitance alone increases from 2000 to 4000 J/K?

<details><summary>Reasoning</summary>

Equilibrium stays the same and the time constant becomes 200 s. The 20→40 °C response reaches $40-20e^{-0.5}\approx27.87$ °C after 100 s.

</details>

Why might two liquids both at 40 °C subsequently behave differently?

<details><summary>Reasoning</summary>

Different wall temperatures represent omitted stored energy. Add wall temperature and heat exchange, or justify a fast-equilibration approximation that merges the states.

</details>

## Further reading

[python-control continuous-to-discrete conversion](https://python-control.readthedocs.io/en/stable/generated/control.sample_system.html) includes zero-order hold. Before selecting it, establish whether the input really remains constant between updates.
