Crank-Nicolson Method

更新时间:2023-08-01 16:12:07 阅读: 评论:0

Crank –Nicolson method
In numerical analysis, the Crank –Nicolson method is a finite difference method ud for numerically solving the heat equation and similar partial differential equations.[1] It is a cond-order method in time, implicit in time, and is numerically stable. The method was developed by John Crank and Phyllis Nicolson in the mid 20th century.[2]
For diffusion equations (and many other equations), it can be shown the Crank –Nicolson method is unconditionally stable.[3] However, the approximate solutions can still contain (decaying) spurious oscillations if the ratio of time step to the square of space step is large (typically larger than 1/2). For this reason, whenever large time steps or high spatial resolution is necessary, the less accurate backward Euler method is often ud, which is both stable and immune to oscillations.The method
The Crank –
Nicolson stencil for a 1D problem.
The Crank –Nicolson method is bad on central difference in
space, and the trapezoidal rule in time, giving cond-order
convergence in time. For example, in one dimension, if the partial
differential equation is
then, letting , the equation for Crank –Nicolson method is the average of that forward Euler method at and that backward Euler method at n  + 1 (note, however, that the method itlf is not simply the
average of tho two methods, as the equation has an implicit dependence on the solution):
事业单位财务规则
The function F must be discretized spatially with a central difference.
Note that this is an implicit method : to get the "next" value of u in time, a system of algebraic equations must be solved. If the partial differential equation is nonlinear, the discretization will also be nonlinear so that advancing in time will involve the solution of a system of nonlinear algebraic equations, though linearizations are possible. In many problems, especially linear diffusion, the algebraic problem is tridiagonal and may be efficiently solved with the tridiagonal matrix algorithm, which gives a fast direct solution as oppod to the usual for a full matrix.
Example: 1D diffusion
The Crank–Nicolson method is often applied to diffusion problems. As an example, for linear diffusion,
关于爱情的成语
who Crank–Nicolson discretization is then:
or, letting :
which is a tridiagonal problem, so that may be efficiently solved by using the tridiagonal matrix algorithm in
favor of a much more costly matrix inversion.
A quasilinear equation, such as (this is a minimalistic example and not general)
would lead to a nonlinear system of algebraic equations which could not be easily solved as above; however, it is
possible in some cas to linearize the problem by using the old value for , that is instead of . Other times, it may be possible to estimate using an explicit method and maintain stability.
Example: 1D diffusion with advection for steady flow, with multiple channel connections
This is a solution usually employed for many purpos when there's a contamination problem in streams or rivers under steady flow conditions but information is given in one dimension only. Often the problem can be simplified into a 1-dimensional problem and still yield uful information.
Here we model the concentration of a solute contaminant in water. This problem is compod of thre
e parts: the known diffusion equation ( chon as constant), an advective component (which means the system is evolving in space due to a velocity field), which we choo to be a constant Ux, and a lateral interaction between longitudinal channels (k).
where C is the concentration of the contaminant and subscripts N and M correspond to previous and next channel. The Crank–Nicolson method (where i reprents position and j time) transforms each component of the PDE into the following:
Now we create the following constants to simplify the algebra:
and substitute <1>, <2>, <3>, <4>, <5>, <6>, α, β and λ into <0>. We then put the new time terms on the left (j + 1) and the prent time terms on the right (j) to get:
To model the first channel, we realize that it can only be in contact with the following channel (M), so the expression is simplified to:
In the same way, to model the last channel, we realize that it can only be in contact with the previous channel (N), so the expression is simplified to:
To solve this linear system of equations we must now e that boundary conditions must be given first to the beginning of the channels:
: initial condition for the channel at prent time step
颐和园英文
: initial condition for the channel at next time step
: initial condition for the previous channel to the one analyzed at prent time step
最新公积金贷款利率: initial condition for the next channel to the one analyzed at prent time step
For the last cell of the channels (z) the most convenient condition becomes an adiabatic one, so
This condition is satisfied if and only if (regardless of a null value)
Let us solve this problem (in a matrix form) for the ca of 3 channels and 5 nodes (including the initial boundary condition). We express this as a linear system problem:
吸烟的危害
where
Now we must realize that AA and BB should be arrays made of four different subarrays (remember that only three channels are considered for this example but it covers the main part discusd above).
and
where the elements mentioned above correspond to the next arrays and an additional 4x4 full of zeros. Plea note that the sizes of AA and BB are 12x12:
,
,
enter键在哪
,
&
The d vector here is ud to hold the boundary conditions. In this example it is a 12x1 vector:
To find the concentration at any time, one must iterate the following equation:
Example: 2D diffusion
When extending into two dimensions on a uniform Cartesian grid, the derivation is similar and the results may lead
to a system of band-diagonal equations rather than tridiagonal ones. The two-dimensional heat equation
can be solved with the Crank–Nicolson discretization of
工程管理
assuming that a square grid is ud so that . This equation can be simplified somewhat by rearranging
terms and using the CFL number
牛奶炖鸡蛋For the Crank–Nicolson numerical scheme, a low CFL number is not required for stability, however it is required for
numerical accuracy. We can now write the scheme as:
Application in financial mathematics
Further information: Finite difference methods for option pricing
Becau a number of other phenomena can be modeled with the heat equation (often called the diffusion equation in financial mathematics), the Crank–Nicolson method has been applied to tho areas as well.[4] Particularly, the Black-Scholes option pricing model's differential equation can be transformed into the heat equation, and thus numerical solutions for option pricing can be obtained with the Crank–Nicolson method.
The importance of this for finance, is that option pricing problems, when extended beyond the standard assumptions (e.g. incorporating changing dividends), cannot be solved in clod form, but can be solved using this method. Note however, that for non-smooth final conditions (which happen for most financial instruments), the Crank–Nicolson
method is not satisfactory as numerical oscillations are not damped. For vanilla options, this results in oscillation in

本文发布于:2023-08-01 16:12:07,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1125870.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:财务   贷款   爱情   吸烟   管理   鸡蛋   规则   利率
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图