• Nem Talált Eredményt

2.2 Some simple one-step methods

2.2.1 Explicit Euler method

Let us consider the θ-method with the choice θ= 0. Then the formulas (2.24) and (2.25) result in the following method:

yi+1 =yi+hif(ti, yi), i= 0,1, . . . , N −1. (2.26) Since yi is the approximation of the unknown solution u(t) at the point t=ti, therefore

y0 =u(0) =u0, (2.27)

i.e., in the iteration (2.26) the starting value y0, corresponding to i = 0, is given.

Definition 2.2.4. The one-step method (2.26)–(2.27) is called explicit Euler method.7 (Alternatively, it is also called forward Euler method.)

In case θ = 0 we have α = u0(ti), therefore the polynomial P1 (which defines the method) coincides with the first order Taylor polynomial. Therefore the explicit Euler method is the same as the local Taylor method of the first order, defined in (2.11).

Remark 2.2.2. The method (2.26)–(2.27) is called explicit, because the ap-proximation at the point ti+1 is defined directly from the approximation, given at the point ti.

We can characterize the explicit Euler method (2.26)–(2.27) on the following example, which gives a good insight of the method.

Example 2.2.5. The simplest initial value problem is

u0 =u, u(0) = 1, (2.28)

whose solution is, of course, the exponential function u(t) =et.

7Leonhard Euler (1707–1783) was a pioneering Swiss mathematician and physicist. He made important discoveries in fields as diverse as infinitesimal calculus and graph theory.

He introduced much of the modern mathematical terminology and notation, particularly for mathematical analysis, such as the notion of a mathematical function. He is also renowned for his work in mechanics, fluid dynamics, optics, and astronomy. Euler spent most of his adult life in St. Petersburg, Russia, and in Berlin, Prussia. He is considered to be the preeminent mathematician of the 18th century, and one of the greatest of all time. He is also one of the most prolific mathematicians ever; his collected works fill between 60 and 80 quarto volumes. A statement attributed to Pierre-Simon Laplace expresses Euler’s influence on mathematics: ”Read Euler, read Euler, he is the master of us all.”

Since for this problem f(t, u) =u, the explicit Euler method with a fixed step size h >0 takes the form

yi+1 =yi+hyi = (1 +h)yi.

This is a linear iterative equation, and hence it is easy to get yi = (1 +h)iu0 = (1 +h)i.

Then this is the proposed approximation to the solutionu(ti) = eti at the mesh point ti =ih. Therefore, when using the Euler scheme to solve the differential equation, we are effectively approximating the exponential by a power function

eti =eih ≈(1 +h)i.

When we use simply t? to indicate the fixed mesh-point ti =ih, we recover, in the limit, a well-known calculus formula:

et? = lim

h→0(1 +h)t?/h= lim

i→∞(1 +t?/h)i.

A reader familiar with the computation of compound interest will recognize this particular approximation. As the time interval of compounding,h, gets smaller and smaller, the amount in the savings account approaches an exponential.

In Remark 2.2.1 we listed the sources of the error of a numerical method.

A basic question is the following: by refining the mesh what is the behavior of the numerical solution at some fixed point t? ∈ [0, T]? More precisely, we wonder whether by increasing the step-size of the mesh to zero the difference of the numerical solution and the exact solution tends to zero. In the sequel, we consider this question for the explicit Euler method. (As before, we assume that the function f satisfies a Lipschitz condition in its second variable, and the solution is sufficiently smooth.)

First we analyze the question on a sequence of refined uniform meshes. Let ωh :={ti =ih; i= 0,1, . . . , N; h=T /N}

(h→0) be given meshes and assume thatt? ∈[0, T] is such a fixed point which belongs to each mesh. Let n denote on a fixed mesh ωh the index for which nh =t?. (Clearly, n depends on h, and in case h →0 the value of n tends to infinity.) We introduce the notation

ei =yi−u(ti), i= 0,1, . . . , N (2.29)

for the global error at some mesh-point ti. In the sequel we analyze en by decreasingh, i.e., we analyze the difference between the exact and the numerical solution at the fixed pointt? forh→0.8 From the definition of the global error (2.29) obviously we have yi =ei +u(ti). Substituting this expression into the formula of the explicit Euler method of the form (2.26), we get the relation

ei+1−ei =−(u(ti+1)−u(ti)) +hf(ti, ei+u(ti))

= [hf(ti, u(ti))−(u(ti+1)−u(ti))]

