Crank-Nicolson method

from Wikipedia, the free encyclopedia

In numerical mathematics, the Crank-Nicolson method is a finite difference method for solving the heat conduction equation and similar partial differential equations . It is an implicit procedure of the 2nd order and numerically stable . The process was developed by John Crank and Phyllis Nicolson in the middle of the 20th century .

For the heat conduction equation and many other equations it can be shown that the Crank-Nicolson method is numerically stable without conditions. Nevertheless, the approximated solutions can contain disruptive oscillations if the quotient of the time difference and the distance square is large (typically greater than ). In this case, the less precise Euler backward method is often used, which is numerically stable and insensitive to interference.

The procedure

Difference star (
stencil ) for the Crank – Nicolson method in the 1D problem. j is the place and n is the time.

The Crank-Nicolson method is based on the trapezoid rule in time. This is equivalent to the mean value of the Euler forward method and the Euler backward method .

Is the partial differential equation in the one-dimensional case

given and denote , then the Crank-Nicolson method is the mean value of the Euler forward method for value and the Euler backward method for :

The indices and stand for the place or time. The function must be spatially discretized, e.g. B. with the finite difference method , the finite volume method or the finite element method .

It should be noted that this is an implicit method. In order to get the temporally "closest" value of , an algebraic system of equations has to be solved. If the partial differential equation is not linear, the discretization will also not be linear, so that a non-linear algebraic system of equations must be solved, although linearizations are possible. With many problems, especially with linear diffusion, the algebraic problem is tridiagonal and is best solved with the fast Thomas algorithm in order to avoid a complex inversion of the matrix.

Example: One-dimensional diffusion

The Crank-Nicolson method is often used to solve diffusion problems. An example of linear diffusion is

.

Using the finite difference method for the spatial discretization of the right side, the Crank – Nicolson discretization is then:

or, be :

this is a tridiagonal problem, so that it should be solved with the Thomas algorithm in order to avoid a complex inversion of the resulting tridiagonal Toeplitz matrix .

A quasi-linear equation like (this is a simplified example and not generally applicable)

would lead to a non-linear system of algebraic equations that are not as easy to solve as above. However, in some cases it is possible to linearize the problem using the old value of ; this procedure is also referred to as "lagging the coefficients" . This is taking place . In other cases it may be possible to estimate using an explicit method and maintaining stability.

Alternatively, iterative updating of the coefficients enables the order of the method to be maintained. Here, "Lagging the Coefficients" applied in a first step to solve the system of equations for the next time step. With the new temperatures now known, the coefficients are evaluated and the solution is calculated again. This procedure is continued until the difference between the solutions of two successive iterations is small.

Example: One-dimensional diffusion with advection for stationary flows

This solution is usually used when there is contamination in rivers with steady currents, but information is only given in one dimension. Often times the problem can be simplified into a one-dimensional problem and still yield useful information.

In the following, a dissolved foreign body is modeled in water. This problem is composed of three parts: the well-known diffusion equation (chosen as a constant ), an advective component (the system develops as a result of a vector field in space), which is chosen as a constant , and a lateral superposition between longitudinal channels ( )

where the concentration of the foreign body is in the water and the indices and correspond to the previous and the next channel.

The Crank-Nicolson method (where stands for place and time) transforms each component of the partial differential equation as follows:

The following constants are defined to simplify the calculation:

Now 1. to 6. ,, and are inserted in (*). Then the “future” terms ( ) are moved to the left and the “current” ( ) to the right. It turns out

In order to model the first channel, it is stated that it can only be in contact with the following channel ( M ), so that the expression is simplified to

The last channel is modeled in the same way. It is stated that it can only be in contact with the previous channel ( N ), so the expression becomes too simplified

To solve this system of linear equations, boundary conditions must be given at the beginning of the channels:

: Initial value for the current channel
: Initial value for the channel of the next time interval
: Initial value for the previous channel of the current time interval
: Start value for the following channel of the current time interval

For the last cell of the channels ( ) the most favorable condition becomes adiabatic, that is

This condition is fulfilled if (and only then (apart from the value 0))

We now want to solve the problem (in matrix form) for the case with three channels and five nodes (including the initial value conditions). Expressed as a linear problem:

in which

It is stated that AA and BB should be fields with four different field components (as a reminder, only three channels have been considered for this example, but it still covers most of the above):

 

where the elements mentioned above correspond to the next fields and an additional 4 × 4 zero matrix . It should be noted that AA and BB are each 12 × 12 in size:

The vector is used to keep the boundary conditions. In this example it is a 12 × 1 vector:

To find the concentration at any point in time, the following equation must be solved iteratively:

Example: two-dimensional diffusion

If two dimensions are considered, the derivation is analogous and the results provide a system of band-diagonal rather than tridiagonal equations. The two-dimensional heat conduction equation

can be solved with the Crank-Nicolson discretization

assumed that a rectangular coordinate network is used, so that . This equation can be simplified a little by transforming the term and using the CFL number ,

A low CFL number is not necessary for the stability of the Crank-Nicolson numerical scheme, but it is necessary for numerical accuracy. The scheme can now be represented as

Application in financial mathematics

Because a number of other phenomena can also be modeled with the help of the heat conduction equation ( often called diffusion equation in financial mathematics ), the Crank-Nicolson method is also used in these areas. In particular, the differential equations of the Black-Scholes model can be converted into the diffusion equation and solved using the Crank-Nicolson method. The importance of this comes from the spread of the option price model, which cannot be represented with a self-contained analytical solution; numerical solutions can still offer themselves. However, the Crank-Nicolson method is unsatisfactory in uneven financial conditions (which is common to most financial instruments) because numerical oscillations are not dampened. Therefore special damping initializations are necessary.

Individual evidence

  1. ^ Tuncer Cebeci: Convective Heat Transfer . Springer, 2002, ISBN 0966846141 .
  2. ^ J. Crank, P. Nicolson: A practical method for numerical evaluation of solutions of partial differential equations of the heat-conduction type . In: Springer (Ed.): Advances in Computational Mathematics . 6th vol., No. 1, December 1996, ISSN  1019-7168 , pp. 207-226. doi : 10.1007 / BF02127704 .
  3. Pletcher, Richard H., John C. Tannehill, Dale Anderson: Computational fluid mechanics and heat transfer. CRC Press, 2012.
  4. Wilmott, P .; Howison, S .; Dewynne, J .: The Mathematics of Financial Derivatives: A Student Introduction . Cambridge Univ. Press, 1995, ISBN 0521497892 .

Web links