Explicit and implicit methods

Explicit and implicit methods are approaches used in numerical analysis for obtaining numerical approximations to the solutions of time-dependent ordinary and partial differential equations, as is required in computer simulations of physical processes. Explicit methods calculate the state of a system at a later time from the state of the system at the current time, while implicit methods find a solution by solving an equation involving both the current state of the system and the later one. Mathematically, if Y(t){\displaystyle Y(t)} is the current system state and Y(t+Δt){\displaystyle Y(t+\Delta t)} is the state at the later time (Δt{\displaystyle \Delta t} is a small time step), then, for an explicit method

Y(t+Δt)=F(Y(t)){\displaystyle Y(t+\Delta t)=F(Y(t))\,}

while for an implicit method one solves an equation

G(Y(t),Y(t+Δt))=0(1){\displaystyle G{\Big (}Y(t),Y(t+\Delta t){\Big )}=0\qquad (1)\,}

to find Y(t+Δt).{\displaystyle Y(t+\Delta t).}

Computation

Implicit methods require an extra computation (solving the above equation), and they can be much harder to implement. Implicit methods are used because many problems arising in practice are stiff, for which the use of an explicit method requires impractically small time steps Δt{\displaystyle \Delta t} to keep the error in the result bounded (see numerical stability). For such problems, to achieve given accuracy, it takes much less computational time to use an implicit method with larger time steps, even taking into account that one needs to solve an equation of the form (1) at each time step. That said, whether one should use an explicit or implicit method depends upon the problem to be solved.

Since the implicit method cannot be carried out for each kind of differential operator, it is sometimes advisable to make use of the so called operator splitting method, which means that the differential operator is rewritten as the sum of two complementary operators

Y(t+Δt)=F(Y(t+Δt))+G(Y(t)),{\displaystyle Y(t+\Delta t)=F(Y(t+\Delta t))+G(Y(t)),\,}

while one is treated explicitly and the other implicitly. For usual applications the implicit term is chosen to be linear while the explicit term can be nonlinear. This combination of the former method is called Implicit-Explicit Method (short IMEX,[1][2][3]).

Illustration using the forward and backward Euler methods

Consider the ordinary differential equation

dydt=y2, t[0,a](2){\displaystyle {\frac {dy}{dt}}=-y^{2},\ t\in [0,a]\quad \quad (2)}

with the initial condition y(0)=1.{\displaystyle y(0)=1.} This problem has the exact solution y=1t+1{\displaystyle y={\frac {1}{t+1}}}, which usually cannot be written down for problems encountered in practice, but in this case allows a comparison with the numerical solutions. Consider a grid tk=akn{\displaystyle t_{k}=a{\frac {k}{n}}} for 0  k  n, that is, the time step is Δt=a/n,{\displaystyle \Delta t=a/n,} and denote yk=y(tk){\displaystyle y_{k}=y(t_{k})} for each k{\displaystyle k}. قم بتقسيم هذه المعادلة باستخدام أبسط الطرق الصريحة والضمنية، وهي طرق أويلر الأمامية والخلفية (انظر المعادلات التفاضلية العادية العددية ) وقارن المخططات التي تم الحصول عليها.

