# 线性差分方程介绍

$\Delta y_t = y_{t+1} – y_t$

$\Delta y_t$被定义为一阶差分，二阶差分定义如下

$\Delta^2 y_t = \Delta(\Delta y_t) = \Delta y_{t+1} – \Delta y_t = (y_{t+2} – y_{t+1}) – (y_{t+1} – y_t) = y_{t+2}-2y_{t+1} + y_t$

$L[y_t] = \Delta^n y_t + A_1\Delta^{n-1}y_t +\cdot \cdot \cdot+ A_{n-1}\Delta y_t + A_ny_t$

$L[y_t] = y_{t+n} + B_1y_{t+n-1}+ \cdot \cdot \cdot + B_{n-1} y_{t+1} + B_n y_t$

# 二阶线性差分方程求解例子[1]

#### 二阶齐次线性差分方程（2nd-order Homogeneous Linear Difference Equation）

$u_n = u_{n-1}+u_{n-2}$

$u_n – u_{n-1} –u_{n-2} = 0$

$u_n = A\omega ^n$

$A\omega ^n – A\omega ^{n-1} – A\omega^{n-2} = 0$

$\omega^2 - \omega - 1 = 0$

$\omega_1 = \frac{1+\sqrt{5}}{2} \ ,\ \omega_2 = \frac{1-\sqrt{5}}{2}$

$\color{red}{u_n = A_1\omega_1^n + A_2 \omega_2^n}$