+h[f(ti, ei+u(ti))−f(ti, u(ti))].

(2.30)

Let us introduce the notations

gi =hf(ti, u(ti))−(u(ti+1)−u(ti)),

ψi =f(ti, ei+u(ti))−f(ti, u(ti)). (2.31) Hence we get the relation

ei+1−ei =gi+hψi, (2.32) which is called error equation of the explicit Euler method.

Remark 2.2.3. Let us briefly analyze the two expressions in the notations (2.31). The expression gi shows how exactly the solution of the differential equation satisfies the formula of the explicit Euler method (2.26), written in the formhf(ti, yi)−(yi+1−yi) = 0. This term is present due to the replacement of the solution function u(t) on the interval [ti, ti+1] by the first order Taylor polynomial. The second expressionψi characterizes the magnitude of the error, arising in the formula of the method for the computationyi+1, when we replace the exact (and unknown) value u(ti) by its approximationyi.

Due to the Lipschitz property, we have

i|=|f(ti, ei+u(ti))−f(ti, u(ti))| ≤L|(ei+u(ti))−u(ti)|=L|ei|. (2.33) Hence, based on (2.32) and (2.33), we get

|ei+1| ≤ |ei|+|gi|+h|ψi| ≤(1 +hL)|ei|+|gi| (2.34)

8Intuitively it is clear that the condition t? ωh for any h > 0 can be relaxed: it is enough to assume that the sequence of mesh-points (tn) is convergent to the fixed pointt?, i.e., the condition limh→0(t?tn) = 0 holds.

for any i = 0,1, . . . , n−1. Using this relation, we can write the following estimation for the global error en:

|en| ≤(1 +hL)|en−1|+|gn−1| ≤(1 +hL) [(1 +hL)|en−2|+|gn−2|] +|gn−1|

Let us give an estimation for |gi|. One can easily see that the equality u(ti+1)−u(ti) = u(ti+h)−u(ti) =hu0(ti) + 1

2u00i)h2 (2.37) is true, where ξi ∈ (ti, ti+1) is some fixed point. Since f(ti, u(ti)) = u0(ti), therefore, according to the definition of gi in (2.31), the inequality

|gi| ≤ M2

2 h2, M2 = max

[0,t?]|u00(t)| (2.38) holds. Using the estimations (2.36) and (2.38), we get

|en| ≤exp(Lt?)

The convergence of the explicit Euler method on some suitably chosen, non-uniform mesh can be shown, too. Further we will show it. Let us consider the sequence of refined meshes

ωhv :={0 = t0 < t1 < . . . < tN−1 < tN =T}.

We use the notations hi = ti+1 −ti, i = 0,1, . . . , N − 1 and h = T /N. In the sequel we assume that with increasing the number of mesh-points the grid becomes finer everywhere, i.e., there exists a constant 0< c <∞ such that

hi ≤ch, i= 1,2, . . . , N (2.41) for any N. We assume again that the fixed point t? ∈ [0, T] is an element of each mesh. As before, on some fixed mesh n denotes the index for which h0+h1 +. . .+hn−1 =t?.

Using the notations

gi =hif(ti, u(ti))−(u(ti+1)−u(ti)),

ψi =f(ti, ei +u(ti))−f(ti, u(ti)) (2.42) the estimation (2.34) can be rewritten as follows:

|ei+1| ≤ |ei|+|gi|+hii| ≤ |ei|+|gi|+hiL|ei| ≤

(1 +hiL)|ei|+|gi| ≤exp(hiL)|ei|+|gi| ≤exp(hiL) [|ei|+|gi|]. (2.43) Then the estimation (2.35), taking into account (2.43), results in the relation

|en| ≤exp(hn−1L) [|en−1|+|gn−1|]

the relations (2.44) and (2.45) together imply the estimation

|en| ≤exp(t?L) The estimation (2.46) shows that on a sequence of suitably refined meshes by h →0 we have en→0, and moreover, en =O(h).

This proves the following statement.

Theorem 2.2.6. The explicit Euler method is convergent, and the rate of con-vergence is one.9

Remark 2.2.4. We can see that for the explicit Euler method the choicey0 = u0 is not necessary to obtain the convergence, i.e., the relation limh→0en = 0.

Obviously, it is enough to require only the relation y0 = u0 +O(h), since in this case e0 = O(h). (By this choice the rate of the convergence en = O(h) still remains true.)