PDE抛物型方程数值解法总结与例题分析

抛物型方程

例题及解答

例题:
构造抛物型方程
{ ∂ u ∂ t = ∂ ∂ x ( x ∂ u ∂ x ) , 0.5 < x < 1 , 0 < t ⩽ T , u ( x ,   0 ) = φ ( x ) , 0.5 ⩽ x ⩽ 1 , u ( 0.5 ,   t ) = 0 ,   ∂ u ∂ x ( 1 , t ) = − 1 3 u ( 1 ,   t ) ,   0 ⩽ t ⩽ T , \left\{\begin{aligned} &\frac{\partial u}{\partial t}=\frac{\partial}{\partial x}\left(x\frac{\partial u}{\partial x}\right),\quad0.5tu=x(xxu),0.5<x<1,0<tT,u(x, 0)=φ(x),0.5x1,u(0.5, t)=0, xu(1,t)=31u(1, t), 0tT,
的显格式,取 h = 0.1 ,   r = 0.1 h=0.1,\ r=0.1 h=0.1, r=0.1

解答:

由于本题空间项同时含有一阶项和二阶项,导致截断误差的阶数不匹配(应该同为二阶),利用有限差分格式不易求解,故下面用积分插值进行求解。

用积分插值法建立差分格式如下:

x = j h ,   t = k τ ,   j = 0 , 1 , ⋯   , 1 / h , k = 0 , 1 , ⋯   , T / τ x=jh,\ t=k\tau,\ j=0,1,\cdots,1/h,\quad k=0,1,\cdots,T/\tau x=jh, t=kτ, j=0,1,,1/h,k=0,1,,T/τ

( j , k ) (j,k) (j,k)为内点,取区间 x j − h 2 ⩽ x ⩽ x j + h 2 x_j-\frac h2\leqslant x\leqslant x_j+\frac h2 xj2hxxj+2h,在此区间对 x x x积分得:

∫ x j − 1 2 x j + 1 2 ∂ u ∂ t d x = ∫ x j − 1 2 x j + 1 2 ∂ ∂ x ( x ∂ u ∂ x ) d x , \int_{x_{j-\frac 12}}^{x_{j+\frac 12}}\frac{\partial u}{\partial t}\mathrm{d}x= \int_{x_{j-\frac 12}}^{x_{j+\frac 12}}\frac{\partial }{\partial x}\left( x\frac{\partial u}{\partial x}\right) \mathrm{d}x, xj21xj+21tudx=xj21xj+21x(xxu)dx,

利用数值积分的中矩形公式得:

∫ x j − 1 2 x j + 1 2 ∂ u ∂ t d x = [ ∂ u ∂ t ] j h + O ( h 3 ) , \int_{x_{j-\frac 12}}^{x_{j+\frac 12}}\frac{\partial u}{\partial t}\mathrm{d}x=\left[ \frac{\partial u}{\partial t}\right]_j h +\mathcal{O}(h^3) , xj21xj+21tudx=[tu]jh+O(h3),

右边同理:

∫ x j − 1 2 x j + 1 2 ∂ ∂ x ( x ∂ u ∂ x ) d x = x j + 1 2 [ ∂ u ∂ x ] j + 1 2 − x j − 1 2 [ ∂ u ∂ x ] j − 1 2 , (1) \int_{x_{j-\frac 12}}^{x_{j+\frac 12}}\frac{\partial }{\partial x}\left( x\frac{\partial u}{\partial x}\right) \mathrm{d}x = x_{j+\frac12}\left[ \frac{\partial u}{\partial x}\right]_{j+\frac12} -x_{j-\frac12}\left[ \frac{\partial u}{\partial x}\right]_{j-\frac12}, \tag{1} xj21xj+21x(xxu)dx=xj+21[xu]j+21xj21[xu]j21,(1)

由最简显格式公式,可得
[ ∂ u ∂ t ] j = [ u ] j k + 1 − [ u ] j k τ + O ( τ ) . \left[ \frac{\partial u}{\partial t}\right]_j=\frac{[u]_j^{k+1}-[u]_j^k}{\tau}+\mathcal{O}(\tau). [tu]j=τ[u]jk+1[u]jk+O(τ).

对式 ( 1 ) (1) (1) 右端用一阶中心差商代替一阶偏导数得到

[ ∂ u ∂ x ] j + 1 2 = [ u ] j + 1 k − [ u ] j k h + O ( h 2 ) , \left[ \frac{\partial u}{\partial x}\right]_{j+\frac12}=\frac{[u]_{j+1}^{k}-[u]_j^k}{h}+\mathcal{O}(h^2), [xu]j+21=h[u]j+1k[u]jk+O(h2),

[ ∂ u ∂ x ] j − 1 2 = [ u ] j k − [ u ] j − 1 k h + O ( h 2 ) , \left[ \frac{\partial u}{\partial x}\right]_{j-\frac12}=\frac{[u]_{j}^{k}-[u]_{j-1}^k}{h}+\mathcal{O}(h^2), [xu]j21=h[u]jk[u]j1k+O(h2),

联立上面各式,得到:

[ u ] j k + 1 − [ u ] j k τ = 1 h 2 [ x j + 1 2 ( [ u ] j + 1 k − [ u ] j k ) − x j − 1 2 ( [ u ] j + 1 k − [ u ] j − 1 k ) ] + O ( τ + h 2 ) \frac{[u]_j^{k+1}-[u]_j^k}{\tau}=\frac{1}{h^2}\left[ x_{j+\frac12}\left( [u]_{j+1}^{k}-[u]_j^k\right) -x_{j-\frac12}\left( [u]_{j+1}^{k}-[u]_{j-1}^k\right) \right] +\mathcal{O}(\tau+h^2) τ[u]jk+1[u]jk=h21[xj+21([u]j+1k[u]jk)xj21([u]j+1k[u]j1k)]+O(τ+h2)

u j k u_j^k ujk代替 [ u ] j k [u]_j^k [u]jk,去掉误差项,则有

u j k + 1 − u j k τ = 1 h 2 [ x j + 1 2 ( u j + 1 k − u j k ) − x j − 1 2 ( u j k − u j − 1 k ) ] \frac{u_j^{k+1}-u_j^k}{\tau}=\frac{1}{h^2}\left[ x_{j+\frac12}\left( u_{j+1}^{k}-u_j^k\right) -x_{j-\frac12}\left( u_{j}^{k}-u_{j-1}^k\right) \right] τujk+1ujk=h21[xj+21(uj+1kujk)xj21(ujkuj1k)]

取网比为 r = τ h 2 r=\frac \tau {h^2} r=h2τ,则上式等价于

u j k + 1 = r x j − 1 2 u j − 1 k + ( 1 − r x j + 1 2 − r x j − 1 2 ) u j k + r x j + 1 2 u j + 1 k . u_j^{k+1}=rx_{j-\frac12}u_{j-1}^k+(1-rx_{j+\frac12}-rx_{j-\frac12})u_j^k+rx_{j+\frac12}u_{j+1}^k. ujk+1=rxj21uj1k+(1rxj+21rxj21)ujk+rxj+21uj+1k.

代入步长得:

u j k + 1 = 0.1 x j − 1 2 u j − 1 k + ( 1 − 0.1 x j + 1 2 − 0.1 x j − 1 2 ) u j k + 0.1 x j + 1 2 u j + 1 k . u_j^{k+1}=0.1x_{j-\frac12}u_{j-1}^k+(1-0.1x_{j+\frac12}-0.1x_{j-\frac12})u_j^k+0.1x_{j+\frac12}u_{j+1}^k. ujk+1=0.1xj21uj1k+(10.1xj+210.1xj21)ujk+0.1xj+21uj+1k.

而由于 0.5 < x < 1 0.50.5<x<1,所以 x j > 0 ,   x j − 1 2 > 0 ,   x j + 1 2 > 0 ,   j = 0 , 1 , ⋯   , 1 / h . x_j>0,\ x_{j-\frac12}>0,\ x_{j+\frac12}>0,\ j=0,1,\cdots,1/h. xj>0, xj21>0, xj+21>0, j=0,1,,1/h.

对第一类边界条件 u ( x , 0 ) = φ ( x ) ,    u ( 0.5 , t ) = 0 u(x,0)=\varphi(x),\ \ u(0.5,t)=0 u(x,0)=φ(x),  u(0.5,t)=0,有:

u j 0 = φ ( x j ) ,    u 5 k = 0 , u_j^0=\varphi(x_j),\ \ u_{5}^k=0, uj0=φ(xj),  u5k=0,

对第二类边界条件 ∂ ∂ x u ( 1 , t ) = − 1 3 u ( 1 ,   t ) \frac{\partial }{\partial x}u(1,t)=-\frac13 u(1,\ t) xu(1,t)=31u(1, t),可得到:

[ ∂ u ∂ x ] j k = u j + 1 k − u j − 1 k 2 h , \left[ \frac{\partial u}{\partial x}\right]_j^k=\frac{u_{j+1}^{k}-u_{j-1}^k}{2h}, [xu]jk=2huj+1kuj1k,

所以

[ ∂ u ∂ x ] 10 k = u 11 k − u 9 k 0.2 = − 1 3 u 10 k , \left[ \frac{\partial u}{\partial x}\right]_{10}^k=\frac{u_{11}^{k}-u_{9}^k}{0.2}=-\frac13 u_{10}^k, [xu]10k=0.2u11ku9k=31u10k,

即: u 10 k = 15 ( u 9 k − u 11 k ) u_{10}^k=15(u_9^k-u_{11}^k) u10k=15(u9ku11k).

小结

本文总结了一道特殊形式的抛物型方程的数值解格式,其需要掌握的知识主要是有限差分格式,即不同的差商表示对偏导项的离散,其难点在于对数值分析方法的掌握,同时还要注意方程的自变量范围对离散格式的影响以及初值边值条件的处理。

参考

[1] 常微分数值方法部分课后习题答案

你可能感兴趣的:(ODE&PDE)