Salta al contenuto
Note per Studenti Difference Equations Report

Difference Equations

In questa pagina 4

Difference equations are the discrete-time version of differential equations (see Linear Constant-Coefficient Differential EquationsContinuous-time LTI convolutional systems are described by linear constant-coefficient ODEs whose general solution is a homogeneous part, a combination of modes t^m e^{pt} built from the roots of the characteristic polynomial, plus a particular part; boundary conditions pick one solution of the family.Linear Constant-Coefficient Differential Equations →). In principle, many of the concepts seen for ODEs also apply here with appropriate differences.

ARMA models

We are given a recursive constant-coefficient linear difference equation   ∑n=0Nan y(k−n)=∑m=0Mbm u(k−m)  k∈Z,a0≠0, aN≠0, N≥1, bM≠0.\boxed{\;\sum_{n=0}^Na_n\,y(k-n)=\sum_{m=0}^Mb_m\,u(k-m)\;}\qquad k\in\mathbb{Z},\quad a_0\ne0,\ a_N\neq0,\ N\ge1,\ b_M\ne0 . The left-hand side is the AutoRegressive part and the right-hand side the Moving Average part, so the model is called ARMA.

Note that the order of an ARMA model is determined by NN, i.e. the maximum delay between y(k−N)y(k-N) and y(k)y(k), instead of the differentiation order. That is why we also need to assume a0≠0a_0\neq0 here.

The delay operator

Instead of derivatives we deal with the delay operator zz, defined as z−k0f(k)=f(k−k0),∀k0∈Z.z^{-k_0}f(k)=f(k-k_0),\qquad\forall k_0\in\mathbb{Z}. zz is a linear operator: z−k0(α1f1(k)+α2f2(k))=α1f1(k−k0)+α2f2(k−k0).z^{-k_0}\big(\alpha_1f_1(k)+\alpha_2f_2(k)\big)=\alpha_1f_1(k-k_0)+\alpha_2f_2(k-k_0). Indeed, the ARMA model can be rewritten as ∑n=0Nanz−ny(k)=∑m=0Mbmz−mu(k).\sum_{n=0}^Na_nz^{-n}y(k)=\sum_{m=0}^Mb_mz^{-m}u(k).

Homogeneous equation and modes

Solve the homogeneous equation by considering just the AR part: ∑n=0Nanz−ny(k)=0(HE).\sum_{n=0}^Na_nz^{-n}y(k)=0\qquad\text{(HE)}. As usual, the solution can be written as a linear combination of modes: yH(k)=∑ℓ=1Ncℓψℓ(k)y_H(k)=\sum_{\ell=1}^Nc_\ell\psi_\ell(k). Which modes do we need in discrete time?

Case N=1N=1: a1y(k)+a0y(k−1)=0a_1y(k)+a_0y(k-1)=0. Let λ:=−a0a1≠0\lambda:=-\dfrac{a_0}{a_1}\ne0, so y(k)−λy(k−1)=0y(k)-\lambda y(k-1)=0. Ansatz yH(k)=λky_H(k)=\lambda^k; check: λk−λ⋅λk−1=λk−λk=0\lambda^k-\lambda\cdot\lambda^{k-1}=\lambda^k-\lambda^k=0 for all kk.

Case N>1N>1: choose ψ(k):=λk\psi(k):=\lambda^k, λ∈C∖{0}\lambda\in\mathbb{C}\setminus\{0\}. Then z−nψ(k)=λk−n=λ−nψ(k)z^{-n}\psi(k)=\lambda^{k-n}=\lambda^{-n}\psi(k), and the (HE) can be rewritten as ∑n=0Nanz−nλk=∑n=0Nanλk−n=(∑n=0Nanλ−n)λk=!0.\sum_{n=0}^Na_nz^{-n}\lambda^k=\sum_{n=0}^Na_n\lambda^{k-n}=\left(\sum_{n=0}^Na_n\lambda^{-n}\right)\lambda^k\overset!=0 . This gives a characteristic equation to solve for every k∈Zk\in\mathbb{Z}: ∑n=0Nanλ−n=0  ⟺  ∑n=0Nanpn=0,p:=1λ.\sum_{n=0}^Na_n\lambda^{-n}=0\iff\sum_{n=0}^Na_np^n=0,\quad p:=\frac1\lambda . Can we solve it for λ\lambda directly instead of passing through pp? Yes, because λ≠0\lambda\neq0 by assumption (multiply by λN\lambda^N): ∑n=0Nanλ−n=0  ⟺  λN∑n=0Nanλ−n=0  ⟺  ∑n=0NanλN−n=0  ⟺    a~(λ)=a0λN+a1λN−1+⋯+aN−1λ+aN=0  \sum_{n=0}^Na_n\lambda^{-n}=0\iff\lambda^N\sum_{n=0}^Na_n\lambda^{-n}=0\iff\sum_{n=0}^Na_n\lambda^{N-n}=0\iff\boxed{\;\tilde a(\lambda)=a_0\lambda^N+a_1\lambda^{N-1}+\dots+a_{N-1}\lambda+a_N=0\;} Careful with the order here: in a~(λ)\tilde a(\lambda) the coefficient a0a_0 multiplies the highest power (the opposite of the continuous-time polynomial a(p)a(p)).

