Caputo 分数阶一维问题基于 L2-1 σ _\sigma σ 逼近的空间二阶方法(附Matlab程序)
考虑如下时间分数阶慢扩散方程初边值问题
{ 0 C D t α u ( x , t ) = u x x ( x , t ) + f ( x , t ) , x ∈ ( 0 , L ) , t ∈ ( 0 , T ] u ( x , 0 ) = φ ( x ) , x ∈ ( 0 , L ) u ( 0 , t ) = μ ( t ) , u ( L , t ) = ν ( t ) , t ∈ [ 0 , T ] \left\{\begin{array}{l} { }_{0}^{C} D_{t}^{\alpha} u(x, t)=u_{x x}(x, t)+f(x, t), \quad x \in(0, L), t \in(0, T] \\ u(x, 0)=\varphi(x), \quad x \in(0, L) \\ u(0, t)=\mu(t), \quad u(L, t)=\nu(t), \quad t \in[0, T] \end{array}\right. ⎩⎨⎧0CDtαu(x,t)=uxx(x,t)+f(x,t),x∈(0,L),t∈(0,T]u(x,0)=φ(x),x∈(0,L)u(0,t)=μ(t),u(L,t)=ν(t),t∈[0,T]
其中 α ∈ ( 0 , 1 ) , f , φ , μ , ν \alpha \in(0,1), f, \varphi, \mu, \nu α∈(0,1),f,φ,μ,ν 为已知函数, 且 φ ( 0 ) = μ ( 0 ) , φ ( L ) = ν ( 0 ) \varphi(0)=\mu(0), \varphi(L)=\nu(0) φ(0)=μ(0),φ(L)=ν(0).
设解函数 u ∈ C ( 4 , 2 ) ( [ 0 , L ] × [ 0 , T ] ) u \in C^{(4,2)}([0, L] \times[0, T]) u∈C(4,2)([0,L]×[0,T]).
本文给出求解上述时间分数阶慢扩散方程初边值问题基于 L2-1 σ _\sigma σ 逼近的快速差分方法.
记
σ = 1 − α 2 , t n − 1 + σ = ( n − 1 + σ ) τ , f i n − 1 + σ = f ( x i , t n − 1 + σ ) \sigma=1-\frac{\alpha}{2}, \quad t_{n-1+\sigma}=(n-1+\sigma) \tau, \quad f_{i}^{n-1+\sigma}=f\left(x_{i}, t_{n-1+\sigma}\right) σ=1−2α,tn−1+σ=(n−1+σ)τ,fin−1+σ=f(xi,tn−1+σ)
在点 ( x i , t n − 1 + σ ) \left(x_{i}, t_{n-1+\sigma}\right) (xi,tn−1+σ) 处考虑微分方程, 得到
0 C D t α u ( x i , t n − 1 + σ ) = u x x ( x i , t n − 1 + σ ) + f i n − 1 + σ , 1 ⩽ i ⩽ M − 1 , 1 ⩽ n ⩽ N . { }_{0}^{C} D_{t}^{\alpha} u\left(x_{i}, t_{n-1+\sigma}\right)=u_{x x}\left(x_{i}, t_{n-1+\sigma}\right)+f_{i}^{n-1+\sigma}, \quad 1 \leqslant i \leqslant M-1,1 \leqslant n \leqslant N . 0CDtαu(xi,tn−1+σ)=uxx(xi,tn−1+σ)+fin−1+σ,1⩽i⩽M−1,1⩽n⩽N.
对上式中时间分数阶导数应用参考文献中快速逼近的理论, 可得
{ 0 C D t α u ( x i , t n − 1 + σ ) = 1 Γ ( 1 − α ) ∑ l = 1 N exp ω l F l , i n + d 0 ( 1 , α ) ( U i n − U i n − 1 ) + O ( τ 3 − α + ϵ ) , 1 ⩽ i ⩽ M − 1 , 1 ⩽ n ⩽ N , F l , i 1 = 0 , 1 ⩽ l ⩽ N exp , 1 ⩽ i ⩽ M − 1 , F l , i n = e − s l τ F l , i n − 1 + A l ( U i n − 1 − U i n − 2 ) + B l ( U i n − U i n − 1 ) , 1 ⩽ l ⩽ N exp , 1 ⩽ i ⩽ M − 1 , 2 ⩽ n ⩽ N . \left\{\begin{array}{c} { }_{0}^{C} D_{t}^{\alpha} u\left(x_{i}, t_{n-1+\sigma}\right)=\frac{1}{\Gamma(1-\alpha)} \sum_{l=1}^{N_{\exp }} \omega_{l} F_{l, i}^{n}+d_{0}^{(1, \alpha)}\left(U_{i}^{n}-U_{i}^{n-1}\right)+O\left(\tau^{3-\alpha}+\epsilon\right), \\ 1 \leqslant i \leqslant M-1, \quad 1 \leqslant n \leqslant N, \\ F_{l, i}^{1}=0, \quad 1 \leqslant l \leqslant N_{\exp }, \quad 1 \leqslant i \leqslant M-1, \\ F_{l, i}^{n}=\mathrm{e}^{-s_{l} \tau} F_{l, i}^{n-1}+A_{l}\left(U_{i}^{n-1}-U_{i}^{n-2}\right)+B_{l}\left(U_{i}^{n}-U_{i}^{n-1}\right), \\ 1 \leqslant l \leqslant N_{\exp }, \quad 1 \leqslant i \leqslant M-1, \quad 2 \leqslant n \leqslant N . \end{array}\right. ⎩⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎧0CDtαu(xi,tn−1+σ)=Γ(1−α)1∑l=1NexpωlFl,in+d0(1,α)(Uin−Uin−1)+O(τ3−α+ϵ),1⩽i⩽M−1,1⩽n⩽N,Fl,i1=0,1⩽l⩽Nexp,1⩽i⩽M−1,Fl,in=e−slτFl,in−1+Al(Uin−1−Uin−2)+Bl(Uin−Uin−1),1⩽l⩽Nexp,1⩽i⩽M−1,2⩽n⩽N.
对空间二阶导数应用二阶中心差商离散, 可得
u x x ( x i , t n − 1 + σ ) = σ u x x ( x i , t n ) + ( 1 − σ ) u x x ( x i , t n − 1 ) + O ( τ 2 ) = σ δ x 2 U i n + ( 1 − σ ) δ x 2 U i n − 1 + O ( h 2 ) + O ( τ 2 ) \begin{aligned} u_{x x}\left(x_{i}, t_{n-1+\sigma}\right) &=\sigma u_{x x}\left(x_{i}, t_{n}\right)+(1-\sigma) u_{x x}\left(x_{i}, t_{n-1}\right)+O\left(\tau^{2}\right) \\ &=\sigma \delta_{x}^{2} U_{i}^{n}+(1-\sigma) \delta_{x}^{2} U_{i}^{n-1}+O\left(h^{2}\right)+O\left(\tau^{2}\right) \end{aligned} uxx(xi,tn−1+σ)=σuxx(xi,tn)+(1−σ)uxx(xi,tn−1)+O(τ2)=σδx2Uin+(1−σ)δx2Uin−1+O(h2)+O(τ2)
于是得到
{ 1 Γ ( 1 − α ) ∑ l = 1 N exp ω l F l , i n + d 0 ( 1 , α ) ( U i n − U i n − 1 ) = σ δ x 2 U i n + ( 1 − σ ) δ x 2 U i n − 1 + f i n − 1 + σ + ( r 7 ) i n , F l , i 1 = 0 , 1 ⩽ i ⩽ M − 1 , 1 ⩽ n ⩽ N , F l , i n = e − s l τ F l , i n − 1 + A l ( U i n − 1 − U i n − 2 ) + B l ( U i n − U i n − 1 ) , 1 ⩽ l ⩽ N exp , 1 ⩽ i ⩽ M − 1 , 2 ⩽ n ⩽ N , \left\{\begin{array}{l} \frac{1}{\Gamma(1-\alpha)} \sum_{l=1}^{N_{\text {exp }}} \omega_{l} F_{l, i}^{n}+d_{0}^{(1, \alpha)}\left(U_{i}^{n}-U_{i}^{n-1}\right)=\sigma \delta_{x}^{2} U_{i}^{n}+(1-\sigma) \delta_{x}^{2} U_{i}^{n-1}+f_{i}^{n-1+\sigma}+\left(r_{7}\right)_{i}^{n}, \\ F_{l, i}^{1}=0, \quad 1 \leqslant i \leqslant M-1, \quad 1 \leqslant n \leqslant N, \\ F_{l, i}^{n}=\mathrm{e}^{-s_{l} \tau} F_{l, i}^{n-1}+A_{l}\left(U_{i}^{n-1}-U_{i}^{n-2}\right)+B_{l}\left(U_{i}^{n}-U_{i}^{n-1}\right), \\ 1 \leqslant l \leqslant N_{\exp }, \quad 1 \leqslant i \leqslant M-1, \quad 2 \leqslant n \leqslant N, \end{array}\right. ⎩⎪⎪⎪⎨⎪⎪⎪⎧Γ(1−α)1∑l=1Nexp ωlFl,in+d0(1,α)(Uin−Uin−1)=σδx2Uin+(1−σ)δx2Uin−1+fin−1+σ+(r7)in,Fl,i1=0,1⩽i⩽M−1,1⩽n⩽N,Fl,in=e−slτFl,in−1+Al(Uin−1−Uin−2)+Bl(Uin−Uin−1),1⩽l⩽Nexp,1⩽i⩽M−1,2⩽n⩽N,
且存在正常数 c 7 c_{7} c7 使得
∣ ( r 7 ) i n ∣ ⩽ c 7 ( τ 2 + h 2 + ϵ ) , 1 ⩽ i ⩽ M − 1 , 1 ⩽ n ⩽ N . \left|\left(r_{7}\right)_{i}^{n}\right| \leqslant c_{7}\left(\tau^{2}+h^{2}+\epsilon\right), \quad 1 \leqslant i \leqslant M-1,1 \leqslant n \leqslant N . ∣(r7)in∣⩽c7(τ2+h2+ϵ),1⩽i⩽M−1,1⩽n⩽N.
消去中间变量 { F l , i n } \left\{F_{l, i}^{n}\right\} {Fl,in} 可得
∑ k = 0 n − 1 d k ( n , α ) ( U i n − k − U i n − k − 1 ) = σ δ x 2 U i n + ( 1 − σ ) δ x 2 U i n − 1 + f i n − 1 + σ + ( r 7 ) i n 1 ⩽ i ⩽ M − 1 , 1 ⩽ n ⩽ N \begin{aligned} \sum_{k=0}^{n-1} d_{k}^{(n, \alpha)}\left(U_{i}^{n-k}-U_{i}^{n-k-1}\right) &=\sigma \delta_{x}^{2} U_{i}^{n}+(1-\sigma) \delta_{x}^{2} U_{i}^{n-1}+f_{i}^{n-1+\sigma}+\left(r_{7}\right)_{i}^{n} \\ 1 & \leqslant i \leqslant M-1,1 \leqslant n \leqslant N \end{aligned} k=0∑n−1dk(n,α)(Uin−k−Uin−k−1)1=σδx2Uin+(1−σ)δx2Uin−1+fin−1+σ+(r7)in⩽i⩽M−1,1⩽n⩽N
注意到初边值条件, 有
{ U i 0 = φ ( x i ) , 1 ⩽ i ⩽ M − 1 , U 0 n = μ ( t n ) , U M n = ν ( t n ) , 0 ⩽ n ⩽ N \begin{cases}U_{i}^{0}=\varphi\left(x_{i}\right), & 1 \leqslant i \leqslant M-1, \\ U_{0}^{n}=\mu\left(t_{n}\right), & U_{M}^{n}=\nu\left(t_{n}\right), \quad 0 \leqslant n \leqslant N\end{cases} {Ui0=φ(xi),U0n=μ(tn),1⩽i⩽M−1,UMn=ν(tn),0⩽n⩽N
在上式中略去小量项 ( r 7 ) i n \left(r_{7}\right)_{i}^{n} (r7)in, 并用数值解 u i n u_{i}^{n} uin 代替精确解 U i n U_{i}^{n} Uin, 可得求解问题的如下差分格式:
{ 1 Γ ( 1 − α ) ∑ l = 1 N exp ω l F l , i n + d 0 ( 1 , α ) ( u i n − u i n − 1 ) = σ δ x 2 u i n + ( 1 − σ ) δ x 2 u i n − 1 + f i n − 1 + σ , F l , i 1 = 0 , 1 ⩽ l ⩽ N exp , 1 ⩽ i ⩽ M − 1 , F l , i n = e − s l τ F l , i n − 1 + A l ( u i n − 1 − u i n − 2 ) + B l ( u i n − u i n − 1 ) , 1 ⩽ l ⩽ N exp , 1 ⩽ i ⩽ M − 1 , 2 ⩽ n ⩽ N , u i 0 = φ ( x i ) , 1 ⩽ i ⩽ M − 1 , u 0 n = μ ( t n ) , u M n = ν ( t n ) , 0 ⩽ n ⩽ N . \left\{\begin{array}{l} \frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{\exp }} \omega_{l} F_{l, i}^{n}+d_{0}^{(1, \alpha)}\left(u_{i}^{n}-u_{i}^{n-1}\right)=\sigma \delta_{x}^{2} u_{i}^{n}+(1-\sigma) \delta_{x}^{2} u_{i}^{n-1}+f_{i}^{n-1+\sigma}, \\ F_{l, i}^{1}=0, \quad 1 \leqslant l \leqslant N_{\exp }, 1 \leqslant i \leqslant M-1, \\ F_{l, i}^{n}=\mathrm{e}^{-s_{l} \tau} F_{l, i}^{n-1}+A_{l}\left(u_{i}^{n-1}-u_{i}^{n-2}\right)+B_{l}\left(u_{i}^{n}-u_{i}^{n-1}\right), \\ \quad 1 \leqslant l \leqslant N_{\exp }, 1 \leqslant i \leqslant M-1,2 \leqslant n \leqslant N, \\ u_{i}^{0}=\varphi\left(x_{i}\right), \quad 1 \leqslant i \leqslant M-1, \\ u_{0}^{n}=\mu\left(t_{n}\right), \quad u_{M}^{n}=\nu\left(t_{n}\right), \quad 0 \leqslant n \leqslant N . \end{array}\right. ⎩⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎧Γ(1−α)1l=1∑NexpωlFl,in+d0(1,α)(uin−uin−1)=σδx2uin+(1−σ)δx2uin−1+fin−1+σ,Fl,i1=0,1⩽l⩽Nexp,1⩽i⩽M−1,Fl,in=e−slτFl,in−1+Al(uin−1−uin−2)+Bl(uin−uin−1),1⩽l⩽Nexp,1⩽i⩽M−1,2⩽n⩽N,ui0=φ(xi),1⩽i⩽M−1,u0n=μ(tn),uMn=ν(tn),0⩽n⩽N.
其中
d 0 ( 1 , α ) = σ 1 − α τ − α Γ ( 2 − α ) d_{0}^{(1, \alpha)}=\frac{\sigma^{1-\alpha} \tau^{-\alpha}}{\Gamma(2-\alpha)} d0(1,α)=Γ(2−α)σ1−ατ−α
A l = ∫ 0 1 ( 3 2 − ξ ) e − s l ( σ + 1 − ξ ) τ d ξ , B l = ∫ 0 1 ( ξ − 1 2 ) e − s l ( σ + 1 − ξ ) τ d ξ A_{l}=\int_{0}^{1}\left(\frac{3}{2}-\xi\right) \mathrm{e}^{-s_{l}(\sigma+1-\xi) \tau} \mathrm{d} \xi, \quad B_{l}=\int_{0}^{1}\left(\xi-\frac{1}{2}\right) \mathrm{e}^{-s_{l}(\sigma+1-\xi) \tau} \mathrm{d} \xi Al=∫01(23−ξ)e−sl(σ+1−ξ)τdξ,Bl=∫01(ξ−21)e−sl(σ+1−ξ)τdξ
考虑问题:
0 C D t α u ( x , t ) = ∂ 2 u ∂ x 2 ( x , t ) + f ( x , t ) , ( x , t ) ∈ ( 0 , 1 ) × ( 0 , 1 ) , { }_{0}^{C} D_{t}^{\alpha} u(x, t)=\frac{\partial^{2} u}{\partial x^{2}}(x, t)+f(x, t),(x, t) \in(0,1) \times(0,1), 0CDtαu(x,t)=∂x2∂2u(x,t)+f(x,t),(x,t)∈(0,1)×(0,1),
其中 0 < α < 1 0<\alpha<1 0<α<1, 右端源项 f ( x , t ) f(x, t) f(x,t) 和相应的初边值条件由真解 u ( x , t ) = sin ( x ) t 2 u(x, t)=\sin (x) t^{2} u(x,t)=sin(x)t2 确定.
由真解 u ( x , t ) = sin ( x ) t 2 . u(x, t)=\sin (x) t^{2}. u(x,t)=sin(x)t2.
则有
{ u x = t 2 cos x u x x = − t 2 sin x { u t = 2 t sin x u t t = 2 sin x . \left\{\begin{array}{l}u_{x}=t^{2} \cos x \\ u_{x x}=-t^{2} \sin x\end{array} \quad\left\{\begin{array}{l}u_{t}=2 t \sin x \\ u_{t t}=2 \sin x .\end{array}\right.\right. {ux=t2cosxuxx=−t2sinx{ut=2tsinxutt=2sinx.
将真解对应部分带入微分方程从而反解右端源项 f ( x , t ) f(x, t) f(x,t)
0 c D t α u ( x , t ) = 1 Γ ( 1 − α ) ∫ 0 t 2 s sin x ( t − s ) α d s = − 2 sin x Γ ( 1 − α ) ∫ 0 t ( t − s − t ) ( t − s ) − α d s = − 2 sin x Γ ( 1 − α ) ∫ 0 t [ ( t − s ) 1 − α − t ( t − s ) − α ] d s = − 2 sin x Γ ( 1 − α ) [ ∫ 0 t − ( t − s ) 1 − α d ( t − s ) + ∫ 0 1 t ( t − s ) − α d ( t − s ) ] = − 2 sin x Γ ( 1 − α ) [ 1 2 − α ( t − s ) 2 − α ∣ t 0 + t 1 − α ( t − s ) 1 − α ∣ 0 t ] = − 2 sin x Γ ( 1 − α ) [ t 2 − α 2 − α + t 1 − α ⋅ ( − t 1 − α ) ] = − 2 sin x Γ ( 1 − α ) ⋅ − t 2 − α ( 2 − α ) ( 1 − α ) = 2 sin x Γ ( 3 − α ) t 2 − α \begin{aligned} { }_{0}^{c} D_{t}^{\alpha} u(x, t)&=\frac{1}{\Gamma(1-\alpha)} \int_{0}^{t} \frac{2s \sin x}{(t-s)^{\alpha}} d s\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)} \int_{0}^{t}(t-s-t)(t-s)^{-\alpha} d s\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)} \int_{0}^{t}\left[(t-s)^{1-\alpha}-t(t-s)^{-\alpha}\right] d s\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)}\left[\int_{0}^{t}-(t-s)^{1-\alpha} d(t-s)+\int_{0}^{1} t(t-s)^{-\alpha} d(t-s)\right]\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)}\left[\left.\frac{1}{2-\alpha}(t-s)^{2-\alpha}\right|_{t} ^{0}+\left.\frac{t}{1-\alpha}(t-s)^{1-\alpha}\right|_{0} ^{t}\right]\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)}\left[\frac{t^{2-\alpha}}{2-\alpha}+\frac{t}{1-\alpha} \cdot\left(-t^{1-\alpha}\right)\right]\\ &=\frac{-2 \sin x}{\Gamma(1-\alpha)} \cdot \frac{-t^{2-\alpha}}{(2-\alpha)(1-\alpha)}\\ &=\frac{2 \sin x}{\Gamma(3-\alpha)} t^{2-\alpha} \end{aligned} 0cDtαu(x,t)=Γ(1−α)1∫0t(t−s)α2ssinxds=Γ(1−α)−2sinx∫0t(t−s−t)(t−s)−αds=Γ(1−α)−2sinx∫0t[(t−s)1−α−t(t−s)−α]ds=Γ(1−α)−2sinx[∫0t−(t−s)1−αd(t−s)+∫01t(t−s)−αd(t−s)]=Γ(1−α)−2sinx[2−α1(t−s)2−α∣∣∣∣t0+1−αt(t−s)1−α∣∣∣∣0t]=Γ(1−α)−2sinx[2−αt2−α+1−αt⋅(−t1−α)]=Γ(1−α)−2sinx⋅(2−α)(1−α)−t2−α=Γ(3−α)2sinxt2−α
由于 0 C D t α u ( x , t ) = ∂ 2 u ∂ x 2 ( x , t ) + f ( x , t ) { }_{0}^{C} D_{t}^{\alpha} u(x, t)=\frac{\partial^{2} u}{\partial x^{2}}(x, t)+f(x, t) 0CDtαu(x,t)=∂x2∂2u(x,t)+f(x,t)
于是 f ( x , t ) = 0 C D t α u ( x , t ) − ∂ 2 u ∂ x 2 ( x , t ) = 2 sin x Γ ( 3 − α ) t 2 − α + t 2 sin x . \begin{aligned} f(x, t)&={ }_{0}^{C} D_{t}^{\alpha} u(x, t)-\frac{\partial^{2} u}{\partial x^{2}}(x, t)\\ &=\frac{2 \sin x}{\Gamma(3-\alpha)} t^{2-\alpha}+t^{2} \sin x. \end{aligned} f(x,t)=0CDtαu(x,t)−∂x2∂2u(x,t)=Γ(3−α)2sinxt2−α+t2sinx.
综上所述, 完整的数值算例为:
{ 0 C D t α u ( x , t ) = u x x ( x , t ) + 2 sin x Γ ( 3 − α ) t 2 − α + t 2 sin x , x ∈ ( 0 , L ) , t ∈ ( 0 , T ] u ( x , 0 ) = 0 , x ∈ ( 0 , L ) u ( 0 , t ) = 0 , u ( L , t ) = t 2 sin L , t ∈ [ 0 , T ] \left\{\begin{array}{l} { }_{0}^{C} D_{t}^{\alpha} u(x, t)=u_{x x}(x, t)+\frac{2 \sin x}{\Gamma(3-\alpha)} t^{2-\alpha}+t^{2} \sin x, \quad x \in(0, L), t \in(0, T] \\ u(x, 0)=0, \quad x \in(0, L) \\ u(0, t)=0, \quad u(L, t)=t^2\sin L, \quad t \in[0, T] \end{array}\right. ⎩⎨⎧0CDtαu(x,t)=uxx(x,t)+Γ(3−α)2sinxt2−α+t2sinx,x∈(0,L),t∈(0,T]u(x,0)=0,x∈(0,L)u(0,t)=0,u(L,t)=t2sinL,t∈[0,T]
由于 F l , i n = e − s l τ F l , i n − 1 + A l ( u i n − 1 − u i n − 2 ) + B l ( u i n − u i n − 1 ) F_{l, i}^{n}=\mathrm{e}^{-s_{l} \tau} F_{l, i}^{n-1}+A_{l}\left(u_{i}^{n-1}-u_{i}^{n-2}\right)+B_{l}\left(u_{i}^{n}-u_{i}^{n-1}\right) Fl,in=e−slτFl,in−1+Al(uin−1−uin−2)+Bl(uin−uin−1) 中含有 u i n u_{i}^{n} uin, 故考虑将 F l , i n F_{l, i}^{n} Fl,in 拆成
F l , i n = F ^ l , i n + B l ( u i n − u i n − 1 ) F_{l, i}^{n}=\hat{F}_{l,i}^{n}+B_{l}\left(u_{i}^{n}-u_{i}^{n-1}\right) Fl,in=F^l,in+Bl(uin−uin−1)
其中 F ^ l , i n = e − s l τ F l , i n − 1 + A l ( u i n − 1 − u i n − 2 ) \hat{F}_{l,i}^{n}=\mathrm{e}^{-s_{l} \tau} F_{l, i}^{n-1}+A_{l}\left(u_{i}^{n-1}-u_{i}^{n-2}\right) F^l,in=e−slτFl,in−1+Al(uin−1−uin−2)
根据差分格式:
1 Γ ( 1 − α ) ∑ l = 1 N exp ω l F l , i n + d 0 ( 1 , α ) ( u i n − u i n − 1 ) = σ δ x 2 u i n + ( 1 − σ ) δ x 2 u i n − 1 + f i n − 1 + σ \frac{1}{\Gamma(1-\alpha)} \sum_{l=1}^{N_{\exp }} \omega_{l} F_{l, i}^{n}+d_{0}^{(1, \alpha)}\left(u_{i}^{n}-u_{i}^{n-1}\right)=\sigma \delta_{x}^{2} u_{i}^{n}+(1-\sigma) \delta_{x}^{2} u_{i}^{n-1}+f_{i}^{n-1+\sigma} Γ(1−α)1l=1∑NexpωlFl,in+d0(1,α)(uin−uin−1)=σδx2uin+(1−σ)δx2uin−1+fin−1+σ
于是有
1 Γ ( 1 − α ) ∑ i = 1 N exp w i F ^ l , i n + 1 Γ ( 1 − α ) ∑ i = 1 N e x p ω i B l ( u i n − u i n − 1 ) + d 0 ( 1 , α ) ( u i n − u i n − 1 ) \frac{1}{\Gamma(1-\alpha)} \sum_{i=1}^{N_{\text {exp }}} w_{i} \hat{F}_{l, i}^{n}+\frac{1}{\Gamma(1-\alpha)} \sum_{i=1}^{N_{exp}} \omega_{i} B_{l}\left(u_{i}^{n}-u_{i}^{n-1}\right)+d_{0}^{(1, \alpha)}\left(u_{i}^{n}-u_{i}^{n-1}\right) Γ(1−α)1i=1∑Nexp wiF^l,in+Γ(1−α)1i=1∑NexpωiBl(uin−uin−1)+d0(1,α)(uin−uin−1)
= σ δ x 2 u i n + ( 1 − σ ) δ x 2 u i n − 1 + f i n − 1 + σ =\sigma \delta_{x}^{2} u_{i}^{n}+(1-\sigma) \delta_{x}^{2} u_{i}^{n-1}+f_{i}^{n-1+\sigma} =σδx2uin+(1−σ)δx2uin−1+fin−1+σ
得到如下代数系统:
A ( u 1 n u 2 n ⋮ u M − 2 n u M − 1 n ) = b \mathbf{A}\left(\begin{array}{c}u_{1}^{n} \\ u_{2}^{n} \\ \vdots \\ u_{M-2}^{n} \\ u_{M-1}^{n}\end{array}\right)=\mathbf{b} A⎝⎜⎜⎜⎜⎜⎛u1nu2n⋮uM−2nuM−1n⎠⎟⎟⎟⎟⎟⎞=b
其中
A = ( 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) + 2 σ h 2 − σ h 2 − σ h 2 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) + 2 σ h 2 − σ h 2 ⋱ ⋱ 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) + 2 σ h 2 − σ h 2 ) \mathbf{A}=\left(\begin{array}{cccc}\frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}+\frac{2 \sigma}{h^{2}}&-\frac{\sigma}{h^{2}} & & \\ -\frac{\sigma}{h^{2}} & \frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}+\frac{2 \sigma}{h^{2}}&-\frac{\sigma}{h^{2}} & \\ & \ddots & \ddots & \\ & & \frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}+\frac{2 \sigma}{h^{2}}&-\frac{\sigma}{h^{2}}\end{array}\right) A=⎝⎜⎜⎜⎜⎜⎜⎜⎜⎜⎛Γ(1−α)1l=1∑NexpωlBl+d0(1,α)+h22σ−h2σ−h2σΓ(1−α)1l=1∑NexpωlBl+d0(1,α)+h22σ⋱−h2σ⋱Γ(1−α)1l=1∑NexpωlBl+d0(1,α)+h22σ−h2σ⎠⎟⎟⎟⎟⎟⎟⎟⎟⎟⎞
b = ( 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) − 2 ( 1 − σ ) h 2 1 − σ h 2 1 − σ h 2 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) − 2 ( 1 − σ ) h 2 1 − σ h 2 ⋱ ⋱ 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l B l + d 0 ( 1 , α ) − 2 ( 1 − σ ) h 2 1 − σ h 2 ) ( u 1 n − 1 u 2 n − 1 ⋮ u M − 2 n − 1 u M − 1 n − 1 ) + 1 − σ h 2 ⋅ ( u 0 n − 1 0 ⋮ 0 u M − 1 n ) + σ h 2 ⋅ ( u 0 n 0 ⋮ 0 u M n ) + a ^ 0 ( α ) Γ ( 1 − α ) ⋅ ( u 1 n − 1 u 2 n − 1 ⋮ u M − 2 n − 1 u M − 1 n − 1 ) − 1 Γ ( 1 − α ) ∑ l = 1 N e x p ω l F ^ l , i n + f i n − 1 + σ \begin{aligned} \mathbf{b}&=\left(\begin{array}{cccc}\frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}-\frac{2 (1-\sigma)}{h^{2}}&\frac{1-\sigma}{h^{2}} & & \\ \frac{1-\sigma}{h^{2}} & \frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}-\frac{2 (1-\sigma)}{h^{2}}&\frac{1-\sigma}{h^{2}} & \\ & \ddots & \ddots & \\ & & \frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} B_{l}+d_{0}^{(1, \alpha)}-\frac{2 (1-\sigma)}{h^{2}}&\frac{1-\sigma}{h^{2}}\end{array}\right)\left(\begin{array}{c}u_{1}^{n-1} \\ u_{2}^{n-1} \\ \vdots \\ u_{M-2}^{n-1} \\ u_{M-1}^{n-1}\end{array}\right)\\ &+\frac{1-\sigma}{h^{2}} \cdot\left(\begin{array}{c}u_{0}^{n-1} \\ 0 \\ \vdots \\ 0 \\ u_{M-1}^{n}\end{array}\right)+\frac{\sigma}{h^{2}} \cdot\left(\begin{array}{c}u_{0}^{n} \\ 0 \\ \vdots \\ 0 \\ u_{M}^{n}\end{array}\right)+\frac{\hat{a}_0^{(\alpha)}}{\Gamma(1-\alpha)} \cdot\left(\begin{array}{c}u_{1}^{n-1} \\ u_{2}^{n-1} \\ \vdots \\ u_{M-2}^{n-1}\\ u_{M-1}^{n-1}\end{array}\right)-\frac{1}{\Gamma(1-\alpha)} \sum\limits_{l=1}^{N_{exp}} \omega_{l} \hat{F}_{l, i}^{n}+f_{i}^{n-1+\sigma} \end{aligned} b=⎝⎜⎜⎜⎜⎜⎜⎜⎜⎜⎛Γ(1−α)1l=1∑NexpωlBl+d0(1,α)−h22(1−σ)h21−σh21−σΓ(1−α)1l=1∑NexpωlBl+d0(1,α)−h22(1−σ)⋱h21−σ⋱Γ(1−α)1l=1∑NexpωlBl+d0(1,α)−h22(1−σ)h21−σ⎠⎟⎟⎟⎟⎟⎟⎟⎟⎟⎞⎝⎜⎜⎜⎜⎜⎛u1n−1u2n−1⋮uM−2n−1uM−1n−1⎠⎟⎟⎟⎟⎟⎞+h21−σ⋅⎝⎜⎜⎜⎜⎜⎛u0n−10⋮0uM−1n⎠⎟⎟⎟⎟⎟⎞+h2σ⋅⎝⎜⎜⎜⎜⎜⎛u0n0⋮0uMn⎠⎟⎟⎟⎟⎟⎞+Γ(1−α)a^0(α)⋅⎝⎜⎜⎜⎜⎜⎛u1n−1u2n−1⋮uM−2n−1uM−1n−1⎠⎟⎟⎟⎟⎟⎞−Γ(1−α)1l=1∑NexpωlF^l,in+fin−1+σ
相关积分计算:
A l = ∫ 0 1 ( 3 2 − ξ ) e − s l ( σ + 1 − ξ ) τ d ξ = ∫ 0 1 3 2 e − s l ( σ + 1 − ξ ) τ d ξ − ∫ 0 1 ξ e − s l ( σ + 1 − ξ ) τ d ξ = 3 2 s l τ [ e − s l τ σ − e − s l τ ( σ + 1 ) ] − e − s l ( σ + 1 ) τ ⋅ 1 s l τ [ e s l τ − 1 s τ τ e s l τ + 1 s l τ ] = 1 s l τ e − s l τ σ [ 1 2 + 1 s l τ − ( 1 s l τ + 3 2 ) e − s l τ ] \begin{aligned}A_{l}&=\int_{0}^{1}\left(\frac{3}{2}-\xi\right) \mathrm{e}^{-s_{l}(\sigma+1-\xi) \tau} \mathrm{d} \xi\\ &=\int_{0}^{1} \frac{3}{2} e^{-s_{l}(\sigma+1-\xi) \tau} d \xi-\int_{0}^{1} \xi e^{-s_{l}(\sigma+1-\xi) \tau} d \xi\\ &=\frac{3}{2 s_{l} \tau}\left[e^{-s_{l} \tau \sigma}-e^{-s_{l} \tau(\sigma+1)}\right]-e^{-s_{l}\left(\sigma+1\right) \tau} \cdot \frac{1}{s_{l} \tau}\left[e^{s_{l} \tau}-\frac{1}{s_{\tau} \tau} e^{s_{l} \tau}+\frac{1}{s_{l} \tau}\right]\\ &=\frac{1}{s_{l} \tau} e^{-s_{l} \tau \sigma}\left[\frac{1}{2}+\frac{1}{s_{l} \tau}-\left(\frac{1}{s_{l} \tau}+\frac{3}{2}\right) e^{-s_{l} \tau}\right] \end{aligned} Al=∫01(23−ξ)e−sl(σ+1−ξ)τdξ=∫0123e−sl(σ+1−ξ)τdξ−∫01ξe−sl(σ+1−ξ)τdξ=2slτ3[e−slτσ−e−slτ(σ+1)]−e−sl(σ+1)τ⋅slτ1[eslτ−sττ1eslτ+slτ1]=slτ1e−slτσ[21+slτ1−(slτ1+23)e−slτ]
B l = ∫ 0 1 ( ξ − 1 2 ) e − s l ( σ + 1 − ξ ) τ d ξ = ∫ 0 1 − 1 2 e − s l ( σ + 1 − ξ ) τ d ξ + ∫ 0 1 ξ e − s l ( σ + 1 − ξ ) τ d ξ = − 1 2 s l τ [ e − s l τ σ − e − s l τ ( σ + 1 ) ] + e − s l ( σ + 1 ) τ ⋅ 1 s l τ [ e s l τ − 1 s τ τ e s l τ + 1 s l τ ] = 1 s l τ e − s l τ σ [ 1 2 − 1 s l τ + ( 1 s l τ + 1 2 ) e − s l τ ] \begin{aligned} B_{l}&=\int_{0}^{1}\left(\xi-\frac{1}{2}\right) \mathrm{e}^{-s_{l}(\sigma+1-\xi) \tau} \mathrm{d} \xi\\ &=\int_{0}^{1} -\frac{1}{2} e^{-s_{l}(\sigma+1-\xi) \tau} d \xi+\int_{0}^{1} \xi e^{-s_{l}(\sigma+1-\xi) \tau} d \xi\\ &=-\frac{1}{2 s_{l} \tau}\left[e^{-s_{l} \tau \sigma}-e^{-s_{l} \tau(\sigma+1)}\right]+e^{-s_{l}\left(\sigma+1\right) \tau} \cdot \frac{1}{s_{l} \tau}\left[e^{s_{l} \tau}-\frac{1}{s_{\tau} \tau} e^{s_{l} \tau}+\frac{1}{s_{l} \tau}\right]\\ &=\frac{1}{s_{l} \tau} e^{-s_{l} \tau \sigma}\left[\frac{1}{2}-\frac{1}{s_{l} \tau}+\left(\frac{1}{s_{l} \tau}+\frac{1}{2}\right) e^{-s_{l} \tau}\right] \end{aligned} Bl=∫01(ξ−21)e−sl(σ+1−ξ)τdξ=∫01−21e−sl(σ+1−ξ)τdξ+∫01ξe−sl(σ+1−ξ)τdξ=−2slτ1[e−slτσ−e−slτ(σ+1)]+e−sl(σ+1)τ⋅slτ1[eslτ−sττ1eslτ+slτ1]=slτ1e−slτσ[21−slτ1+(slτ1+21)e−slτ]
程序运行时间:
时间步长为 0.000100
空间步长为 0.012500
时快速 L2-1 σ _\sigma σ 插值逼近历时 4.232766
秒.
误差Error =6.6569e-06
而相同的网格剖分及精度下, 传统的基于 L2-1 σ _\sigma σ 逼近需历时 166.610357
秒.
误差6.9756e-07
主程序:
clc,clear
tic
%% 初始化定解问题
alpha=0.2;
sigma=1-alpha/2;
epsilon=1e-8;
tau_hat=1e-6;
tau=1/10000; T_a=0; T_b=1;
h=1/80; L_a=0; L_b=1;
M=(L_b-L_a)/h;
N=(T_b-T_a)/tau;
x=L_a:h:L_b; t=T_a:tau:T_b;
u=zeros(M+1,N+1); % @u 初始化数值解
u(:,1)=f_ic(x,T_a,0,0); % 定义初值条件
u(1,:)=f_bc(L_a,t,0,0); % 定义左边界条件
u(M+1,:)=f_bc(L_b,t,0,0); % 定义右边界条件
[xs,ws,nexp] = sumofexpappr2new(alpha,epsilon,tau_hat,T_b);
%% 两层格式(启动层)
n=2;
F_l=zeros(M-1,nexp);
% 创建代数系统
% 系数矩阵 Coefficient_Matrix_A
Coefficient_Matrix_A=toeplitz([d(0,1,alpha,sigma,tau)+2*sigma/h^2,-sigma/h^2,zeros(M-3,1)']);
% 右端 Right_Term_B
Right_Term_B=f_source(x(2:M),t(n-1)+sigma*tau,alpha)'...
-1/gamma(1-alpha)*F_l*ws...
+toeplitz([d(0,1,alpha,sigma,tau)-2*(1-sigma)/h^2,(1-sigma)/h^2,zeros(M-3,1)'])*u(2:M,n-1)...
+(1-sigma)/h^2*[u(1,n-1);zeros(M-3,1);u(M+1,n-1)]...
+sigma/h^2*[u(1,n);zeros(M-3,1);u(M+1,n)];
% 求解迭代系统(由0层求第1层的值)
u(2:M,n)=Coefficient_Matrix_A\Right_Term_B;
fprintf('进程:\t%d/%d\n',n,N+1)
%% 三层格式
% A_l=3./(2*xs*tau).*(exp(1).^(-xs*tau*sigma)-exp(1).^(-xs*tau*(sigma+1)))...
% -exp(1).^(-xs*(sigma+1)*tau)./(xs*tau).*(exp(1.^(xs*tau)-1./(xs*tau).*exp(1).^(xs*tau)+1./(xs*tau)));
% B_l=-1./(2*xs*tau).*(exp(1).^(-xs*tau*sigma)-exp(1).^(-xs*tau*(sigma+1)))...
% +exp(1).^(-xs*(sigma+1)*tau)./(xs*tau).*(exp(1.^(xs*tau)-1./(xs*tau).*exp(1).^(xs*tau)+1./(xs*tau)));
% 使用上述未化简的 A_l、B_l 会出现较大误差, 考虑是因为较大舍入误差造成
A_l=1./(xs*tau).*exp(1).^(-xs*tau*sigma).*(1/2+1./(xs*tau)-(1./(xs*tau)+3/2).*exp(1).^(-xs*tau));
B_l=1./(xs*tau).*exp(1).^(-xs*tau*sigma).*(1/2-1./(xs*tau)+(1./(xs*tau)+1/2).*exp(1).^(-xs*tau));
for n=3:N+1
% 创建代数系统
F_l=F_l*diag(exp(1).^(-xs*tau))+((u(2:M,n-1)-u(2:M,n-2)))*A_l';
% 系数矩阵 Coefficient_Matrix_A
Coefficient_Matrix_A=toeplitz([1/gamma(1-alpha)*B_l'*ws+d(0,1,alpha,sigma,tau)+2*sigma/h^2,-sigma/h^2,zeros(M-3,1)']);
% 右端 Right_Term_B1
Right_Term_B1=f_source(x(2:M),t(n-1)+sigma*tau,alpha)'...
-1/gamma(1-alpha)*F_l*ws...
+toeplitz([1/gamma(1-alpha)*B_l'*ws+d(0,1,alpha,sigma,tau)-2*(1-sigma)/h^2,(1-sigma)/h^2,zeros(M-3,1)'])*u(2:M,n-1)...
+(1-sigma)/h^2*[u(1,n-1);zeros(M-3,1);u(M+1,n-1)]...
+sigma/h^2*[u(1,n);zeros(M-3,1);u(M+1,n)];
% 求解代数系统(由 k-2 层及第 k-1 层求第 k 层的值)
u(2:M,n)=Coefficient_Matrix_A\Right_Term_B1;
fprintf('进程:\t%d/%d\n',n,N+1)
end
% clc
fprintf('时间步长为 %f 空间步长为 %f 时快速 L2_1_sigma 插值逼近 %d\n',tau,h)
toc
%% 误差分析
U=zeros(size(u));
for m=1:M+1
for n=1:N+1
U(m,n)=u_exact(x(m),t(n),0,0);
end
end
Error=max(max(abs(u-U)))
%% 绘图
figure
plot(t,u(7,:))
hold on
plot(t,U(7,:))
legend('数值解','精确解')
此处由于字数限制, 仅展示了主程序代码部分, 若需要绘图及误差分析等完整代码, 请在评论区留下邮箱.
孙志忠,高广花.分数阶微分方程的有限差分方法(第二版).北京:科学出版社,2021.
本人水平有限, 若有不妥之处, 恳请批评指正.
作者:图灵的猫
作者邮箱: [email protected]