21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example 12.3.5 (Linearization of increment equations).<br />

Initial value problem for logistic ODE, see Ex. 11.1.1<br />

Implicit Euler method (11.2.4) with uniform<br />

timestep h = 1/n,<br />

n ∈ {5, 8, 11, 17, 25, 38, 57, 85, 128, 192, 288,<br />

, 432, 649, 973, 1460, 2189, 3284, 4926, 7389}.<br />

& approximate computation of y k+1 by<br />

1 Newton step with initial guess y k<br />

ẏ = λy(1 − y) , y(0) = 0.1 , λ = 5 .<br />

error<br />

10 −1<br />

10 −2<br />

10 −3<br />

Logistic ODE, y 0<br />

= 0.100000, λ = 5.000000<br />

Class of semi-implicit (linearly implicit) Runge-Kutta methods (Rosenbrock-Wanner (ROW)<br />

methods):<br />

∑i−1<br />

∑i−1<br />

(I − ha ii J)k i =f(y 0 + h (a ij + d ij )k j ) − hJ d ij k j , (12.3.10)<br />

j=1<br />

j=1<br />

J := Df ( ∑i−1<br />

)<br />

y 0 + h (a ij + d ij )k j , (12.3.11)<br />

y 1 :=y 0 +<br />

j=1<br />

s∑<br />

b j k j . (12.3.12)<br />

j=1<br />

Remark 12.3.6 (Adaptive integrator for stiff problems in MATLAB).<br />

10 0 h<br />

= semi-implicit Euler method<br />

Measured error err = max<br />

j=1,...,n |y j − y(t j )|<br />

From (11.2.4) with timestep h > 0<br />

10 −4<br />

implicit Euler<br />

semi−implicit Euler<br />

O(h)<br />

10 −5<br />

10 −4 10 −3 10 −2 10 −1 10 0<br />

Fig. 170<br />

y k+1 = y k + hf(y k+1 ) ⇔ F(y k+1 ) := y k+1 − hf(y k+1 ) − y k<br />

Ôº¿¿ ½¾º¿<br />

= 0 .<br />

Handle of type @(t,y) J(t,y) to Jacobian Df : I × D ↦→ R d,d<br />

opts = odeset(’abstol’,atol,’reltol’,rtol,’Jacobian’,J)<br />

[t,y] = ode23s(odefun,tspan,y0,opts);<br />

Stepsize control according to policy of Sect. 11.5:<br />

Ôº¿ ½¾º¿<br />

One Newton step applied to F(y) = 0 with initial guess y k yields<br />

y k+1 = y k − Df(y k ) −1 F(y k ) = y k + (I − hDf(y k )) −1 hf(y k ) .<br />

Note: for linear ODE with f(y) = Ay, A ∈ R d,d , we recover the original implicit Euler method!<br />

Observation: Approximate evaluation of defining equation for y k+1 preserves 1st order convergence.<br />

Ψ ˆ= RK-method of order 2 ˜Ψ ˆ= RK-method of order 3<br />

ode23s<br />

integrator for stiff IVP<br />

△<br />

✸<br />

12.4 Differential-algebraic equations<br />

✗<br />

✖<br />

?Idea:<br />

Use linearized increment equations for implicit RK-SSM<br />

⎛ ⎞<br />

s∑<br />

k i = f(y 0 ) + hDf(y 0 ) ⎝ a ij k j<br />

⎠ , i = 1,...,s . (12.3.9)<br />

Linearization does nothing for linear ODEs ➢ stability function (→ Thm. 12.3.2) not affected!<br />

j=1<br />

✔<br />

✕<br />

Ôº¿ ½¾º¿<br />

Ôº¿ ½¾º

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!