Salta al contenuto
Note per Studenti Worked Examples - Discrete-Time Systems, Impulse Response and Savings Model Report

Worked Examples - Discrete-Time Systems, Impulse Response and Savings Model

In questa pagina 3

For a discrete-time system x(t+1)=Fx(t)+Gu(t)x(t+1)=Fx(t)+Gu(t), y(t)=Hx(t)y(t)=Hx(t), the modes are λt\lambda^t (and tλtt\lambda^t, ... for non-trivial Jordan blocks) for the eigenvalues λ\lambda of FF, and the transfer function is W(z)=H(zI−F)−1GW(z)=H(zI-F)^{-1}G. The impulse response w(t)w(t) is the output when u(t)=δ(t)u(t)=\delta(t) (the discrete unit impulse, equal to 1 at t=0t=0 and 0 elsewhere): since U(z)=1U(z)=1, Yf(z)=W(z)U(z)=W(z)Y_f(z)=W(z)U(z)=W(z), so ww is the inverse zz-transform of W(z)W(z).

To invert a zz-transform, the board multiplies and divides by zz, Z−1[W(z)]=Z−1[W(z)z⋅z],\mathcal Z^{-1}\big[W(z)\big]=\mathcal Z^{-1}\Big[\frac{W(z)}z\cdot z\Big], expands W(z)/zW(z)/z in partial fractions, and uses zz−p↔ptδ−1(t)\dfrac z{z-p}\leftrightarrow p^t\delta_{-1}(t) (with δ−1\delta_{-1} the unit step) and 1↔δ(t)1\leftrightarrow\delta(t).

Example 1 - eigenvalues, modes and impulse response

x(t+1)=Fx(t)+Gu(t),F=(0.50.10.50.9), G=(01),y(t)=Hx(t), H=(1  0).x(t+1)=Fx(t)+Gu(t),\quad F=\begin{pmatrix}0.5&0.1\\0.5&0.9\end{pmatrix},\ G=\begin{pmatrix}0\\1\end{pmatrix},\qquad y(t)=Hx(t),\ H=(1\ \ 0).

Eigenvalues. ΔF(λ)=det⁡(λI−F)=det⁡(λ−0.5−0.1−0.5λ−0.9)=(λ−0.5)(λ−0.9)−0.05=λ2−1.4λ+0.4,\Delta_F(\lambda)=\det(\lambda I-F)=\det\begin{pmatrix}\lambda-0.5&-0.1\\-0.5&\lambda-0.9\end{pmatrix}=(\lambda-0.5)(\lambda-0.9)-0.05=\lambda^2-1.4\lambda+0.4, λ1/2=0.7±0.49−0.41=0.7±0.3={10.4J=(10.4),\lambda_{1/2}=\frac{0.7\pm\sqrt{0.49-0.4}}{1}=0.7\pm0.3=\begin{cases}1\\0.4\end{cases}\qquad J=\begin{pmatrix}1&\\&0.4\end{pmatrix}, with modes 1t1^t and 0.4t0.4^t, i.e. 11 and 0.4t0.4^t.

Impulse response (w(t)w(t), input u(t)=δ(t)u(t)=\delta(t)): W(z)=H(zI−F)−1G=(1 0)(abcd)(01)=bW(z)=H(zI-F)^{-1}G=(1\ 0)\begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}0\\1\end{pmatrix}=b, the top-right entry of the inverse. With (zI−F)−1=(z−0.5−0.1−0.5z−0.9)−1=(∗0.1∗∗)(z−1)(z−0.4)(zI-F)^{-1}=\begin{pmatrix}z-0.5&-0.1\\-0.5&z-0.9\end{pmatrix}^{-1}=\frac{\begin{pmatrix}*&0.1\\ *&*\end{pmatrix}}{(z-1)(z-0.4)} one gets W(z)=0.1(z−1)(z−0.4).W(z)=\frac{0.1}{(z-1)(z-0.4)}. Partial fractions of W(z)/zW(z)/z: W(z)z=0.1(z−1)(z−0.4) z=0.10.41z+10.60.1z−1−10.240.1z−0.4=141z+161z−1−10241z−0.4.\frac{W(z)}z=\frac{0.1}{(z-1)(z-0.4)\,z}=\frac{0.1}{0.4}\frac1z+\frac1{0.6}\frac{0.1}{z-1}-\frac1{0.24}\frac{0.1}{z-0.4}=\frac14\frac1z+\frac16\frac1{z-1}-\frac{10}{24}\frac1{z-0.4}. Multiplying back by zz and inverting: w(t)=Z−1[14+16zz−1−1024zz−0.4](t)=[14δ(t)+16 1t−1024 0.4t]δ−1(t).w(t)=\mathcal Z^{-1}\Big[\frac14+\frac16\frac z{z-1}-\frac{10}{24}\frac z{z-0.4}\Big](t)=\Big[\frac14\delta(t)+\frac16\,1^t-\frac{10}{24}\,0.4^t\Big]\delta_{-1}(t). Sanity check: w(0)=0w(0)=0, and indeed 14+16−1024=6+4−1024=0\frac14+\frac16-\frac{10}{24}=\frac{6+4-10}{24}=0 (the output has no direct term, because HG=0HG=0).

