Notes on Difference Equations (1)

(This part mainly discusses dynamics of first-order difference equations)

1.1 Introduction

x(n+1) = f(x(n)) \tag{1.1.1}

(Time-invariant) difference equations and discrete dynamical systems represents two sides of the same coin.

1.2 Linear First-Order Difference Equations

Homogeneous FOE:
x(n+1) = a(n) x(n) \tag{1.2.1}
Non-homogeneous FOE:
x(n+1) = a(n) x(n) + g(n) \tag{1.2.2}
Important Cases
y(n+1) = ay(n) + g(n), \quad y(0) = y_0 \tag{1.2.3}
The solution is given by
y(n) = a^n y_0 + b[\frac{a^n-1}{a-1}], \quad if \quad a\neq1 \tag{1.2.4}
Notice that the solution of nonhomogeneous differential equation
\frac{dy}{dt} = ay(t) + g(t), \quad y(0) = y_0 \tag{1.2.5}
is given by
y(t) = e^{at} y_0 + \int_0^t e^{a(t-s)}g(s) ds \tag{1.2.6}

1.3 Equilibrium Points

What is the equilibrium point?

Definition 1: (Equilibrium Points) A point x^{*} in the domain of f is said to be an equilibrium point if it is a fixed point of f, i.e., f(x^*) = x^*.

Definition 2: (Eventually Equilibrium Points) Let x be a point in the domain of f. If there exists a positive integer r and an equilibrium point x^{*}, such that f^r(x) = x^{*}, f^{r-1}(x) \neq x^{*}, then x is an eventually equilibrium (fixed) point.

Stability of the equilibrium point

Definition 3

(a) The EP x^{*} is stable if given \varepsilon > 0 there exists \delta > 0 such that |x_0 - x^*| < \delta implies |f^n(x_0) - x^*| < \varepsilon for all n > 0.

(b) The point x^* is said to be attracting if there exists \eta > 0 such that

? |x(0) - x^*| < \eta implies \lim_{n \to \infty}(x_n) = x^{*}.

If \eta = \infty, x^* is called global attractor.

(c) The point x^{*} is an asymptotically stable equilibrium point if it is stable and attracting.

If \eta = \infty, x^* is said to be globally asymptotically stable.

To determine the stability of an EP from these definitions may prove to be a mission impossible in many cases. This is due to the fact that we may not be able to find the solution in a closed form for most equations.

The simplest bur most powerful tools are graph techniques.

1.4 Criterion for the Asymptotic Stability of Equilibrium Points

Theorem 1: Let x^{*} be an EP of the difference equation
x(n+1) = f(x(n)) \tag{1.4.1}
where f is continuously differentiable at x^{*}. The following statements then hold true:

(i) If |f'(x^*)| < 1, then x^* is asymptotically stable.

(ii) If |f'(x^*)| > 1, then x^* is unstable.

Theorem 2: Suppose f'(x^*) = 1. The following statements then hold:

(i) If f''(x^*) \neq 0, then x^* is unstable.

(ii) If f''(x^*) = 0 and f'''(x^*) > 0, then x^* is unstable.

(iii) If f''(x^*) = 0 and f'''(x^*) < 0, then x^* is asymptotically stable.

1.5 Periodic Points and Cycles

Definition 4: Let b in the domain of f. Then:

(i) b is called a periodic point of f if for some positive integer k, f^k(b) = b. Hence a point is k-periodic if it is a fixed point of f^k, that is, if it is an EP of the difference equation
x(n+1) = g(x(n)) \tag{1.5.1}
where g = f^k.

The periodic orbit of b, O(b) = \{b, f(b), f^2(b), ...,f^{k-1}(b)\} is called a k-cycle.

(ii) b is called eventually k-periodic if for some positive integer m, f^m(b) is a k-periodic point. In other words, b is eventually k-periodic if
f^{m+k}(b) = f^m(b)
Stability of Periodic Points

De?nition 1.20 Let b be a k-period point of f. Then b is:

(i) stable if it is a stable ?xed point of f^k

(ii) asymptotically stable if it is an asymptotically stable ?xed point of f^k

(iii) unstable if it is an unstable ?xed point of f^k

REFERENCE

Elaydi S N. An Introduction to Difference Equations[M]. 2011.


要對經(jīng)濟(jì)動力系統(tǒng)進(jìn)行研究,就離不開對差分方程問題的討論。特別是經(jīng)濟(jì)中所出現(xiàn)的經(jīng)濟(jì)周期等現(xiàn)象,更有可能與差分方程系統(tǒng)的性質(zhì)有著密切聯(lián)系,因此,我選擇Elaydi (2011)進(jìn)行閱讀與研究,為差分方程方面的技術(shù)打基礎(chǔ)。

