These are the examples used to introduce State-Space ModelsA state-space model describes a system with a state vector, an input and an output; it can be nonlinear, control-affine or linear (LTI or LTV), in continuous or discrete time.State-Space Models → .
RLC circuit
Circuit: input voltage V i V_i V i ; in series a resistor R 1 R_1 R 1 (written R R R on the drawing) and an inductor L L L carrying current i L i_L i L ; then, in parallel, a capacitor C C C (voltage V C V_C V C , current i C i_C i C ) and a resistor R 2 R_2 R 2 (current i 2 i_2 i 2 ); the output is the voltage V o V_o V o across this parallel pair.
Choice of variables:
x 1 = V C , x 2 = i L , y = V o = V C , u = V i , state { i L , V C } . x_1 = V_C, \quad x_2 = i_L, \quad y = V_o = V_C, \quad u = V_i, \qquad \text{state } \{i_L, V_C\}. x 1 = V C , x 2 = i L , y = V o = V C , u = V i , state { i L , V C } .
Circuit laws:
i L = i 2 + i C , i 2 = V o R 2 , i C = C V ˙ C , V i − V o = R 1 i L + L d i L d t . i_L = i_2 + i_C, \qquad i_2 = \frac{V_o}{R_2}, \qquad i_C = C\,\dot V_C, \qquad V_i - V_o = R_1 i_L + L\,\frac{d i_L}{dt}. i L = i 2 + i C , i 2 = R 2 V o , i C = C V ˙ C , V i − V o = R 1 i L + L d t d i L .
In terms of x 1 , x 2 , u x_1, x_2, u x 1 , x 2 , u :
x 2 = x 1 R 2 + C x ˙ 1 , u − x 1 = R 1 x 2 + L x ˙ 2 . x_2 = \frac{x_1}{R_2} + C\,\dot x_1, \qquad u - x_1 = R_1 x_2 + L\,\dot x_2. x 2 = R 2 x 1 + C x ˙ 1 , u − x 1 = R 1 x 2 + L x ˙ 2 .
Solving for the derivatives gives the state-space model
{ x ˙ 1 = − x 1 R 2 C + x 2 C x ˙ 2 = − x 1 L − R 1 L x 2 + u L y = x 1 \begin{cases} \dot x_1 = -\dfrac{x_1}{R_2 C} + \dfrac{x_2}{C} \\[2mm] \dot x_2 = -\dfrac{x_1}{L} - \dfrac{R_1}{L}\,x_2 + \dfrac{u}{L} \\[2mm] y = x_1 \end{cases} ⎩ ⎨ ⎧ x ˙ 1 = − R 2 C x 1 + C x 2 x ˙ 2 = − L x 1 − L R 1 x 2 + L u y = x 1
This relates the output to the input as V o = f ( V i ) V_o = f(V_i) V o = f ( V i ) through the state.
Pendulum
A mass m m m hangs from a rod of length L L L and is pushed by a horizontal force F F F ; θ \theta θ is the angle from the vertical. The input is u = F u = F u = F and the dynamics are
θ ¨ + g L sin θ = 1 m L u cos θ . \ddot\theta + \frac{g}{L}\sin\theta = \frac{1}{mL}\,u\cos\theta. θ ¨ + L g sin θ = m L 1 u cos θ .
Take x 1 = θ x_1 = \theta x 1 = θ , x 2 = θ ˙ x_2 = \dot\theta x 2 = θ ˙ (so θ ¨ = x ˙ 2 \ddot\theta = \dot x_2 θ ¨ = x ˙ 2 ):
{ x ˙ 1 = x 2 x ˙ 2 = − g L sin x 1 + 1 m L u cos x 1 y = x 1 \begin{cases} \dot x_1 = x_2 \\ \dot x_2 = -\dfrac{g}{L}\sin x_1 + \dfrac{1}{mL}\,u\cos x_1 \\ y = x_1 \end{cases} ⎩ ⎨ ⎧ x ˙ 1 = x 2 x ˙ 2 = − L g sin x 1 + m L 1 u cos x 1 y = x 1
This is a nonlinear (control-affine) model; it is linearized in Linearization of Nonlinear SystemsNear an equilibrium a nonlinear system behaves like an LTI system whose matrix is the Jacobian of the dynamics evaluated at the equilibrium; applied to the pendulum (two equilibria), to a direct term-by-term approximation and to the three-tank model.Linearization of Nonlinear Systems → .
Population models
Let p ( t ) p(t) p ( t ) be the population, a a a the birth rate and b b b the death rate, with a , b > 0 a, b > 0 a , b > 0 .
Constant rates. p ˙ = a p − b p = ( a − b ) p = c p \dot p = a p - b p = (a-b)p = c\,p p ˙ = a p − b p = ( a − b ) p = c p with c = a − b c = a - b c = a − b . The solution is
p ( t ) = p ( 0 ) e c t . p(t) = p(0)\,e^{ct}. p ( t ) = p ( 0 ) e c t .
If c > 0 c > 0 c > 0 the population grows exponentially; if c < 0 c < 0 c < 0 it decays exponentially.
Death rate growing with the population. Let b = b 0 + d p b = b_0 + d\,p b = b 0 + d p . Then
p ˙ = a p − ( b 0 + d p ) p = a p − b 0 p − d p 2 = ( a − b 0 ) p − d p 2 = c 0 p − d p 2 . \dot p = a p - (b_0 + d p)\,p = a p - b_0 p - d p^2 = (a - b_0)\,p - d\,p^2 = c_0\,p - d\,p^2. p ˙ = a p − ( b 0 + d p ) p = a p − b 0 p − d p 2 = ( a − b 0 ) p − d p 2 = c 0 p − d p 2 .
The curve starting at p 0 p_0 p 0 has an S shape and levels off at a constant value (saturation).
Discrete-time version written in the lecture:
p ( t + 1 ) = a p ( t ) − ( b 0 + d p ( t ) ) p ( t ) . p(t+1) = a\,p(t) - \big(b_0 + d\,p(t)\big)\,p(t). p ( t + 1 ) = a p ( t ) − ( b 0 + d p ( t ) ) p ( t ) .
Correction given in the following lecture (logistic model, with coefficients α , β \alpha, \beta α , β ):
CT: p ˙ ( t ) = α p ( t ) − β p 2 ( t ) , DT: p ( t + 1 ) = p ( t ) + α p ( t ) − β p 2 ( t ) . \text{CT: } \dot p(t) = \alpha\,p(t) - \beta\,p^2(t), \qquad \text{DT: } p(t+1) = p(t) + \alpha\,p(t) - \beta\,p^2(t). CT: p ˙ ( t ) = α p ( t ) − β p 2 ( t ) , DT: p ( t + 1 ) = p ( t ) + α p ( t ) − β p 2 ( t ) .
Lab cell population (discrete time, linear)
Three classes: x 1 x_1 x 1 young population, x 2 x_2 x 2 adult population, x 3 x_3 x 3 old population. Diagram of arrows between the three circles:
x 1 → x 2 x_1 \to x_2 x 1 → x 2 with weight α = 1 \alpha = 1 α = 1 ;
x 2 → x 1 x_2 \to x_1 x 2 → x 1 with weight s s s ;
an input u u u enters x 1 x_1 x 1 ;
x 2 → x 3 x_2 \to x_3 x 2 → x 3 with weight β \beta β ;
a self-loop on x 3 x_3 x 3 with weight γ \gamma γ and an outflow from x 3 x_3 x 3 with weight δ \delta δ .
The board does not name these coefficients; the equations are
x 1 ( t + 1 ) = s x 2 ( t ) + u ( t ) x 2 ( t + 1 ) = x 1 ( t ) x 3 ( t + 1 ) = β x 2 ( t ) + γ x 3 ( t ) − δ x 3 ( t ) y ( t ) = x 1 ( t ) + x 2 ( t ) + x 3 ( t ) \begin{aligned} x_1(t+1) &= s\,x_2(t) + u(t) \\ x_2(t+1) &= x_1(t) \\ x_3(t+1) &= \beta\,x_2(t) + \gamma\,x_3(t) - \delta\,x_3(t) \\ y(t) &= x_1(t) + x_2(t) + x_3(t) \end{aligned} x 1 ( t + 1 ) x 2 ( t + 1 ) x 3 ( t + 1 ) y ( t ) = s x 2 ( t ) + u ( t ) = x 1 ( t ) = β x 2 ( t ) + γ x 3 ( t ) − δ x 3 ( t ) = x 1 ( t ) + x 2 ( t ) + x 3 ( t )
The output is the total population. (The symbol of the coefficient in the first equation is read as s s s .)
There are N N N web pages. Let
x ( t ) = ( x 1 ( t ) ⋮ x N ( t ) ) , x i ( t ) = probability of being at page i at time t . x(t) = \begin{pmatrix} x_1(t) \\ \vdots \\ x_N(t) \end{pmatrix}, \qquad x_i(t) = \text{probability of being at page } i \text{ at time } t. x ( t ) = x 1 ( t ) ⋮ x N ( t ) , x i ( t ) = probability of being at page i at time t .
The model is x ( t + 1 ) = A x ( t ) x(t+1) = A\,x(t) x ( t + 1 ) = A x ( t ) and the quantity of interest is the limit x ˉ = lim t → ∞ x ( t ) \bar x = \lim_{t\to\infty} x(t) x ˉ = lim t → ∞ x ( t ) .
Page i i i has N i N_i N i links; a user clicks the j j j -th link with probability 1 / N i 1/N_i 1/ N i .
The entries of A A A are [ A ] j , i = 1 N i [A]_{j,i} = \dfrac{1}{N_i} [ A ] j , i = N i 1 if page j j j is linked by the i i i -th page, and 0 0 0 otherwise.
Damping factor p ∈ [ 0 , 1 ] p \in [0,1] p ∈ [ 0 , 1 ] : with probability 1 − p 1-p 1 − p the user jumps to any page (for example by typing a URL). The model becomes
x ( t + 1 ) = p A x ( t ) + 1 − p N ( 1 ⋮ 1 ) , p ≈ 0.85. x(t+1) = p\,A\,x(t) + \frac{1-p}{N}\begin{pmatrix} 1 \\ \vdots \\ 1 \end{pmatrix}, \qquad p \approx 0.85. x ( t + 1 ) = p A x ( t ) + N 1 − p 1 ⋮ 1 , p ≈ 0.85.