Runge Kutta Method

Lecture



The Runge-Kutta method is used to calculate standard models quite often, since with a small amount of calculations it has the accuracy of the method Ο 4 ( h ).

To build a difference integration scheme, we use the decomposition of the function

Runge Kutta Method

in taylor row:

Runge Kutta Method

Replace the second derivative in this decomposition with the expression

Runge Kutta Method

Where

Runge Kutta Method

Moreover, Δ x is selected from the condition for achieving the highest accuracy of the written expression. For further calculations, we replace the value of “ y with a tilde” by decomposing into a Taylor series:

Runge Kutta Method

For the original equation (1) we construct a computational scheme:

Runge Kutta Method

which we transform to the form:

Runge Kutta Method

We introduce the following notation:

Runge Kutta Method

These symbols allow you to write the previous expression in the form:

Runge Kutta Method

It is obvious that all entered coefficients depend on the value of Δ x and can be determined through the coefficient α , which in this case plays the role of a parameter:

Runge Kutta Method

Finally, the Runge-Kutta scheme takes the form:

Runge Kutta Method

The same scheme in the form of a difference analogue of equation (1):

Runge Kutta Method

When α = 0, we obtain as a special case the already known Euler scheme:

Runge Kutta Method

When α = 1:

Runge Kutta Method

When α = 1, the calculations at the next integration step can be considered as a sequence of the following operations.

  1. An expression that represents the half-step of integration according to the Euler scheme is calculated, that is, an approximate value of the unknown function is determined at the point x k + h / 2:

    Runge Kutta Method

  2. For the same intermediate point is the approximate value of the derivative:

    Runge Kutta Method

  3. The refined value of the function is determined at the end point of the entire step, and according to the Euler scheme with the derivative value calculated at the previous step:

    Runge Kutta Method

Geometric constructions (see Fig. 15.1) show that the solution obtained in this sequence lies “closer” to the true one than that calculated by the Euler scheme, that is, one should expect a higher accuracy of the solution obtained by the Runge-Kutta method. Earlier, we called this scheme the “modified Euler method.”

Runge Kutta Method
Fig. 15.1. Illustration of calculation on a step by the Runge-Kutta method
when the value of the parameter α = 1

Now consider the scheme for α = 0.5 (the geometric interpretation of the result is shown in Fig. 15.2).

Runge Kutta Method

  1. The full step of the Euler method is performed in order to determine the approximate value of the unknown function at the end of the integration segment:

    Runge Kutta Method

  2. For the same point, an approximate value of the derivative is calculated:

    Runge Kutta Method

  3. The average value of the two derivatives determined at the ends of the segment is found:

    Runge Kutta Method

  4. Calculates the value of the desired function at the end point of the entire step of the Euler scheme with the average value of the derivative:

    Runge Kutta Method

Runge Kutta Method
Fig. 15.2. Illustration of calculation on a step by the Runge-Kutta method
at value α = 0.5

Sometimes the resulting expression is called the Euler-Cauchy scheme (method). Geometrically, it is clear that the result obtained in this way must also be “closer” to the true solution than that obtained by the Euler scheme.

Example. Solve the equation d y / d x = - y , y (0) = 1 using the Runge-Kutta method.

Since the right side of the differential equation has the form: f ( x , y ) = - y , the scheme of the method with α = 0.5 is represented as follows:

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Construct a sequence of values ​​of the desired function:

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

...

Runge Kutta Method

The results of the obtained numerical solution for the value of the argument x = 10 with different integration steps are given in Table. 15.1. Three valid significant digits are obtained for step h = 0.01.

Table 15.1.
Results of numerical solution of y n by the Runge-Kutta method of the second
the order of the differential equation y '= - y with the initial condition y (0) = 1
Step size h 0.5 0.25 0.1 0.01 0.001 0.0001
Number of steps n 20 40 100 1000 10,000 100,000
y n · 10 4 0.827181 0.514756 0.462229 0.454076 0.454000 0.453999

Let us estimate the error of approximation of equation (1) by the difference scheme of the Runge-Kutta method. We substitute the exact solution into the difference analog of the original differential equation and calculate the residual:

Runge Kutta Method

Substitute the decomposition of functions

Runge Kutta Method

Runge Kutta Method

in the resulting expression:

Runge Kutta Method

Given equation (1), as well as the expression for the derivative

Runge Kutta Method

finally, we obtain that ψ k = ( h 2 ), that is, the Runge-Kutta method, regardless of the value of the parameter α , has the second order of approximation.

Methods of Runge-Kutta of the third and fourth orders

Let us consider two different Runge-Kutta schemes designed for the numerical solution of ordinary differential equations of the first order and having the third order of approximation:

Runge Kutta Method Runge Kutta Method

And two Runge-Kutta schemes with the fourth approximation order:

Runge Kutta Method Runge Kutta Method

Example. Solve the fourth order Runge – Kutta method by the equation d y / d x = - y , y (0) = 1.

In accordance with the above ratios, we determine the coefficients:

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Construct a sequence of values ​​of the desired function:

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

Runge Kutta Method

...

Runge Kutta Method

The results of the obtained numerical solution for the value of the argument x = 10 for various integration steps are given in Table. 15.2. Three valid significant figures are obtained for step h = 0.25.

Table 15.2.
The results of the numerical solution of y n by the method of Runge-Kutta fourth
the order of the differential equation y '= - y with the initial condition y (0) = 1
Step size h 0.5 0.25 0.1 0.01 0.001 0.0001
Number of steps n 20 40 100 1000 10,000 100,000
y n · 10 4 0.457608 0.454181 0.454003 0.453999 0.453999 0.453999

Comparison of tables 15.1 and 15.2 with solutions of the same problem allows us to conclude that a higher degree of approximation of a differential equation by a differential analog allows to obtain a more accurate solution for a larger step and, therefore, fewer steps, that is, leads to a decrease in the required computer resources .

To date, for a rough calculation, calculations are made by the Euler method, for exact calculations - by the Runge-Kutta method.


Comments

паша
06-10-2020
хороший материал

To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

System modeling

Terms: System modeling