Sie sind auf Seite 1von 5

Numerical Analysis

Numerical methods for solving differential equations


Modified Euler Lecture 2

Modified Euler (predictor-corrector)

y *r + 1 = yr + h[f(xr , yr )]

h
yr + 1 = yr + 2
[f(xr , yr ) + f(xr + 1 , y*r + 1)] and xr + 1 = xr + h
Starting with y0 to find y1

y *1 = y0 + h[f(x0 , y0 )]

h
y1 = y0 + 2
[f(x0 , y0 ) + f(x1 , y*1)] and x1 = x0 + h

dy
1. dx
= 1 + xy

You will have to be given a start point on the curve


In this case:

x0 = 0 , and y0 = 1

x = 0 (0.1) 0.5 This means from x = 0 to 0.5 in steps of 0.1

The value in brackets is the step value, h

x0 = 0 , and y0 = 1.0, h = 0.1

y *1 = y0 + h[f(x0 , y0 )]

h
y1 = y0 + 2
[f(x0 , y0 ) + f(x1 , y*1)] and x1 = x0 + h

y *1 = 1 + 0.1[f(0,1]

y *1 = 1 + 0.1[1 + 1 × 0] = 1.1

h
y1 = y0 + 2
[f(x0 , y0 ) + f(x1 , y*1)] and x1 = x0 + h

Mjbs/NumericalAnalysisD2 /EulerLec2 1
Numerical Analysis
Numerical methods for solving differential equations
Modified Euler Lecture 2

h
y1 = y0 + 2
[f(0,1) + f(0.1,1.1)]

Where x1 = x0 + h = 0 + 0.1 = 0.1

0.1
y1 = 1 + 2
[(1 + 1 × 0) + (1 + 0.1×1.1)]

0.1
y1 = 1 + 2
[(1) + (1.11)]

y1 = 1 + 0.05[(2.11)] = 1.1055

---------------------------------------------------------------------------------

y *2 = y1 + h[f(x1 , y1 )]

h
y2 = y1 + 2
[f(x1 , y1 ) + f(x2 , y*2)] and x2 = x1 + h

y *2 = 1.1055 + 0.1[f(0.1,1.1055]

y *2 = 1.1055 + 0.1[1 + 0.1 × 1.1055] = 1.1

= 1.1055 + 0.1[1.11055] = 1.216555

h
y2 = y1 + 2
[f(x1 , y1 ) + f(x2 , y*2)]

h
y2 = y1 + 2
[f(0.1,1.1055) + f(0.2,1.216555)]

Where x2 = x1 + h = 0.1 + 0.1 = 0.2

0.1
y2 = 1.1055 + 2
[(1 + 0.1 × 1.1055) + (1 + 0.2×1.216555)]

Mjbs/NumericalAnalysisD2 /EulerLec2 2
Numerical Analysis
Numerical methods for solving differential equations
Modified Euler Lecture 2
0.1
y2 = 1.1055 + 2
[(1.11055) + (1.243311)]

y2 = 1.1055 + 0.05[(2.353861)] = 1.22319305

---------------------------------------------------------------------------------

y *3 = y2 + h[f(x2 , y2 )]

h
y3 = y2 + 2
[f(x2 , y2 ) + f(x2 , y*2)] and x2 = x1 + h

y *3 = 1.223193 + 0.1[f(0.2,1.223193]

y *3 = 1.223193 + 0.1[1 + 0.2 × 1.223193]

= 1.223193 + 0.1[1.2446386] = 1.34765686

h
y3 = y2 + 2
[f(x2 , y2 ) + f(x3 , y*3)]

h
y3 = y2 + 2
[f(0.2,1.223193) + f(0.3,1.34765686)]

Where x3 = x2 + h = 0.2 + 0.1 = 0.3

0.1
y3 = 1.223193 + 2
[(1 + 0.2 × 1.223193) + (1 + 0.3×1.34765686)]

0.1
y3 = 1.223193 + 2
[(1.2446386) + (1.404297058)]

y3 = 1.223193 + 0.05[(2.648935658)] = 1.355639783


--------------------------------------------------------------------------------

y *4 = y1 + h[f(x3 , y3 )]

h
y4 = y3 + 2
[f(x3 , y3 ) + f(x4 , y*3)] and x3 = x2 + h

Mjbs/NumericalAnalysisD2 /EulerLec2 3
Numerical Analysis
Numerical methods for solving differential equations
Modified Euler Lecture 2

y *4 = 1.505900559+ 0.1[f(0.3,1.355639783]

y *4 = 1.505900559+ 0.1[1 + 0.3 × 1.355639783]

= 1.505900559+ 0.1[1.406691935] = 1.496308976

h
y4 = y3 + 2
[f(x3 , y3 ) + f(x4 , y*4)]

h
y4 = y3 + 2
[f(0.3,1.355639783) + f(0.4,1.496308976)]

Where x4 = x3 + h = 0.3 + 0.1 = 0.4

0.1
y4 = 1.505900559+ 2
[(1 + 0.3 × 1.355639783) + (1 +

0.4×1.496308976)]

0.1
y4 = 1.505900559+ 2
[(1.406691935) + (1.59852359)]

y4 = 1.505900559+ 0.05[(3.005215525)] = 1.505900559

----------------------------------------------------------------------------------

Mjbs/NumericalAnalysisD2 /EulerLec2 4
Numerical Analysis
Numerical methods for solving differential equations
Modified Euler Lecture 2

y *5 = y1 + h[f(x4 , y4 )]

h
y5 = y4 + 2
[f(x4 , y4 ) + f(x5 , y*5)] and x3 = x2 + h

y *5 = 1.505900559+ 0.1[f(0.4,1.505900559]

y *5 = 1.505900559+ 0.1[1 + 0.4 × 1.505900559]

= 1.505900559+ 0.1[1.602360223] = 1.666136581

h
y5 = y4 + 2
[f(x4 , y4 ) + f(x5 , y*5)]

h
y5 = y4 + 2
[f(0.4,1.505900559) + f(0.5,1.666136581]

Where x5 = x4 + h = 0.4 + 0.1 = 0.5

0.1
y5 = 1.505900559+ 2
[(1 + 0.4 × 1.505900559) + (1 +

0.5×1.666136581)]

0.1
y5 = 1.505900559+ 2
[(1.602360224) + (1.833068291)]

y5 = 1.505900559+ 0.05[(3.435428515)] = 1.677671985

---------------------------------------------------------------------------------

Mjbs/NumericalAnalysisD2 /EulerLec2 5

Das könnte Ihnen auch gefallen