Modes

If the roots of the characteristic polynomial λ1,λ2,…,λN\lambda_1,\lambda_2,\dots,\lambda_N are all distinct then the modes are λ1k, λ2k, …, λNk.\lambda_1^k,\ \lambda_2^k,\ \dots,\ \lambda_N^k . With coincident roots, it can be shown that the modes ψℓ(k)\psi_\ell(k) have this expression: λ1k, kλ1k, k2λ1k, …, kN1−1λ1kλ2k, kλ2k, k2λ2k, …, kN2−1λ2k ⋮λrk, kλrk, k2λrk, …, kNr−1λrk\begin{array}{l} \lambda_1^k,\ k\lambda_1^k,\ k^2\lambda_1^k,\ \dots,\ k^{N_1-1}\lambda_1^k\\ \lambda_2^k,\ k\lambda_2^k,\ k^2\lambda_2^k,\ \dots,\ k^{N_2-1}\lambda_2^k\\ \ \vdots\\ \lambda_r^k,\ k\lambda_r^k,\ k^2\lambda_r^k,\ \dots,\ k^{N_r-1}\lambda_r^k \end{array} where λi\lambda_i, i=1,…,ri=1,\dots,r, are the distinct roots (each with algebraic multiplicity NiN_i) of the characteristic polynomial.

How do modes look like?

Write λ=ρejφ\lambda=\rho e^{j\varphi}, ρ>0\rho>0, φ∈ ]−π,π]\varphi\in\,]-\pi,\pi]. NOSC = non-oscillatory, OSC = oscillatory. The scan draws stem plots in a 4×34\times3 grid; columns are 0<ρ<10<\rho<1, ρ=1\rho=1, ρ>1\rho>1.

mode 0<ρ<10<\rho<1 ρ=1\rho=1 ρ>1\rho>1
NOSC, ρk\rho^k geometric decay to 00 constant 11 geometric growth
OSC, ρkcos⁡(φk)\rho^k\cos(\varphi k) decaying oscillation cos⁡(φk)\cos(\varphi k), constant amplitude growing oscillation
NOSC, kρkk\rho^k rises, then decays the ramp kk grows faster than geometric
OSC, kρkcos⁡(φk)k\rho^k\cos(\varphi k) oscillation, rises then decays kcos⁡(φk)k\cos(\varphi k), linearly growing amplitude growing oscillation, amplitude kρkk\rho^k

Compare with the continuous-time table: the role of σ<0, σ=0, σ>0\sigma<0,\ \sigma=0,\ \sigma>0 is played by ρ<1, ρ=1, ρ>1\rho<1,\ \rho=1,\ \rho>1.

Natural response