上面是對Elaydi (2011) 第一章的簡要總結(jié),當(dāng)然還有關(guān)于周期解的穩(wěn)定性的討論以及蟲口模型的內(nèi)容還沒有加入進(jìn)來,因?yàn)槎ɡ淼膬?nèi)容比較復(fù)雜,所以等以后有時(shí)間再加入整理也好。關(guān)于一階差分方程,這一章討論的主要問題就是不動點(diǎn)(Equilibrium Point)與周期性,而周期性問題又可以拆解為不動點(diǎn)問題。學(xué)了這一章之后,大概了解了:

  • 差分方程的定義
  • 一階差分方程與微分方程之間的聯(lián)系
  • 不動點(diǎn)的定義
  • 不動點(diǎn)的穩(wěn)定性
  • 差分方程的周期性
  • 周期點(diǎn)的穩(wěn)定性

為了更直觀的了解差分方程的性質(zhì),我們可以利用程序模擬差分方程的解。

import numpy as np
import matplotlib.pyplot as plt

首先,我們定義差分方程函數(shù),這個(gè)函數(shù)應(yīng)當(dāng)給定其函數(shù)形式與初始值之后,可以生成orbits.

# Basic Blocks of Difference Equations
def iter_func(var):
    """ Define the iterative function in difference equations.
        Given args of the function, it returns the value of the calculus.
    """
    if 0 <= var <= (1/2):
        return 2 * var
    elif (1/2) < var <= 1:
        return 2 * (1 - var)
def diff_eq(iter_func, init_val=0,  num=100):
    """ Define difference equations.
        Given the function form and initial value of the equation,
        it returns sereis of solutions of the equation.
        Length of the series is controled by num.
    """
    orb = list(range(num))
    orb[0] = init_val
    for i in range(1, num):
        orb[i] = iter_func(orb[i-1])
    return orb

我們定義一個(gè)函數(shù)來繪制我們所生成的orbits

def draw_series(series):
    """ Draw the series of orbits
    """
    n = range(len(series))
    fig = plt.figure(1)
    ax = plt.subplot(1,1,1)
    ax.plot(n, series)
    plt.xlabel('n')
    plt.ylabel('x(n)')
    plt.show()
x = diff_eq(iter_eq, 0.2)
draw_series(x)

可以看出,這個(gè)差分方程在給定初始值0.2的情況下,經(jīng)過不斷地震蕩,最終收斂到0.

output_6_0.png

下面我們通過一個(gè)函數(shù)繪制圖像,幫我們找到一個(gè)差分方程的不動點(diǎn)。

#Find Equilibrium Point
def find_EP(iter_eq):
    """ Given the form of the equation,
    it helps to find EP by the graph.
    """
    x = np.linspace(0,1,100)
    viter_eq = np.vectorize(iter_eq)
    y = viter_eq(x)
    
    fig = plt.figure(1)
    ax = plt.subplot(1,1,1)
    ax.plot(x,x)
    ax.plot(x,y)
    plt.show()
find_EP(iter_eq)

通過圖像可以看出,不動點(diǎn)有兩個(gè),一個(gè)是0,另一個(gè)在0.6到0.8之間(2/3)。

output_9_0.png

下面我們通過圖像來進(jìn)行相圖分析,來觀察不動點(diǎn)的穩(wěn)定性。

# Stair-step Analysis
def stair_step(iter_func):
    """ Presenting the stair step diagram of the
    difference equation.
    """
    x = np.linspace(0,1,100)
    viter_eq = np.vectorize(iter_func)
    y = viter_eq(x)
    
    ssd = diff_eq(iter_func, 0.2)
    h = np.zeros(2 * len(ssd) - 1)
    v = np.zeros(2 * len(ssd) - 1)
    v[0] = 0
    for i in range(0, len(h)-1):
        h[i] = ssd[i // 2]
    for i in range(1, len(v)-1):
        v[i] = ssd[(i+1) // 2]
        
    fig = plt.figure(1)
    ax = plt.subplot(1,1,1)
    ax.plot(h, v, '^--')
    ax.plot(x,x)
    ax.plot(x,y)
    plt.show()
        
stair_step(iter_eq)
output_12_0.png

可以看出,當(dāng)x 靠近0.5的時(shí)候很容易被發(fā)散到1,進(jìn)而導(dǎo)致迭代值為0,這與我們之前的直覺也是一致的。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,870評論 0 10
  • 我和打錄靈魂82:打錄父言子語80&81集 記錄者:余俊娟 時(shí)間:20171120,周一 啾啾說記筆記:導(dǎo)師怎么說...
    余俊娟閱讀 244評論 0 0
  • 事情是這樣的:男朋友的媽媽和姐姐來我們這里玩,第二天我一大早就起來買了稀飯,豆?jié){油條給她們吃,他媽媽跟我說下次不要...
    澆水的花匠閱讀 1,016評論 0 1
  • 趙菊青【精進(jìn)打卡第123天】 今晚我們普善義工協(xié)會開會 下班匆匆個(gè),吃罷晚飯去禮儀教室,家人們已好多到達(dá)了。家人們...
    夢中醒來_df30閱讀 254評論 0 0
  • 以前看言情小說,我只當(dāng)打發(fā)時(shí)間,但是現(xiàn)在決心和文字相伴,和看些一些教人如何閱讀書籍的技巧,現(xiàn)在不在停留在表面上了。...
    五花肉VIP閱讀 913評論 2 1

友情鏈接更多精彩內(nèi)容