当前位置:   article > 正文

偏微分方程算法之二维初边值问题(交替方向隐(ADI)格式)_douglas格式

douglas格式

一、研究对象

        以二维抛物型方程初边值问题为研究对象:

\left\{\begin{matrix} \frac{\partial u(x,y,t)}{\partial t}-(\frac{\partial^{2}u(x,y,t)}{\partial x^{2}}+\frac{\partial^{2}u(x,y,t)}{\partial y^{2}})=f(x,y,t),(x,y)\in \Omega=[0,a]\times [0,b],0<t\leqslant T,\\ u(x,y,0)=\varphi(x,y),(x,y)\in \Omega,\space\space\space\space(1)\\ u(0,y,t)=g_{1}(y,t),u(a,y,t)=g_{2}(y,t),0\leqslant y\leqslant b,0<t\leqslant T,\\ u(x,0,t)=g_{3}(x,t),u(x,b,t)=g_{4}(x,t),0\leqslant x\leqslant a,0<t\leqslant T \end{matrix}\right.

        为了确保连续性,公式(1)中的相关函数满足:

g_{1}(0,t)=g_{3}(0,t),g_1(b,t)=g_4(0,t),

g_{2}(0,t)=g_{3}(a,t),g_{2}(b,t)=g_{4}(a,t)

\varphi(0,y)=g_{1}(y,0),\varphi(a,y)=g_{2}(y,0),

\varphi(x,0)=g_{3}(x,0),\varphi(x,b)=g_{4}(x,0)

二、理论推导

2.1 向前欧拉格式

        首先进行网格剖分。将三维长方体空间(二维位置平面+一维时间轴)进行剖分,将区域[0,a]等分m份,区域[0,b]等分n份,区域[0,T]等分l份,有:

x_{i}=i\cdot \Delta x=\frac{ia}{m},0\leqslant i\leqslant m,

y_{j}=j\cdot \Delta y=\frac{jb}{n},0\leqslant j\leqslant n,t_{k}=k\cdot \Delta t=\frac{kT}{l},0\leqslant k\leqslant l

得到网格节点坐标(x_{i},y_{j},t_{k})。利用数值法求的数值解u(x,y,t)在网格节点(x_{i},y_{j},t_{k})处的近似值u^{k}_{i,j}

        然后将原方程弱化为节点离散方程,即

\left\{\begin{matrix} \frac{\partial u}{\partial t}|_{(x_{i},y_{j},t_{k})}- (\frac{\partial^{2}u}{\partial x^{2}}+\frac{\partial^{2}u}{\partial y^{2}})|_{(x_{i},y_{j},t_{k})}=f(x_{i},y_{j},t_{k}),0\leqslant i\leqslant m,0\leqslant j\leqslant n,0<k\leqslant l,\\ u(x_{i},y_{j},t_{0})=\varphi(x_{i},y_{j}),0\leqslant i \leqslant m,0\leqslant j\leqslant n, \space\space\space\space (2)\\ u(x_{0},y_{j},t_{k})=g_{1}(y_{j},t_{k}),u(x_{m},y_{j},t_{k})=g_{2}(y_{j},t_{k}),0\leqslant j\leqslant n,0<k\leqslant l,\\ u(x_{i},y_{0},t_{k})=g_{3}(x_{i},t_{k}),u(x_{i},y_{n},t_{k})=g_{4}(x_{i},t_{k}),0\leqslant i\leqslant m,0<k\leqslant l \end{matrix}\right.

        然后利用差商代替微商,取

\frac{\partial u}{\partial t}|_{(x_{i},y_{j},t_{k})}\approx \frac{u(x_{i},y_{j},t_{k+1})-u(x_{i},y_{j},t_{k})}{\Delta t}

\frac{\partial^{2}u}{\partial x^{2}}|_{(x_{i},y_{j},t_{k})}\approx \frac{u(x_{i+1},y_{j},t_{k})-2u(x_{i},y_{j},t_{k})+u(x_{i-1},y_{j},t_{k})}{\Delta x^{2}}

\frac{\partial^{2}u}{\partial y^{2}}|_{(x_{i},y_{j},t_{k})}\approx \frac{u(x_{i},y_{j+1},t_{k})-2u(x_{i},y_{j},t_{k})+u(x_{i},y_{j-1},t_{k})}{\Delta y^{2}}

将上面三式代入公式(2),用数值解代替精确解并忽略高阶项,可得数值格式为

\left\{\begin{matrix} \frac{u^{k+1}_{i,j}-u^{k}_{i,j}}{\Delta t}-(\frac{u^{k}_{i+1,j}-2u^{k}_{i,j}+u^{k}_{i-1,j}}{\Delta x^{2}}+\frac{u^{k}_{i,j+1}-2u^{k}_{i,j}+u^{k}_{i,j-1}}{\Delta y^{2}})=f(x_{i},y_{j},t_{k}),1\leqslant i\leqslant m-1,1\leqslant j\leqslant n-1,0\leqslant k\leqslant l-1,\\ u^{0}_{i,j}=\varphi(x_{i},y_{j}),0\leqslant i\leqslant m,0\leqslant j\leqslant n,\\ u^{k}_{0,j}=g_{1}(y_{j},t_{k}),u^{k}_{m,j}=g_{2}(y_{j},t_{k}),0\leqslant j\leqslant n,0<k\leqslant l,\\ u^{k}_{i,0}=g_{3}(x_{i},t_{k}),u^{k}_{i,n}=g_{4}(x_{i},t_{k}),0\leqslant i\leqslant m,0<k\leqslant l \end{matrix}\right.

        记r_{1}=\frac{\Delta t}{\Delta x^{2}},r_{2}=\frac{\Delta t}{\Delta y^{2}},则上式可整理为

\left\{\begin{matrix} u^{k+1}_{i,j}=r_{1}u^{k}_{i-1,j}+r_{1}u^{k}_{i+1,j}+r_{2}u^{k}_{i,j-1}+r_{2}u^{k}_{i,j+1}+(1-2r_{1}-2r_{2})u^{k}_{i,j}+f(x_{i},y_{j},t_{k})\Delta t,1\leqslant i\leqslant m-1,1\leqslant j\leqslant n-1,0\leqslant k\leqslant l-1,\\ u^{0}_{i,j}=\varphi(x_{i},y_{j}),0\leqslant i\leqslant m,0\leqslant j\leqslant n,\space\space\space\space(3)\\ u^{k}_{0,j}=g_{1}(y_{j},t_{k}),u^{k}_{m,j}=g_{2}(y_{j},t_{k}),0\leqslant j\leqslant n,0<k\leqslant l, \\ u^{k}_{i,0}=g_{3}(x_{i},t_{k}),u^{k}_{i,n}=g_{4}(x_{i},t_{k}),0\leqslant i\leqslant m,0<k\leqslant l \end{matrix}\right.

        公式(3)的截断误差为O(\Delta t +\Delta x^{2}+\Delta y^{2}),可证明其稳定性条件为r_{1}+r_{2}\leqslant \frac{1}{2}。可见,时间、空间步长的选择条件苛刻,应用价值不大,需要通过其它方式来降低使用局限性。

2.2 Crank-Nicolson格式

        显格式方法稳定性条件差,尝试采用隐格式来计算。将原节点离散方程公式(2)改为:

\left\{\begin{matrix} \frac{\partial u}{\partial t}|_{(x_{i},y_{j},t_{k+\frac{1}{2}})}- (\frac{\partial^{2}u}{\partial x^{2}}+\frac{\partial^{2}u}{\partial y^{2}})|_{(x_{i},y_{j},t_{k+\frac{1}{2}})}=f(x_{i},y_{j},t_{k+\frac{1}{2}}),0\leqslant i\leqslant m,0\leqslant j\leqslant n,0<k\leqslant l,\\ u(x_{i},y_{j},t_{0})=\varphi(x_{i},y_{j}),0\leqslant i \leqslant m,0\leqslant j\leqslant n, \space\space\space\space (4)\\ u(x_{0},y_{j},t_{k})=g_{1}(y_{j},t_{k}),u(x_{m},y_{j},t_{k})=g_{2}(y_{j},t_{k}),0\leqslant j\leqslant n,0<k\leqslant l,\\ u(x_{i},y_{0},t_{k})=g_{3}(x_{i},t_{k}),u(x_{i},y_{n},t_{k})=g_{4}(x_{i},t_{k}),0\leqslant i\leqslant m,0<k\leqslant l \end{matrix}\right.

        然后利用差商代替微商,取

\frac{\partial u}{\partial t}|_{(x_{i},y_{j},t_{k+\frac{1}{2}})}\approx \frac{u(x_{i},y_{j},t_{k+1})-u(x_{i},y_{j},t_{k})}{\Delta t}

\frac{\partial^{2}u}{\partial x^{2}}|_{(x_{i},y_{j},t_{k+\frac{1}{2}})}\approx \frac{1}{2}[\frac{\partial^{2}u}{\partial x^{2}}|_{(x_{i},y_{j},t_{k})}+\frac{\partial^{2}u}{\partial x^{2}}|_{(x_{i},y_{j},t_{k+1})}]\approx\frac{1}{2}[\frac{u(x_{i+1},y_{j},t_{k})-2u(x_{i},y_{j},t_{k})+u(x_{i-1},y_{j},t_{k})}{\Delta x^{2}}+\frac{u(x_{i+1},y_{j},t_{k+1})-2u(x_{i},y_{j},t_{k+1})+u(x_{i-1},y_{j},t_{k+1})}{\Delta x^{2}}]

\frac{\partial^{2}u}{\partial y^{2}}|_{(x_{i},y_{j},t_{k+\frac{1}{2}})}\approx \frac{1}{2}[\frac{\partial^{2}u}{\partial y^{2}}|_{(x_{i},y_{j},t_{k})}+\frac{\partial^{2}u}{\partial y^{2}}|_{(x_{i},y_{j},t_{k+1})}]\approx\frac{1}{2}[\frac{u(x_{i},y_{j+1},t_{k})-2u(x_{i},y_{j},t_{k})+u(x_{i},y_{j-1},t_{k})}{\Delta y^{2}}+\frac{u(x_{i},y_{j+1},t_{k+1})-2u(x_{i},y_{j},t_{k+1})+u(x_{i},y_{j-1},t_{k+1})}{\Delta y^{2}}]

将上面三式代入公式(4),用数值解代替精确解并忽略高阶项,可得数值格式为

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/561294
推荐阅读
相关标签
  

闽ICP备14008679号