The natural response follows from yH(k)y_H(k):   yN(k)=∑ℓ=1Nc^ℓ ψℓ(k)=∑i=1r∑m=0Ni−1c^i,m kmλik∀k∈Z  \boxed{\;y_N(k)=\sum_{\ell=1}^N\hat c_\ell\,\psi_\ell(k)=\sum_{i=1}^r\sum_{m=0}^{N_i-1}\hat c_{i,m}\,k^m\lambda_i^k\qquad\forall k\in\mathbb{Z}\;} where the coefficients c^ℓ (=c^i,m)\hat c_\ell\ (=\hat c_{i,m}) are determined from the BCs at k=k0−1,k0−2,…,k0−Nk=k_0-1,k_0-2,\dots,k_0-N: [y(k0−1)y(k0−2)⋮y(k0−N)]=[y0,−1y0,−2⋮y0,−N]=:y0.\begin{bmatrix}y(k_0-1)\\y(k_0-2)\\ \vdots\\y(k_0-N)\end{bmatrix}=\begin{bmatrix}y_{0,-1}\\y_{0,-2}\\ \vdots\\y_{0,-N}\end{bmatrix}=:\mathbf{y}_0 . To find c^ℓ\hat c_\ell solve the system of equations for c1,…,cNc_1,\dots,c_N: [ψ1(k0−1)ψ2(k0−1)⋯ψN(k0−1)ψ1(k0−2)ψ2(k0−2)⋯ψN(k0−2)⋮⋮ψ1(k0−N)ψ2(k0−N)⋯ψN(k0−N)]⏟=:W discrete-time version of the Wronskian matrix[c1c2⋮cN]=[y0,−1y0,−2⋮y0,−N],[c^1⋮c^N]=W−1[y0,−1⋮y0,−N].\underbrace{\begin{bmatrix}\psi_1(k_0-1)&\psi_2(k_0-1)&\cdots&\psi_N(k_0-1)\\ \psi_1(k_0-2)&\psi_2(k_0-2)&\cdots&\psi_N(k_0-2)\\ \vdots&&&\vdots\\ \psi_1(k_0-N)&\psi_2(k_0-N)&\cdots&\psi_N(k_0-N)\end{bmatrix}}_{=:W\ \text{discrete-time version of the Wronskian matrix}}\begin{bmatrix}c_1\\c_2\\ \vdots\\c_N\end{bmatrix}=\begin{bmatrix}y_{0,-1}\\y_{0,-2}\\ \vdots\\y_{0,-N}\end{bmatrix}, \qquad\begin{bmatrix}\hat c_1\\ \vdots\\ \hat c_N\end{bmatrix}=W^{-1}\begin{bmatrix}y_{0,-1}\\ \vdots\\y_{0,-N}\end{bmatrix}. (On the scan one entry of the second row, ψN\psi_N, is written with argument k0−1k_0-1; it is read here as k0−2k_0-2 following the pattern of the rows.)

Switch-on signals, causality and forced response

Versione ripasso

  • ARMA model: ∑n=0Nany(k−n)=∑m=0Mbmu(k−m)\sum_{n=0}^Na_ny(k-n)=\sum_{m=0}^Mb_mu(k-m), k∈Zk\in\mathbb{Z}, a0≠0a_0\neq0, aN≠0a_N\ne0, N≥1N\ge1, bM≠0b_M\neq0. AR part (left) and MA part (right). Order =N=N (maximum delay).
  • Delay operator: z−k0f(k)=f(k−k0)z^{-k_0}f(k)=f(k-k_0), linear; ARMA: ∑anz−ny=∑bmz−mu\sum a_nz^{-n}y=\sum b_mz^{-m}u.
  • Homogeneous equation ∑anz−ny=0\sum a_nz^{-n}y=0; N=1N=1: y(k)=λy(k−1)y(k)=\lambda y(k-1), λ=−a0/a1\lambda=-a_0/a_1, mode λk\lambda^k. General: ansatz λk\lambda^k gives ∑anλ−n=0\sum a_n\lambda^{-n}=0, equivalent to a~(λ)=a0λN+a1λN−1+⋯+aN=0\tilde a(\lambda)=a_0\lambda^N+a_1\lambda^{N-1}+\dots+a_N=0 (watch the order of the coefficients: reversed with respect to continuous time).
  • Modes: kmλikk^m\lambda_i^k, m=0,…,Ni−1m=0,\dots,N_i-1, λi\lambda_i distinct roots with multiplicity NiN_i. With λ=ρejφ\lambda=\rho e^{j\varphi}: ρ<1\rho<1 decays, ρ=1\rho=1 constant amplitude, ρ>1\rho>1 grows; φ\varphi gives oscillation; kmk^m for repeated roots.
  • Natural response: yN(k)=∑i∑mc^i,mkmλiky_N(k)=\sum_i\sum_m\hat c_{i,m}k^m\lambda_i^k; BCs at k0−1,…,k0−Nk_0-1,\dots,k_0-N; discrete Wronskian WW with rows ψℓ(k0−1),…,ψℓ(k0−N)\psi_\ell(k_0-1),\dots,\psi_\ell(k_0-N), c^=W−1y0\hat{\mathbf c}=W^{-1}\mathbf{y}_0.
  • Switch-on signals Sk0\mathcal{S}_{k_0}; causal LTI convolutional system ⇔\Leftrightarrow ARMA. Forced response yF(k)=∑n=k0kh+(k−n)u(n)y_F(k)=\sum_{n=k_0}^kh_+(k-n)u(n) (no 1(k−k0)\mathbb{1}(k-k_0) needed).
  • h+h_+ is found by recursive construction (no impulse matching in discrete time).
  • Typical mistakes: solving ∑anpn=0\sum a_np^n=0 and using pp as the mode base instead of λ=1/p\lambda=1/p; writing a~(λ)\tilde a(\lambda) with the coefficients in the wrong order; forgetting a0≠0a_0\ne0.

Teoria collegata