طريقة أويلر الأمامية
نتيجة تطبيق طرق التكامل المختلفة على المعادلة التفاضلية العادية:y=-y2،ت[0،5]،y0=1{\displaystyle y'=-y^{2},\;t\in [0,5],\;y_{0}=1}معΔت=5/10{\displaystyle \Delta t=5/10}.

طريقة أويلر الأمامية

(دyدت)كyك+1-yكΔت=-yك2{\displaystyle \left({\frac {dy}{dt}}\right)_{k}\approx {\frac {y_{k+1}-y_{k}}{\Delta t}}=-y_{k}^{2}}

العائد

yك+1=yك-Δتyك2(3){\displaystyle y_{k+1}=y_{k}-\Delta ty_{k}^{2}\quad \quad \quad (3)\,}

لكلك=0،1،...،ن.{\displaystyle k=0,1,\dots ,n.}هذه صيغة صريحة لـyك+1{\displaystyle y_{k+1}}.

طريقة أويلر العكسية

باستخدام طريقة أويلر العكسية

yك+1-yكΔت=-yك+12{\displaystyle {\frac {y_{k+1}-y_{k}}{\Delta t}}=-y_{k+1}^{2}}

يجد المرء المعادلة الضمنية

yك+1+Δتyك+12=yك{\displaystyle y_{k+1}+\Delta ty_{k+1}^{2}=y_{k}}

لyك+1{\displaystyle y_{k+1}}(قارن هذا بالصيغة (3) حيثyك+1{\displaystyle y_{k+1}}(تم إعطاؤها بشكل صريح بدلاً من كونها مجهولة في معادلة).

هذه معادلة تربيعية ، لها جذر سالب وجذر موجب . تم اختيار الجذر الموجب لأن الشرط الابتدائي في المعادلة الأصلية موجب، وبالتاليy{\displaystyle y}في الخطوة الزمنية التالية يتم تحديدها بواسطة

yك+1=-1+1+4Δتyك2Δت.(4){\displaystyle y_{k+1}={\frac {-1+{\sqrt {1+4\Delta ty_{k}}}}{2\Delta t}}.\quad \quad (4)}

في أغلب الحالات، تكون المعادلة المراد حلها باستخدام طريقة ضمنية أكثر تعقيدًا بكثير من المعادلة التربيعية، ولا يوجد لها حل تحليلي. عندئذٍ، تُستخدم خوارزميات إيجاد الجذور ، مثل طريقة نيوتن ، لإيجاد الحل العددي.

طريقة كرانك-نيكلسون

باستخدام طريقة كرانك-نيكلسون

yك+1-yكΔت=-12yك+12-12yك2{\displaystyle {\frac {y_{k+1}-y_{k}}{\Delta t}}=-{\frac {1}{2}}y_{k+1}^{2}-{\frac {1}{2}}y_{k}^{2}}

يجد المرء المعادلة الضمنية

yك+1+12Δتyك+12=yك-12Δتyك2{\displaystyle y_{k+1}+{\frac {1}{2}}{\Delta t}y_{k+1}^{2}=y_{k}-{\frac {1}{2}}\Delta ty_{k}^{2}}

لyك+1{\displaystyle y_{k+1}}(قارن هذا بالصيغة (3) حيثyك+1{\displaystyle y_{k+1}}(تم إعطاؤها بشكل صريح بدلاً من كونها مجهولة في معادلة). يمكن حل ذلك عدديًا باستخدام خوارزميات إيجاد الجذور ، مثل طريقة نيوتن ، للحصول علىyك+1{\displaystyle y_{k+1}}.

يمكن اعتبار Crank-Nicolson شكلاً من أشكال مخططات IMEX ( الضمنية - الصريحة ) الأكثر عمومية.

طريقة أويلر الأمامية والخلفية
نتيجة تطبيق كل من طريقة أويلر الأمامية وطريقة أويلر الأمامية-الخلفية لـأ=5{\displaystyle a=5}ون=30{\displaystyle n=30}

لتطبيق مخطط IMEX، ضع في اعتبارك معادلة تفاضلية مختلفة قليلاً:

دyدت=y-y2، ت[0،أ](5){\displaystyle {\frac {dy}{dt}}=yy^{2},\ t\in [0,a]\quad \quad (5)}

ويترتب على ذلك أن

(دyدت)كyك+1-yك2، ت[0،أ]{\displaystyle \left({\frac {dy}{dt}}\right)_{k}\approx y_{k+1}-y_{k}^{2},\ t\in [0,a]}

وبالتالي

yك+1=yك(1-yكΔت)1-Δت(6){\displaystyle y_{k+1}={\frac {y_{k}(1-y_{k}\Delta t)}{1-\Delta t}}\quad \quad (6)}

لكلك=0،1،...،ن.{\displaystyle k=0,1,\dots ,n.}

انظر أيضاً

مصادر

  1. يو إم آشر، إس جيه روث، آر جيه سبيتيري: طرق رونج-كوتا الضمنية والصريحة للمعادلات التفاضلية الجزئية المعتمدة على الزمن ، الرياضيات العددية التطبيقية، المجلد 25 (2-3)، 1997
  2. L.Pareschi, G.Russo: Implicit-Explicit Runge-Kutta schemes for hard systems of differential equations , Recent Trends in Numerical Analysis, Vol. 3, 269-289, 2000
  3. سيباستيانو بوسكارينو، لورينزو باريسكي ، وجيوفاني روسو: طرق ضمنية-صريحة للمعادلات التفاضلية الجزئية التطورية ، SIAM، ISBN 978-1-61197-819-3 (2024).