Salta al contenuto
Note per Studenti Examples of State-Space Models Report

Examples of State-Space Models

In questa pagina 5

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 ViV_i; in series a resistor R1R_1 (written RR on the drawing) and an inductor LL carrying current iLi_L; then, in parallel, a capacitor CC (voltage VCV_C, current iCi_C) and a resistor R2R_2 (current i2i_2); the output is the voltage VoV_o across this parallel pair.

Choice of variables:

x1=VC,x2=iL,y=Vo=VC,u=Vi,state {iL,VC}.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\}.

Circuit laws:

iL=i2+iC,i2=VoR2,iC=C V˙C,Vi−Vo=R1iL+L diLdt.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}.

In terms of x1,x2,ux_1, x_2, u:

x2=x1R2+C x˙1,u−x1=R1x2+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.

Solving for the derivatives gives the state-space model

{x˙1=−x1R2C+x2Cx˙2=−x1L−R1L x2+uLy=x1\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}

This relates the output to the input as Vo=f(Vi)V_o = f(V_i) through the state.

Pendulum

A mass mm hangs from a rod of length LL and is pushed by a horizontal force FF; θ\theta is the angle from the vertical. The input is u=Fu = F and the dynamics are

θ¨+gLsin⁡θ=1mL ucos⁡θ.\ddot\theta + \frac{g}{L}\sin\theta = \frac{1}{mL}\,u\cos\theta.

Take x1=θx_1 = \theta, x2=θ˙x_2 = \dot\theta (so θ¨=x˙2\ddot\theta = \dot x_2):

{x˙1=x2x˙2=−gLsin⁡x1+1mL ucos⁡x1y=x1\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}

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) be the population, aa the birth rate and bb the death rate, with a,b>0a, b > 0.

Constant rates. p˙=ap−bp=(a−b)p=c p\dot p = a p - b p = (a-b)p = c\,p with c=a−bc = a - b. The solution is

p(t)=p(0) ect.p(t) = p(0)\,e^{ct}.

If c>0c > 0 the population grows exponentially; if c<0c < 0 it decays exponentially.

Death rate growing with the population. Let b=b0+d pb = b_0 + d\,p. Then

p˙=ap−(b0+dp) p=ap−b0p−dp2=(a−b0) p−d p2=c0 p−d p2.\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.

The curve starting at p0p_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)−(b0+d p(t)) p(t).p(t+1) = a\,p(t) - \big(b_0 + d\,p(t)\big)\,p(t).

Correction given in the following lecture (logistic model, with coefficients α,β\alpha, \beta):

CT: p˙(t)=α p(t)−β p2(t),DT: p(t+1)=p(t)+α p(t)−β p2(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).

Lab cell population (discrete time, linear)

Three classes: x1x_1 young population, x2x_2 adult population, x3x_3 old population. Diagram of arrows between the three circles:

  • x1→x2x_1 \to x_2 with weight α=1\alpha = 1;
  • x2→x1x_2 \to x_1 with weight ss;
  • an input uu enters x1x_1;
  • x2→x3x_2 \to x_3 with weight β\beta;
  • a self-loop on x3x_3 with weight γ\gamma and an outflow from x3x_3 with weight δ\delta.

The board does not name these coefficients; the equations are

x1(t+1)=s x2(t)+u(t)x2(t+1)=x1(t)x3(t+1)=β x2(t)+γ x3(t)−δ x3(t)y(t)=x1(t)+x2(t)+x3(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}

The output is the total population. (The symbol of the coefficient in the first equation is read as ss.)

Google PageRank (discrete time, linear)

There are NN web pages. Let

x(t)=(x1(t)⋮xN(t)),xi(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.

The model is 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).

  • Page ii has NiN_i links; a user clicks the jj-th link with probability 1/Ni1/N_i.
  • The entries of AA are [A]j,i=1Ni[A]_{j,i} = \dfrac{1}{N_i} if page jj is linked by the ii-th page, and 00 otherwise.
  • Damping factor p∈[0,1]p \in [0,1]: with probability 1−p1-p the user jumps to any page (for example by typing a URL). The model becomes

x(t+1)=p A x(t)+1−pN(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.

Versione ripasso

  • RLC: x1=VCx_1 = V_C, x2=iLx_2 = i_L, u=Viu = V_i, y=Vo=VCy = V_o = V_C. Laws: iL=i2+iCi_L = i_2 + i_C, i2=Vo/R2i_2 = V_o/R_2, iC=CV˙Ci_C = C\dot V_C, Vi−Vo=R1iL+L diL/dtV_i - V_o = R_1 i_L + L\,di_L/dt. Result: x˙1=−x1R2C+x2C\dot x_1 = -\frac{x_1}{R_2 C} + \frac{x_2}{C}, x˙2=−x1L−R1Lx2+uL\dot x_2 = -\frac{x_1}{L} - \frac{R_1}{L}x_2 + \frac{u}{L}, y=x1y = x_1.
  • Pendulum: θ¨+gLsin⁡θ=1mLucos⁡θ\ddot\theta + \frac{g}{L}\sin\theta = \frac{1}{mL}u\cos\theta; x1=θx_1 = \theta, x2=θ˙x_2 = \dot\theta: x˙1=x2\dot x_1 = x_2, x˙2=−gLsin⁡x1+1mLucos⁡x1\dot x_2 = -\frac{g}{L}\sin x_1 + \frac{1}{mL}u\cos x_1, y=x1y = x_1.
  • Population: p˙=(a−b)p=cp\dot p = (a-b)p = cp, p(t)=p(0)ectp(t) = p(0)e^{ct} (growth for c>0c>0, decay for c<0c<0). With b=b0+dpb = b_0 + dp: p˙=c0p−dp2\dot p = c_0 p - dp^2, S-shaped saturation. Logistic: CT p˙=αp−βp2\dot p = \alpha p - \beta p^2, DT p(t+1)=p(t)+αp(t)−βp2(t)p(t+1) = p(t) + \alpha p(t) - \beta p^2(t).
  • Lab cells (DT): x1(t+1)=sx2+ux_1(t+1) = s x_2 + u, x2(t+1)=x1x_2(t+1) = x_1, x3(t+1)=βx2+γx3−δx3x_3(t+1) = \beta x_2 + \gamma x_3 - \delta x_3, y=x1+x2+x3y = x_1 + x_2 + x_3.
  • PageRank: x(t+1)=Ax(t)x(t+1) = Ax(t), [A]j,i=1/Ni[A]_{j,i} = 1/N_i if ii links to jj; with damping x(t+1)=pAx(t)+1−pN1x(t+1) = pAx(t) + \frac{1-p}{N}\mathbf{1}, p≈0.85p \approx 0.85.

Teoria collegata