The Approximation Error of Ordinary Differential Equations Based on the Moved Node Method ()
1. Introduction
There are various approximate analytical methods for solving differential equations. For example, in the works [1] [2] new approaches are presented.
The methods of numerical solution of differential equations are based on the transformation of a differential problem into a difference problem, called approximation. In simple words: to solve differential equations, you need to know the approximation of differential equations. Approximation of a differential equation by a difference—approximation of a differential equation by a system of algebraic equations with respect to the values of the desired functions on some grid. [3] [4]
On the basis of the movable node, an approximate analytical expression for the difference solution of the differential problem [5] was obtained. In [6], the moving nodes method was used to construct the control volume method. In work [5] it is possible to increase the accuracy based on a combination of the moving nodes method with the ideas of Richardson’s extrapolation. Some questions of monotonicity of difference scheme with the help of a movable node are described in [6]. The application of the moving nodes method to some applied problems is reflected in [7].
This paper describes the application of the moving nodes method to the calculation of the approximation error. When a two-point boundary value problem is solved by difference methods, the question of the degree of approximation usually appears. For the closeness of the exact and approximation of the solution, and the quality of the difference scheme are evaluated based on the degree of this parameter. With such an analysis, other parameters (the coefficients of the differential equation) are not explicitly involved in the approximation error expression. Obtaining an explicit expression for the approximation error makes it possible to analyze it.
Consider the simplest ordinary differential equation with boundary conditions
(1)
where C—const.
Create a uniform grid on segments [0, 1] with step h. A uniform grid on a segment
with step h has the form:
Let us replace the second-order derivative by the difference relation:
(2)
Difference scheme (2) traditionally has order
[8]. However, if we solve system (2) by the Tomas algorithm [8] [9], we obtain a numerical solution that coincides with the exact analytical solution for any grid steps h at the grid nodes. So. scheme (2) approximates (1) exactly.
Figure 1 shows graphs of exact and numerical solutions for case
. (The solid line is the exact solution; the circles are the numerical solution obtained using the Thomas algorithm). It can be seen from the figure that, regardless of the choice of grid, the exact and approximate solutions are the same.
Figure 1. Comparison of the exact and numerical solution: on the left, the internal node 1; right 3.
Based on this example, we can conclude that the standard indicator of the proximity of the differential and difference equations
does not reflect complete information. We note an important fact that, regardless of the number of grid steps, the exact and numerical solutions coincide. An attempt is made here to efficiently calculate this error.
2. Methodology
Let we have a differential equation
(3)
where L is a differential operator, f is a known function, and u is an unknown function. (3) the equation is considered in some domain D with appropriate boundary conditions. The differential Equation (3) is replaced by the difference equation:
(4)
where Lh is the difference operator, uh is the unknown grid function, and fh is the approximation of the function f at the grid nodes.
Usually, the approximation error is given as [6] [7]:
(5)
where
is the exact solution of (3) at the grid nodes. Using the Taylor series, from (5) one obtains that,
, where h is the grid step and m is the degree of approximation.
You can determine an explicit approximation error if you use the method of a moving node, which allows you to extend the definition to the entire area D. This allows you to introduce an approximation error like this:
(6)
Here
is a predefined continuous function by means of a moveable node. Approximate calculation of the approximation error of type (6) is demonstrated using simple examples.
3. Results and Discussion
As an application of the above approach, consider examples.
3.1. Simple Boundary Value Problem
Consider a simple boundary value problem:
(7)
Let’s build a non-uniform grid on segments
:
In the non-uniform grid, we replace (7) with the difference problem:
(8)
Here
is the grid solution of the problem. From here
(9)
We redefine the value of the function at non-nodal points as follows. To do this, we consider in (9)
, to be fixed, and
to be moved, and the function
to be smooth. Thus, we will complete the grid function on each segment
. From (9) we get
(10)
Then the approximation error for the nodal points looks like this:
(11)
If the grid is uniform for the approximation error, we obtain the expression
(12)
If on the segments
the function constant approximation error is identically equal to zero and we get the exact solution.
Based on expression (10), the following conclusion can be drawn.
Given a two-point boundary value problem
and
can be represented as
then the difference scheme
gives a grid solution coinciding with the exact solution at the nodal points.
If there is only one internal node point (the node being moved is one), then an approximate analytical solution can be obtained. Indeed, if we rewrite scheme (8) for one moving node, we have
(13)
From here we obtain an approximate analytical solution:
(14)
In this case, (14) represents the exact solution of the problem (7)
if we put
The form of the approximation error (11) allows the construction of new schemes of the collocation type. Indeed, if in problem (8) we replace the right side by the expression
Here A is still an unknown constant. Parameter A is determined so that the approximation error (11) for a uniform step at node
is equal to zero, i.e. collocation type scheme. Then we have
3.2. Convection and Diffusion Equation
Consider a stationary equation in which only convection and diffusion are present without a source.
(15)
with boundary conditions
.
There are various schemes for the difference solution (15) [6] [7]. Based on the moving node technique [1] [2], it is possible to explicitly express local errors in the approximation of differential equations. Using the moving node method [1], we will show the efficient calculation of local approximation errors for the model problem (15).
3.2.1. Scheme with Central-Difference Approximation
Scheme with central-difference approximation of the convective term. Take a segment and any point. Consider the grid analog (15)
(16)
At, we have a central difference approximation. Here, is the approximate value of the solution at the point x.
From (16) we find
(17)
From here we get,
(18)
(19)
If the difference solution at nodal points is known, then formula (17) makes it possible to determine the unknown at points that are not nodal.
Using formulas (18) and (19), the derivatives are restored at any point of the segment. Multiplying (19) by and adding with (18), we obtain
(20)
were
Equation (20) can be called a differential analog of the difference Equation (16); difference Equation (16) is a collocation-type scheme.
Using (19), the approximation error can be written as
Equation (20) takes the form
(21)
Thus, difference Equation (16) exactly approximates differential Equation (21) on the segment
.
Comparison of Equations (15) and (21) shows that when Equation (15) is approximated by scheme (16), scheme diffusion appears with a variable coefficient
.
3.2.2. Upwind Scheme
Let us consider the difference analog of Equation (15), in which the convective term is approximated by the one-sided difference relation
(22)
from here we get
(23)
determine the first and second derivatives:
(24)
(25)
let us calculate the approximation error
The differential analog of scheme (22) has the form
(26)
those. with a scheme against the flow, we have a scheme diffusion with a coefficient
. Based on (23)—is a hyperbola, which is monotone on the segment, i.e. scheme (22) is monotonic.
Based on the form of the differential analogue (26), we can conclude that the differential equation
(27)
is exactly approximated by the scheme
(28)
Those. solving (28) with respect to u, we obtain the exact solution of differential Equation (27).
Example. Consider an equation with boundary conditions.
Here
.
For the solution, we use a scheme with the number of nodal points N = 5. Figure 2 shows a comparison of the exact and numerical solutions on a uniform grid. The solid lines correspond to the exact, and the circles to the numerical.
In the case of a non-uniform grid, we will get the same result: the exact and numerical solutions coincide (Figure 3).
Figure 2. Comparison of the exact and numerical solution: on the left ε = 0.01; right ε = 0.001.
Figure 3. Comparison of exact and numerical solution in non-uniform grid: on the left ε = 0.01; right ε = 0.001.
4. Conclusions
The method of moving nodes allows the calculation of an explicit expression for the approximation error when replacing differential equations with difference schemes.
Based on the method of moving nodes, it is possible to construct a differential analogue of the difference scheme
The differential analogue of the difference scheme in simple cases allows the construction of an exact difference scheme