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)
Y(t+\Deltat)
\Deltat
Y(t+\Deltat)=F(Y(t))
G(Y(t),Y(t+\Deltat))=0 (1)
Y(t+\Deltat).
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
\Deltat
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+\Deltat)=F(Y(t+\Deltat))+G(Y(t)),
Consider the ordinary differential equation
dy | |
dt |
=-y2, t\in[0,a] (2)
with the initial condition
y(0)=1.
t | ||||
|
\Deltat=a/n,
yk=y(tk)
k
\left( | dy |
dt |
\right)k ≈
yk+1-yk | |
\Deltat |
=-
2 | |
y | |
k |
yk+1=yk-\Deltat
2 | |
y | |
k |
(3)
k=0,1,...,n.
yk+1
yk+1-yk | |
\Deltat |
=-
2 | |
y | |
k+1 |
one finds the implicit equation
yk+1+\Deltat
2=y | |
y | |
k |
yk+1
yk+1
This is a quadratic equation, having one negative and one positive root. The positive root is picked because in the original equation the initial condition is positive, and then
y
yk+1=
-1+\sqrt{1+4\Deltatyk | |
In the vast majority of cases, the equation to be solved when using an implicit scheme is much more complicated than a quadratic equation, and no analytical solution exists. Then one uses root-finding algorithms, such as Newton's method, to find the numerical solution.
yk+1-yk | |
\Deltat |
=-
1 | |
2 |
2 | ||
y | - | |
k+1 |
1 | |
2 |
2 | |
y | |
k |
one finds the implicit equation
yk+1+
1 | |
2 |
\Deltat
2=y | |
y | |
k |
-
1 | |
2 |
\Deltat
2 | |
y | |
k |
yk+1
yk+1
yk+1
Crank-Nicolson can be viewed as a form of more general IMEX (Implicit-Explicit) schemes.
dy | |
dt |
=y-y2, t\in[0,a] (5)
\left( | dy |
dt |
\right)k ≈ yk+1
2, | |
-y | |
k |
t\in[0,a]
yk+1=
yk(1-yk\Deltat) | |
1-\Deltat |
(6)
k=0,1,...,n.