Example 2 - impulse response and rectilinear trajectories

x(t+1)=Fx(t)+Gu(t),y(t)=Hx(t),F=(1ϵ00.5), G=(01), H=(1  0).x(t+1)=Fx(t)+Gu(t),\quad y(t)=Hx(t),\qquad F=\begin{pmatrix}1&\epsilon\\0&0.5\end{pmatrix},\ G=\begin{pmatrix}0\\1\end{pmatrix},\ H=(1\ \ 0).

Stability. The Lyapunov equation for discrete time is written on the board as −Q=FTPF+P-Q=F^TPF+P, with Q=QTQ=Q^T, Q≻0Q\succ0 (one may take Q=IQ=I). Flagged: in the strip the last term reads +P+P; I transcribe it as read. The board does not solve the equation. The eigenvalues are λ1=1\lambda_1=1, λ2=0.5\lambda_2=0.5, with modes 11 and 0.5t0.5^t.

Impulse response. W(z)=H(zI−F)−1G=bW(z)=H(zI-F)^{-1}G=b (top-right entry): (zI−F)−1=(z−1−ϵ0z−0.5)−1=(∗ϵ∗∗)(z−1)(z−0.5),W(z)=ϵ(z−1)(z−0.5)⋅zz.(zI-F)^{-1}=\begin{pmatrix}z-1&-\epsilon\\0&z-0.5\end{pmatrix}^{-1}=\frac{\begin{pmatrix}*&\epsilon\\ *&*\end{pmatrix}}{(z-1)(z-0.5)},\qquad W(z)=\frac{\epsilon}{(z-1)(z-0.5)}\cdot\frac zz. W(z)z=2ϵz+2ϵz−1−4ϵz−0.5,\frac{W(z)}z=\frac{2\epsilon}z+\frac{2\epsilon}{z-1}-\frac{4\epsilon}{z-0.5}, w(t)=Z−1[2ϵ+2ϵzz−1−4ϵzz−0.5](t)=(2ϵ δ(t)+2ϵ−4ϵ 0.5t)δ−1(t).w(t)=\mathcal Z^{-1}\Big[2\epsilon+2\epsilon\frac z{z-1}-4\epsilon\frac z{z-0.5}\Big](t)=\big(2\epsilon\,\delta(t)+2\epsilon-4\epsilon\,0.5^t\big)\delta_{-1}(t). (At t=0t=0: 2ϵ+2ϵ−4ϵ=02\epsilon+2\epsilon-4\epsilon=0, as in Example 1.)

