• No se han encontrado resultados

NO HAY PREGUNTAS ESTÚPIDAS

MATERIALES DE APOYO

NO HAY PREGUNTAS ESTÚPIDAS

Let us consider again the Cauchy problem (2.1)–(2.2). In order to introduce the Runge–Kutta methods, first of all we define a one-step method of second order accuracy, which is different from the trapezoidal method.

Let us define the first terms of the Taylor series of the function u(t) in the form (2.6) at the point t = t?+ h. Then

u(t?+ h) = u(t?) + hu0(t?) + h

2

2!u

00

(t?) + O(h3). (2.103) Using the derivatives (2.4), and introducing the notations

f = f (t?, u(t?)), ∂if = ∂if (t?, u(t?)), ∂ijf = ∂ijf (t?, u(t?)), etc.,

the equation (2.103) can be rewritten as u(t?+ h) =u(t?) + hf +h 2 2!(∂1f + f ∂2f ) + O(h 3) =u(t?) + h 2f + h 2[f + h∂1f + hf ∂2f ] + O(h 3). (2.104)

Since 12

f (t?+ h, u(t?) + hf (t?, u(t?)) = f + h∂1f + hf ∂2f + O(h2), (2.105)

therefore (2.104) can be written in the form u(t? + h) = u(t?) + h

2f + h 2(f (t

?

+ h, u(t?) + hf (t?, u(t?))) + O(h3). (2.106) Therefore, applying the formula (2.106) at some arbitrary mesh-point ti = t?

of ωh, we can define the following one-step, explicit numerical method:

yi+1= yi+

h

2f (ti, yi) + h

2f (ti+1, yi+ hf (ti, yi)). (2.107) Let us introduce the notations

k1 = f (ti, yi); k2 = f (ti+1, yi+ hf (ti, yi)) = f (ti + h, yi+ hk1). (2.108)

Then the method (2.107) can be written in the form yi+1 = yi+

h

2(k1+ k2). (2.109) Definition 2.4.1. The one-step, explicit numerical method (2.108)-(2.109) is called Heun method13.

Remark 2.4.1. Based on (2.106), we have u(t?+ h) − u(t?) −h

2f − h 2(f (t

?+ h, u(t?) + hf (t?, u(t?))) = O(h3). (2.110)

This means that the exact solution of the Cauchy problem (2.1)-(2.2) satisfies the formula of the Heun method (2.107) with the accuracy O(h3), which means

that the Heun method is of second order.

Some further details of the Heun method can be found under the link http://math.fullerton.edu/mathews/n2003/Heun’sMethodMod.html Here one can also see an animation for the behavior of the numerical solution, obtained by the Heun method, for the differential equation u0 = 1 − t√3u.

12We recall that the first order Taylor polynomial of the function f : Q

T → R around

the point (t, u) , for arbitrary constants c1, c2 ∈ R can be written as f(t + c1h, u + c2h) =

f (t, u) + c1h∂1f (t, u) + c2h∂2f (t, u) + O(h2).

13The method is named after Karl L. W. M. Heun (1859–1929), who was a German

Let us define other one-step methods of second order accuracy. Obviously, the parameterized form of the Heun method (2.106) is the following:

u(t?+h) = u(t?)+σ1hf (t?, u(t?))+σ2hf (t?+a2h, u(t?)+b21hf (t?, u(t?)))+O(h3),

(2.111) where σ1, σ2, a2 and b21 are some free parameters. Let us write the equation

(2.111) at the point t = ti. This generates the one-step numerical method of

the form

yi+1 = yi+ σ1hf (ti, yi) + σ2hf (ti+ a2h, yi+ b21hf (ti, yi)). (2.112)

Remark 2.4.2. It is subservient to write the parameters of the method (2.112) in the following form:

0 a2 b21

σ1 σ2

(2.113) For more explanation we refer to the Definition 2.4.6.

By developing the right side of (2.111) into Taylor series , we obtain the equality u(t?+ h) =u(t?) + σ1hf + σ2h[f + a2h∂1f + b21hf ∂2f ] + O(h3)

=u(t?) + (σ1+ σ2)hf + h2[a2σ2∂1f + σ2b21f ∂2f ] + O(h3).

(2.114) Let us use Remark 2.4.1, with comparing the formulas (2.104) and (2.114). Then we conclude that the numerical method, defined by (2.112) has second order accuracy if and only if

σ1 + σ2 = 1

a2σ2 = 0.5

b21σ2 = 0.5.

(2.115)

Rewriting the formulas (2.112), our results can be summarized as follows. Theorem 2.4.2. Let the parameters σ1, σ2, a2 and b21 be solution of the equa-

tion (2.115). Then the explicit, one-step method

k1 = f (ti, yi), k2 = f (ti+ a2h, yi+ hb21k1), (2.116)

yi+1= yi+ h(σ1k1+ σ2k2) (2.117)

Definition 2.4.3. The numerical method (2.116)-(2.117) under the condition (2.115) is called second order Runge–Kutta method and it is denoted by RK2. Let us examine the system of algebraic equations (2.115), which defines the RK2 method. For the four unknowns we have only three equations, therefore the solution is not unique. One can easily see that for any free parameter σ 6= 0 the solution of the system is

σ2 = σ, σ1 = 1 − σ, a2 = b21 = 1/2σ. (2.118)

Hence, the RK2 methods form a one-parameter family, and the parameters of the method have the form (using the representation (2.113))

0

1/2σ 1/2σ 1 − σ σ

(2.119) Remark 2.4.3. The RK2 method, corresponding to the choice σ = 0.5 is the Heun method. The choice σ = 1 is interesting. For this case σ1 = 0, σ2 = 1

and a2 = b21= 0.5, and these parameters imply the following method:

k1 = f (ti, yi), k2 = f (ti+ 0.5h, yi+ 0.5hk1), yi+1= yi+ hk2. (2.120)

Definition 2.4.4. The second order numerical method of the form (2.120) is called modified Euler method.143

We note that the Heun method and the modified Euler method can be also introduced by some modification of the simplest Euler methods, investigated before. Namely,

• when in the formula of the trapezoidal method (2.68) yi+1− yi =

hi

2 [f (ti, yi) + f (ti+1, yi+1)]

in the implicit part f (ti+1, yi+1) we replace yi+1 by its approximation,

obtained by the explicit Euler method, ˜yi+1= yi+ hf (ti, yi), then we get

the Heun method.

• For the modified Euler method, at the midpoint t = ti+ 0.5h = ti+0.5

of the interval [ti, ti+1] we define an approximation to the exact solution

u(t) by the explicit Euler method, i.e., we define the value ˜yi+0.5 = yi +

0.5hf (ti, yi). Then, using this value for the approximation on the interval

[ti, ti+1] we take another explicit Euler step on the whole interval.

The value of the parameters of the above second order methods in the form of table (2.119) are the following. For the Heun method it has the form

0 1 1

0.5 0.5

(2.121) while for the modified Euler method we have

0 0.5 0.5

0 1

(2.122) Remark 2.4.4. Is there a special choice for the arbitrary parameter σ such that the RK2 method is not only of second order but of third order? The answer to this question is negative, which can be seen from the following example. In the Cauchy problem (2.1)-(2.2) we put f (t, u) = u. Hence, for the solution the relation u0(t) = u(t) holds. Differentiating this equality, we obtain u00(t) = u0(t). Hence u00(t) = u0(t) = u(t). On the other hand, due to the choice of function f , we have f (ti, yi) = yi. Therefore, the method (2.112) applied to

this problem yields the following:

yi+1= yi+ σ1hyi+ σ2h(yi+ b21hf (ti, yi)) = yi+ σ1hyi+ σ2h(yi + b21hyi)

= yi+ hyi[σ1 + σ2+ hσ2b21] = yi[1 + (σ1+ σ2)h + σ2b21h2].

(2.123) Substituting the values (2.118) (which are necessary for the second order ac- curacy), the RK2 method for this problem reads as

yi+1= yi(1 + h +

h2

2 ). (2.124)

We can observe that this method is independent of the parameter σ. We substitute the exact solution u(t) into the formula (2.124), i.e., we define the local approximation error. Then

gi = u(ti+1) − u(ti)(1 + h +

h2

2 ). (2.125) When we develop u(ti+1) into Taylor series around the point t = ti, due to the

relations u00(ti) = u0(ti) = u(ti), it has the form u(ti+1) = u(ti)(1 + h + h2/2) +

O(h3). This means that g

i = O(h3) for any choice of the parameter σ, i.e., the

Documento similar