$(A_1\omega_1^n + A_2 \omega_2^n) – (A_1\omega_1^{n-1} + A_2 \omega_2^{n-1}) – (A_1\omega_1^{n-2} + A_2 \omega_2^{n-2}$

$A_1\omega_1^{n-2}(\omega_1^2-\omega_1-1) + A_2\omega_2^{n-2}(\omega_2^2 – \omega - 1)$

$u_2 = A_1\left( \frac{1+\sqrt{5}}{2} \right)^n + A_2\left( \frac{1-\sqrt{5}}{2} \right)^n$

$\left\{\begin{matrix} u_0 = & A_1 + A_2 & = 1 \\ u_1 = & \frac{A_1(1+\sqrt{5}) + A_2(1-\sqrt{5})}{2} & = 1 \end{matrix}\right.$

$\left\{\begin{matrix} A_1 &=& \frac{1+\sqrt{5}}{2\sqrt{5}} \\ A_2 &=& -\frac{1-\sqrt{5}}{2\sqrt{5}} \end{matrix}\right.$

$u_n = \frac{1+\sqrt{5}}{2\sqrt{5}}\left( \frac{1+\sqrt{5}}{2} \right)^n - \frac{1-\sqrt{5}}{2\sqrt{5}}\left( \frac{1-\sqrt{5}}{2} \right)^n$

$u_n = \frac{1}{\sqrt{5}}\left[ \left( \frac{1+\sqrt{5}}{2} \right)^{n+1} - \left( \frac{1-\sqrt{5}}{2} \right)^{n+1}\right]$

#### 二阶齐次线性差分方程II

$u_n = pu_{n+1} + qu_{n-1}$

$pu_{n+1} – u_n + qu_{n-1} = 0$

$u_n = A\omega^n$

$pA\omega^{n+1} – A\omega^n + qA\omega^{n-1} = 0$

$p\omega^2 – \omega + q = 0$

$p\omega^2 – (p+q)\omega + q = 0$

$(\omega-1)(p\omega -q) = 0$

$\omega_1 = 1 \ , \ \omega_2 = \frac{q}{p}$

$\color{red}{u_n = A_1(1)^n + A_2 \left( \frac{q}{p} \right)^n}$

$\left[pA_1(1)^{n+1}+pA_2\left(\frac{q}{p} \right )^{n+1} \right ]-\left[pA_1(1)^{n}+pA_2\left(\frac{q}{p} \right )^{n} \right ]+\left[pA_1(1)^{n-1}+pA_2\left(\frac{q}{p} \right )^{n-1} \right ]$

$A_1[p-1+q]+A_2\left(\frac{q}{p} \right )^{n-1}\left[p\left(\frac{q}{p} \right )^2-\frac{q}{p}+q \right ]$

$0 + A_2\left(\frac{q}{p} \right )^{n-1}\left[ \frac{q^2}{p} - \frac{q}{p} + q \right] =A_2\left(\frac{q}{p} \right )^{n-1}\left[ \frac{q}{p}(q-1)+q \right ] =A_2\left(\frac{q}{p} \right )^{n-1}\left[\frac{q}{p}(-p)+q \right ] =0$

$\left\{\begin{matrix} u_0 &= &A_1+A_2 &=0 \\ u_l &= &A_1+A_2\left(\frac{q}{p} \right )^l &=1 \end{matrix}\right.$

$A_1 = –A_2 = \frac{-1}{\left( \frac{q}{p}\right)^l - 1}$

$u_n = \frac{-1}{\left( \frac{q}{p}\right)^l - 1} + \frac{ \left( \frac{q}{p} \right)^n }{\left( \frac{q}{p}\right)^l - 1}$

$u_n = \frac{\left( \frac{q}{p} \right)^n -1 }{\left( \frac{q}{p} \right)^l -1}$

$\omega_2 = \frac{q}{p} = 1 = \omega_1$

$\left\{\begin{matrix} u_0 &= &A_1+A_2 &=0 \\ u_l &= &A_1+A_2 &=1 \end{matrix}\right.$

$u_n = (A_1+A_2n)\omega^n$

\begin{align*} 0 &=pu_{n+1}-u_n+qu_{n-1} \\ &=p(A_1+A_2(n+1))\omega^{n+1} + (A_1+A_2n)\omega^n + q(A_1+A_2(n-1))\omega^{n-1}\\ &=p(A_1+A_2(n+1))\omega^2 + (A_1+A_2n)\omega + q(A_1+A_2(n-1))\\ &=p(A_1+A_2n+A_2)\omega^2 + (A_1+A_2n)\omega + q(A_1+A_2n-A_2)\\ &=A_1(p\omega^2-\omega+q) + A_2n(p\omega^2-\omega+q) + A_2(p\omega^2-q) \end{align*}

$\color{red}{u_n = (A_1+A_2n)(1)^n}$

$\left\{\begin{matrix} u_0 &= &A_1+A_2\times 0 &=0 \\ u_l &= &A_1+A_2\times l &=1 \end{matrix}\right.$

$\left\{\begin{matrix} A_1 =0 \\ A_2 = \frac{1}{l} \end{matrix}\right.$

$u_n = \frac{n}{l}$

#### 二阶非齐次线性差分方程（2nd-order Inhomogeneous Linear Difference Equation）

$v_n = 1+pv_{n+1}+qv_{n-1}$

$pv_{n+1} – v_n + qv_{n-1} = -1$

$\color{red}{v_n = A_1(1)^n + A_2\left(\frac{q}{p}\right)^n} \qquad provided \quad p\neq q$

$v_n = \color{red}{A_1(1)^n + A_2\left(\frac{q}{p}\right)^n} + \color{blue}{f(n)}$

\begin{align*} pv_{n+1}-v_n+qv_{n-1} &=p\left\{A_1(1)^{n+1}+A_2\left(\frac{q}{p}\right )^{n+1}+f(n+1) \right \} \\ &-\ \ \left\{A_1(1)^{n}+A_2\left(\frac{q}{p}\right )^n+f(n) \right \}\\ &+q\left\{A_1(1)^{n-1}+A_2\left(\frac{q}{p}\right )^{n-1}+f(n-1) \right \} \\ &=pu_{n+1} - u_n + qu_{n-1} + pf(n+1) - f(n) + qf(n-1)\\ &= pf(n+1) - f(n) + qf(n-1)\\ &=-1 \end{align*}

$\displaystyle{ \sum_{k=0}^{m}B_kn^k = B_{0} + B_1n+B_2n^2+\cdot\cdot\cdot+B_mn^m}$

$\color{blue}{f(n) = a}$

$pf(n+1) – f(n) + qf(n-1) = pa -a+qa = -1$

$a = \frac{-1}{p-1+q}$

$\color{blue}{f(n ) = a + bn}$

\begin{align*} &\ \quad pf(n+1)-f(n)+qf(n-1) \\ &=p(a+b(n+1))-(a+bn)+q(a+b(n-1)) \\ &=a(p-1+q)+bn(p-1+q)+b(p-q)\\ &=b(p-q)\\ &=-1 \end{align*}

$\color{blue}{f(n) = a + bn + cn^2}$

\begin{align*} &\ \quad pf(n+1)-f(n)+qf(n-1)\\ &=p(a+b(n+1)+c(n+1)^2)-(a+bn+cn^2)+q(a+b(n-1)+c(n-1)^2) \\ &=a(p-1+q)+bn(p-1+q)+b(p-q) + cn^2(p-1+q)+cn(2-2)+c(p+q)\\ &=0+0+0+0+0+c(p+q)\\ &=c \\ &=-1 \end{align*}

$\left\{\begin{matrix} v_n &= &\color{red}{A_1+A_2\left(\frac{q}{p} \right )^n} - \color{blue}{\frac{n}{p-q}} &,&p\neq q \\ v_n &= &\color{red}{A_1+A_2}-\color{blue}{n^2} &,&p=q \end{matrix}\right.$

# 二阶线性差分方程的表达及其求解方法

#### 一般的二阶线性差分方程的表达式

$ay_{t+2} + by_{t+1} + cy_t = x(t) \qquad t\in N^+$

$ay_{t+2} + by_{t+1} + cy_t = d$

#### 线性差分方程的解的结构

$y(t) = y_h(t) + y_p(t)$

#### 二阶线性差分方程的求解过程

##### 二阶齐次线性差分方程

1. 假设

$y_t = A\omega^t$

2. 把该假设代入原差分方程，整理后得到一元二次方程：

$a\omega^2+b\omega+c = 0$

3. 解一元二次方程得到两个根：

$\omega_{1,2} = \frac{-b\pm\sqrt{b^2-4ac}}{2a}$

4. 如果两个根不相等，则

$y_t = A_1\omega_1^t + A_2\omega_2^t$

5. 如果两个根相等（重根），则

$y_t = (A_1+A_2n)\omega^t$

6. 通过初始条件求出$A_1,A_2$。

##### 二阶非齐次线性差分方程

1. 令等式右边等于0，得到二阶齐次线性差分方程：

$ay_{t+2} + by_{t+1} + cy_t = 0$

求解该齐次方程，得到通解$y_h(t)$。

2. 观察方程等式右边的式子，进行相应特解假设，我们这里的等式右边为常数$b$，因此假设特解为：

$y_p(t) = D$

如果等式右边为$t^k$，我们按理应该假设

$y_p(t) = D_0t^k + D_1t^{k-1}+\cdot\cdot\cdot+D_k$

3. 如果上述假设不成立，则需要在重新对特解进行假设，假设时增加一个阶：

$y_p(t) = D \Rightarrow y_p(t) = D_0t+D_1$

4. 重复上一步骤直到得到正确的特解。

5. 通解与特解相加得到$y_t$：

$y(t) = y_h(t) + y_p(t)$

6. 通过初始条件求出$A_1,A_2$。

# N阶线性差分方程的表达与解[2]

#### 表达式

N阶线性差分方程表示呈如下形式：

$A_0y_t+A_1y_{t-1}+\cdot\cdot\cdot+A_{N-1}y_{t-N+1}+A_Ny_{t-N} = B_0x_t+B_1x_{t-1}+\cdot\cdot\cdot+B_{M-1}x_{t-M+1}+B_{M}x_{t-M}$

$\displaystyle{ \sum_{k=0}^{N}A_ky_{t-k} = \sum_{r=0}^{M}B_rx_{t-r} }$

#### 齐次解

$y_t = C_1\omega_1^t + C_2\omega_2+\cdot\cdot\cdot+C_N\omega_N^t = \displaystyle{\sum_{k=1}^NC_k\omega_k^t}$

\begin{align*}y_t &= (D_1t^{K-1}+D_2t^{K-2}+\cdot\cdot\cdot+D_{K-1}t+D_K)\omega_1^t+C_2\omega_2^t+C_3\omega_3^t+\cdot\cdot\cdot+C_{N-K+1}\omega_{N-K+1}^t \\ &= \sum_{m=1}^{K}D_mt^{K-m}\omega_1^t+\sum_{n=2}^{N-K+1}C_n\omega_n^t \end{align*}

$C_1(h+iv)^t+C_2(h-iv)^t = C_1R^tcos(t\theta)+iC_2R^tsin(t\theta)$

$(P_1t^{K-1}+P_2t^{K-2}+\cdot\cdot\cdot+P_{K-1}t+P_{K})R^tcos(t\theta)+i(Q_1t^{K-1}+Q_2t^{K-2}+\cdot\cdot\cdot+Q_{K-1}t+Q_{K})R^nsin(t\theta)$

#### 特解

1. 自由项为$t^k$的多项式

如果$\omega \neq 1$，特解为：

$y_p(t) = D_0t^k+D_1n^{k-1}+\cdot\cdot\cdot+D_k$

如果有K个$\omega = 1$的重根

$y_p(t) = t^K(D_0t^k+D_1n^{k-1}+\cdot\cdot\cdot+D_k)$

2. 自由项为$a^n$

如果$a \neq \omega$，

$y_p(t) = Da^t$

如果有K个重根$\omega_1$，且$a = \omega_1$

$y_p(t) = (D_0t^K+D_1n^{K-1}+\cdot\cdot\cdot+D_K)a^t$

3. 自由项为$sint\theta$或者$cost\theta$

$y_p(t) = D_1sint\theta+D_2cost\theta$

4. 自由项为$\alpha^t(A_1sint\theta+A_2cost\theta)$

如果$\omega \neq \alpha e^{\pm i\theta}$

$y_p(t) = \alpha^t(D_1sint\theta+D_2cost\theta)$

如果$\omega = \alpha e^{\pm i\theta}$

$y_p(t) = t^K\alpha^t(D_1sint\theta+D_2cost\theta)$

※这一小节关于特解部分可能会有些错误，不过由于这并不是我们要讨论的重点，所以不去求证了…

[1] CAM.AC.UK : Difference Equations

[2] CCNU：常系数线性差分方程的求解

posted @ 2017-05-19 15:31  TaigaComplex  阅读(4054)  评论(4编辑  收藏