§ 6 Numerical solution of ordinary differential equations
1. Numerical solution of the initial value problem of first-order differential equations
require differential equations
_{}
in the initial condition
_{}
The numerical solution below is to be a series of points in the interval where the solution exists
_{}
Starting from the initial value y _{0} , the approximate value is calculated one by one ._{}_{}
[ Improved Euler method (prediction correction method) ] The calculation formula is
_{}
where y _{n} represents the approximate value of y ( x _{n} ) and represents the step size . Here the truncation error is_{}
_{}
In this method, formula (1) uses the broken line method to provide the initial value, which is called the forecast formula . The formula (2) uses the trapezoidal method to give a more accurate value, which is called the correction formula . Collectively, it is called the forecast correction formula .
[ Runge - Kutta method ] calculation formula is
_{}
in the formula
_{}
The truncation error is R=O ( h ^{5} )
^{}
When calculating by hand, proceed from top to bottom according to the table .
_{} |
_{} |
_{} |
k |
x _{0} _{} _{} |
y _{0} _{} _{} |
_{} |
_{} |
[ Adams Method ]
1 ° interpolation formula
_{}
This is an implicit equation for , which can be solved iteratively as long as h is small ._{}
2 ° extrapolation formula
_{}
This is an explicit equation for y _{n}_{ +1 , and }y _{n}_{ +1} can be calculated directly from the formula as long as the values of the first few points are known ._{}_{}
3 ° Forecast Correction Formula
_{}
The truncation error is
R=O ( h ^{5} )
The Adams method can be calculated by the extrapolation formula alone. For each calculation of y _{n}_{ +1 , the value of }f ( x, y ) only needs to be calculated once , and the calculation amount is smaller than that of the Runge - Kutta method, and the truncation error is the same order, so The small amount of calculation is one of the advantages of the extrapolation method . The disadvantage is that the first few y _{i} values cannot be calculated by this method, and other methods (generally the Runge - Kutta method can be used) are required to calculate y _{1} , y _{2} , and y _{3} ._{}_{}_{}_{}
Supplementary explanation In the 1 ° Adams method, the calculation of the value of y _{n}_{ +1} is called the multi-step method . The improved Euler method and Runge - Kutta method only need to use y _{n} , so it is called for the one-step method . _{}_{}_{}_{}
2 ° It is convenient to change the step length in the one-step method, and it is troublesome to change the step length in the multi-step method, because the first few items must be recalculated in the one-step method .
Another advantage of the 3 ° multi-step method is that the truncation error can be estimated by the way .
Use y _{n}_{ +1 }^{( E )} and y _{n}_{ +1 }^{( I )} to denote the values calculated by the extrapolation and interpolation formulas, respectively, there are
_{}
In the formula . If the allowable error specified in the calculation does not exceed ε , then ε and_{}
_{}
For comparison, if , the calculation can be continued, otherwise the error is too large, and the step size should be reduced . If it is much smaller than ε , the step size may be enlarged to improve the calculation speed ._{}_{}
Second, the numerical solution of the initial value problem of the first-order differential equation system
For the sake of simplicity, only the differential equation system with two unknown functions and the differential equation system with multiple unknown functions are discussed, and the calculation formulas are similar .
_{}
and initial conditions
_{}
[ Improved Euler method (prediction correction method) ]
forecast formula
_{}
Correction formula
_{}
[ Runge - Kutta method ] calculation formula is
_{}
in
_{}
Calculate first and then calculate y _{n}_{ +1} , z _{n}_{ +1} ._{}_{}_{}_{}_{}
[ Forecast correction formula for Adams method ]
Forecast value (extrapolation formula)
_{}
Correction value (interpolation formula)
_{}
The computation of the first few y _{j} and z _{j} is the same as the Runge - Kutta method in Section 1 .
3. The boundary value problem
Only the boundary value problems of second-order linear ordinary differential equations are discussed here .
_{}
(1)
[ Difference method ] Divide the interval [ a, b ] into n equal parts, the step size , and the points x _{0} = a , x _{1} = a+h ,
… ,
x _{k} = a+kh ,
… , x _{n} = b are called Node . The differential quotient is replaced by the difference quotient, and the boundary value problem is transformed into the solution of the following system of difference equations .
_{}_{}_{}_{}_{}
_{}
where y _{k} = y ( x _{k} ), p _{k} = p ( x _{k} ), q _{k} = q ( x _{k} ), f _{k} = f ( x _{k} )
( ). _{}The above system of difference equations can be viewed as n + A linear algebraic equation system with unknown quantities y _{0} , y _{1} , y _{2} , … , y _{n} , the number of equations is also n +1 . After sorting and merging similar items, the difference equation system can be rewritten as
_{} ( )_{}
in the formula
_{}
This is a special form of linear algebraic equations , in addition to the elimination method, iterative method, etc. can be used to solve, but also a simpler and more effective method - the chasing method ( see Chapter 4 , § 3).
In applications, boundary conditions of the following form may also be encountered:
_{}
where α _{1} , α _{2} , β _{1} , β _{2} are known constants . At this time, the two equations corresponding to the boundary conditions in the above differential equation system should be replaced by:
_{}
[ Turn into a numerical solution to the initial value problem ] First solve the initial value problem
_{}
The numerical solution y _{0} ( x ) of , and then the corresponding homogeneous equations that satisfy the initial conditions y ( a )=0, y' ( a )=1
_{}
The numerical solution y _{1} ( x ) of . The solution of the original boundary value problem (1) can be expressed as
_{}
Fourth, the small parameter method
When the differential equation contains a parameter ε with a small absolute value, the method of writing the solution as a power series of ε to obtain an approximate analytical solution is called the small parameter method . The initial value problem of ordinary differential equations is briefly introduced below .
Given a system of differential equations
_{}
(1)
Assume that all functions of as t are sufficiently smooth, as functions of as analytic, and can be expanded into a power series of ε at ε = 0_{}_{}
_{}
The coefficients are all analytic functions of x _{1} , … , x _{n} ._{}_{}_{}
given the initial conditions
When t=t _{0} , x _{i} = x _{i} ( ε ) = x _{i}^{ (0)} + ε x _{i}^{ (1)} + …
(2)
So the solution of equation system (1) that satisfies the initial condition (2) exists in a certain region of t and ε , and can be expanded into a power series of ε
_{}
(3)
And any partial sum of (3 ) is the approximate analytical solution of (1) that satisfies (2) . In the specific calculation, it is only necessary to substitute the series (3) into (1) , and convert both sides into the power series of ε shape, and then compare the coefficients .
Example to find the Riccati equation with small parameter ε
_{}
meet the initial conditions
t= 0, x= 0
solution .
De- assign
_{}
Substituting into the above differential equation, we get
_{}
which is
_{}
Let the coefficients of the same power of ε on both sides be equal, we get
_{}
In addition, the initial conditions can be rewritten as
_{}
So it can be listed
_{}
find out
_{}
and
_{}
is the approximate expression being solved (that is, the approximate analytical solution) .