In this section, we will introduce some basic concepts for system dynamics and the importance of dynamic modeling.
Robots are dynamic systems – their states change continuously in response to control inputs and external disturbances. Dynamic modeling is the how we derive real-world system dynamics into forms that could be used by us, the engineers. Dynamic modeling plays a critical role in understanding and predicting a robot's behavior under various operating conditions. By using mathematical representations, engineers can simulate responses, optimize control strategies, and improve performance safety.
| Goal | Example |
|---|---|
| Predict | How fast a quadrotor will tilt after a given motor command |
| Design | Tune a PID or LQR gain that stabilises a two-link arm |
| Optimise | Plan a minimum-energy path while respecting actuator limits |
| Validate | Check safety constraints before running code on real hardware |
In short: No model, no reliable control nor prediction.
Below are not all of the types of dynamics models used by engineers and researchers. However, they cover a pretty large chunk of what's available.
| Category | Core idea | Pros | Cons |
|---|---|---|---|
| Analytical | Derive |
Interpretable, generalises outside training data | Requires physics insight; often neglects some variables to simplify dynamics |
| Data-driven | Fit |
Captures hard-to-model effects | Needs lots of data; poor extrapolation |
| Residual Physics | Combine analytical base + learned correction | Good accuracy with less data | Added complexity |
| Hybrid / Sim | Mix analytical, learned, and full physics engines | Flexible | Heavy computation; tuning effort |
This course focuses on the analytical approach.
Understanding the math behind
- design controllers (e.g. MPC, LQR)
- prove stability and safety properties
- port models between simulators and embedded code
A system dynamics relates an input
The standard system description consists of the system dynamics and the output equation. The former describes the behavior over time of the states as a reaction to the inputs and the initial state. The latter describes the relation between the state and the output.
-
$x$ – states are variables which allow us to formulate the system behavior in form of a set of first-order ODE for each of the variable. Examples include pose, velocity, battery SOC, etc. -
$u$ – inputs are how the robot acts in the world such as thrusts, torques, acceleration, etc.. -
$y$ - outputs are what we measure or regulate (speed, force).
-
$A$ – system matrix (physics & geometry) -
$B$ – input matrix (actuator directions) -
$C$ – output matrix (sensors or variables we care about)
| Term | Meaning |
|---|---|
| Linear | The dynamics obey the superposition and homogeneity principles: if inputs/states Mathematically, |
| Time-Invariant | The matrices if |
Why LTI is powerful
- Closed-form solutions via exponentials:
$x(t)=e^{At}x_0+\int e^{A(t-\tau)}B,u(\tau),d\tau$ . - Frequency-domain tools (transfer functions, Bode plots) apply.
- Stability, controllability, observability reduce to eigenvalue tests.
- Efficient software (MATLAB, SciPy) provides out-of-the-box solvers and controllers. |
A system is non-linear when its state equation contains products, powers, saturations, trigonometric terms, etc.
$$ \begin{aligned} \dot{x} &= f(x,u), \ y &= h(x) \end{aligned} $$ Examples:
- Inverted-pendulum:
$\dot{\theta}_2 = \frac{g}{l}\sin\theta$ – sine makes it non-linear. - Quadrotor: aerodynamics introduce
$u_i^2$ thrust terms.
Implications
- Superposition no longer holds.
- Stability analysis uses Lyapunov or linearization.
- Control design often linearizes the model around an operating point, then applies LTI tools.
A system is time-varying if its dynamics change explicitly with
Examples
- Satellite with moving solar arrays ⇒ inertia
$I(t)$ varies. - Battery-powered rover ⇒ mass and voltage change as energy drains.
Consequences
- Shift property breaks; a controller tuned at one moment may under-perform later.
- Some time-varying systems can be converted to time-invariant form by state augmentation, but often at the cost of higher dimension.
Take-away LTI models are the “sweet spot’’ for analysis and controller synthesis. When reality is non-linear or time-varying we either (i) linearize around an operating point, (ii) update the linear model online (gain scheduling), or (iii) design non-linear controllers directly.
Below are two classic robotic systems: a linear time-invariant (LTI) mass–spring–damper and a non-linear pendulum.
Each is presented with states, inputs, LaTeX equations, and a NumPy implementation you can paste directly into your own file.
| Symbol | Meaning |
|---|---|
| position |
|
| velocity |
|
| external force |
with state vector $x=\begin{bmatrix}x_1\x_2\end{bmatrix}$, matrices $A=\begin{bmatrix} 0 & 1 \ -k/m & -b/m \end{bmatrix},\quad B=\begin{bmatrix} 0 \ 1/m \end{bmatrix} $.
import numpy as np
# system constants
m, k, b = 1.0, 5.0, 0.8 # kg, N/m, N·s/m
A = np.array([[0, 1],
[-k/m, -b/m]])
B = np.array([[0],
[1/m]])
def lti_step(x, u, dt):
"""
Euler step for mass–spring–damper.
x : shape (2,)
u : scalar force
dt: timestep
"""
dx = A @ x + B.flatten() * u
return x + dt * dx
# demo
x = np.array([0.1, 0.0]) # 10 cm stretch, zero velocity
for _ in range(10):
x = lti_step(x, u=0.0, dt=0.01)
print("state after 0.1 s:", x)| Symbol | Meaning |
|---|---|
| angle |
|
| angular rate |
|
| motor torque |
import numpy as np
g, l = 9.81, 0.3 # gravity [m/s²], rod length [m]
m, b = 0.5, 0.02 # mass [kg], viscous friction [N·m·s]
I = m * l**2 # moment of inertia
def pendulum_step(x, u, dt):
"""
Pendulum Euler step (non-linear dynamics).
x : shape (2,) [theta, omega]
u : torque
dt: timestep
"""
theta, omega = x
dtheta = omega
domega = -(g/l) * np.sin(theta) - (b/I) * omega + u / I
return x + dt * np.array([dtheta, domega])
# demo swing-up pulse
x = np.array([0.0, 0.0]) # hanging down
for _ in range(100):
x = pendulum_step(x, u=0.2, dt=0.02)
print("state after 2 s:", x)Tip If you need Jacobians for linearization, wrap the dynamics with SymPy’s
symbolsanddiff:
import sympy as sp
theta, omega, tau = sp.symbols('theta omega tau')
f = sp.Matrix([omega,
-(g/l)*sp.sin(theta) - (b/I)*omega + tau/I])
A_jac = f.jacobian([theta, omega]) # ∂f/∂x
B_jac = f.jacobian([tau]) # ∂f/∂u
print(sp.simplify(A_jac))Now you have both analytical and non-linear models ready for simulation, control design, or further analysis.
Try to plot out how the states change over time using matplotlib.