Rectilinear trajectories passing through the origin. We look for trajectories of the form x(t)=f(t)x(0)x(t)=f(t)x(0), so that x(t+1)=f(t)x(t)=f~(t)x(0)x(t+1)=f(t)x(t)=\tilde f(t)x(0) keeps the same direction. This happens if x(t)=λtx(0)x(t)=\lambda^tx(0), with x(0)x(0) an eigenvector of FF corresponding to a real eigenvalue λ\lambda of FF. For λ1=1\lambda_1=1: Fv1=λ1v1=v1Fv_1=\lambda_1v_1=v_1, (1ϵ00.5)(v11v12)=(v11v12) ⇒ v11=1, v12=0,\begin{pmatrix}1&\epsilon\\0&0.5\end{pmatrix}\begin{pmatrix}v_{11}\\v_{12}\end{pmatrix}=\begin{pmatrix}v_{11}\\v_{12}\end{pmatrix}\ \Rightarrow\ v_{11}=1,\ v_{12}=0, so v1∈⟨(10)⟩v_1\in\left\langle\begin{pmatrix}1\\0\end{pmatrix}\right\rangle; starting from x(0)∈⟨(10)⟩x(0)\in\left\langle\begin{pmatrix}1\\0\end{pmatrix}\right\rangle one has x(t)=λ1tx(0)=x(0)x(t)=\lambda_1^tx(0)=x(0). (The board leaves the case λ2=0.5\lambda_2=0.5 unwritten.)

Example 3 - a monthly savings model in state-space form

Two accounts: the checking account x1(t)x_1(t) and the savings account x2(t)x_2(t) hold, respectively, the amounts (in euros) on the 15th day of the tt-th month. The rules are:

  1. the checking account earns 0.1%0.1\% every month (computed on the amount of the previous month); the savings account earns 0.2%0.2\%;
  2. at the beginning of each month, 40%40\% of the checking account (as on the 15th day of the previous month) is transferred to the savings account;
  3. at the end of each month, 30%30\% of the total asset is withdrawn from the checking account;
  4. the salary u(t)u(t) is credited to the checking account at the end of each month.

Model. x1(t+1)=x1(t)+0.1% x1(t)−40% x1(t)−30%(x1(t)+x2(t))+u(t),x_1(t+1)=x_1(t)+0.1\%\,x_1(t)-40\%\,x_1(t)-30\%\big(x_1(t)+x_2(t)\big)+u(t), x2(t+1)=x2(t)+0.2% x2(t)+40% x1(t),y(t)=x1(t)+x2(t)x_2(t+1)=x_2(t)+0.2\%\,x_2(t)+40\%\,x_1(t),\qquad y(t)=x_1(t)+x_2(t) (the output is the total asset). In matrix form x(t+1)=Fx(t)+Gu(t)x(t+1)=Fx(t)+Gu(t), y(t)=Hx(t)y(t)=Hx(t) with F=(0.301−0.30.41.002),G=(10),H=(1  1).F=\begin{pmatrix}0.301&-0.3\\0.4&1.002\end{pmatrix},\qquad G=\begin{pmatrix}1\\0\end{pmatrix},\qquad H=(1\ \ 1). (The entries: 1+0.001−0.4−0.3=0.3011+0.001-0.4-0.3=0.301; the coefficient of x2x_2 in the first equation is −0.3-0.3; second row 0.40.4 and 1+0.002=1.0021+0.002=1.002.)

Eigenvalues. ΔF(λ)=det⁡(λ−0.3010.3−0.4λ−1.002)=λ2−1.303λ+…\Delta_F(\lambda)=\det\begin{pmatrix}\lambda-0.301&0.3\\-0.4&\lambda-1.002\end{pmatrix}=\lambda^2-1.303\lambda+\dots (the constant term is not completed on the board), and the roots written on the board are λ1/2={0.5990.705both of modulus less than 1: asymptotically stable,\lambda_{1/2}=\begin{cases}0.599\\0.705\end{cases}\quad\text{both of modulus less than 1: asymptotically stable,} with modes λ1t=0.599t\lambda_1^t=0.599^t and λ2t=0.705t\lambda_2^t=0.705^t. The trace of FF is 1.3031.303; the two roots as written add up to 1.3041.304, so the roots on the board are rounded.

Compare with the continuous-time exercise Worked Examples - Lyapunov Equation, Output Response and Rectilinear TrajectoriesOne worked exercise on a 3x3 continuous-time linear system with a parameter: stability decided by solving the Lyapunov equation block by block, the output response for two different output matrices, and the rectilinear trajectories through the origin.Worked Examples - Lyapunov Equation, Output Response and Rectilinear Trajectories →.

Versione ripasso

  • Modes and transfer function: for x(t+1)=Fx(t)+Gu(t)x(t+1)=Fx(t)+Gu(t), y=Hxy=Hx, the modes are λt\lambda^t for each eigenvalue λ\lambda of FF (with tλtt\lambda^t for non-trivial Jordan blocks), and W(z)=H(zI−F)−1GW(z)=H(zI-F)^{-1}G.
  • Impulse response: input u(t)=δ(t)u(t)=\delta(t) gives U(z)=1U(z)=1, so Y(z)=W(z)Y(z)=W(z) and w(t)=Z−1[W(z)]w(t)=\mathcal Z^{-1}[W(z)]. Method: write W(z)=W(z)z⋅zW(z)=\frac{W(z)}{z}\cdot z, expand W(z)/zW(z)/z in partial fractions, multiply by zz again, then use zz−p↔ptδ−1(t)\frac{z}{z-p}\leftrightarrow p^t\delta_{-1}(t) and 1↔δ(t)1\leftrightarrow\delta(t).
  • Ex. 1, F=(0.50.10.50.9)F=\begin{pmatrix}0.5&0.1\\0.5&0.9\end{pmatrix}, G=(0,1)TG=(0,1)^T, H=(1 0)H=(1\ 0): ΔF(λ)=λ2−1.4λ+0.4\Delta_F(\lambda)=\lambda^2-1.4\lambda+0.4, λ=1\lambda=1 and λ=0.4\lambda=0.4, modes 1t1^t and 0.4t0.4^t. W(z)=0.1(z−1)(z−0.4)W(z)=\dfrac{0.1}{(z-1)(z-0.4)}. Partial fractions of W(z)/zW(z)/z give w(t)=[14δ(t)+16 1t−1024 0.4t]δ−1(t)w(t)=\big[\tfrac14\delta(t)+\tfrac16\,1^t-\tfrac{10}{24}\,0.4^t\big]\delta_{-1}(t). Check: w(0)=14+16−1024=0w(0)=\tfrac14+\tfrac16-\tfrac{10}{24}=0, because HG=0HG=0.
  • Ex. 2, F=(1ϵ00.5)F=\begin{pmatrix}1&\epsilon\\0&0.5\end{pmatrix}, G=(0,1)TG=(0,1)^T, H=(1 0)H=(1\ 0): eigenvalues 11 and 0.50.5, W(z)=ϵ(z−1)(z−0.5)W(z)=\dfrac{\epsilon}{(z-1)(z-0.5)}, and w(t)=(2ϵ δ(t)+2ϵ−4ϵ 0.5t)δ−1(t)w(t)=\big(2\epsilon\,\delta(t)+2\epsilon-4\epsilon\,0.5^t\big)\delta_{-1}(t), again 00 at t=0t=0.
  • Rectilinear trajectories: x(t)=λtx(0)x(t)=\lambda^tx(0) keeps the direction of x(0)x(0) when x(0)x(0) is a real eigenvector of FF. For λ1=1\lambda_1=1, Fv=vFv=v gives v∈⟨(1,0)T⟩v\in\langle(1,0)^T\rangle, so x(t)=x(0)x(t)=x(0) for every tt. The case λ2=0.5\lambda_2=0.5 is not worked out on the board.
  • Ex. 3, savings model: x1x_1 checking, x2x_2 savings, each month 0.1%0.1\% and 0.2%0.2\% interest, 40%40\% of checking moves to savings, 30%30\% of the total is withdrawn from checking, the salary uu enters checking. Matrices: F=(0.301−0.30.41.002)F=\begin{pmatrix}0.301&-0.3\\0.4&1.002\end{pmatrix}, G=(1,0)TG=(1,0)^T, H=(1 1)H=(1\ 1) (output = total). Roots 0.7050.705 and 0.5990.599 (rounded on the board), both of modulus below 11: asymptotically stable. Continuous-time comparison: Worked Examples - Lyapunov Equation, Output Response and Rectilinear TrajectoriesOne worked exercise on a 3x3 continuous-time linear system with a parameter: stability decided by solving the Lyapunov equation block by block, the output response for two different output matrices, and the rectilinear trajectories through the origin.Worked Examples - Lyapunov Equation, Output Response and Rectilinear Trajectories →.
  • Typical mistakes: forgetting the δ(t)\delta(t) term from the pole at z=0z=0; skipping the check w(0)=0w(0)=0.

Teoria collegata