kuliah - solusi numerik persamaan diferensial -mhs

29
Solusi Numerik Persamaan Diferensial Orde Pertama

Upload: hendrik-voice

Post on 28-Dec-2015

39 views

Category:

Documents


0 download

DESCRIPTION

q

TRANSCRIPT

Page 1: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Solusi Numerik Persamaan Diferensial

Orde Pertama

Page 2: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

Solusi Numerik dari Persamaan Diferensial Biasa

First Order Differential Equations

Euler's method

The exact value and the errors

Graphical interpretation of Euler's method

The Euler-Cauchy method or the improved Euler method

Euler-Cauchy calculations

Runge-Kutta method

Second Order Differential Equations

Euler second-order method

Runge-Kutta method for second-order differential equations

Predictor - corrector methods

2

Page 3: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

INTRODUCTION

TBS - DTM FT. USU

The range of differential equations that can be solved by

straightforward analytical methods is relatively restricted.

Even solution in series may not always be satisfactory, either because

of the slow convergence of the resulting series or because of the

involved manipulation in repeated stages of differentiation.

In such cases, where a differential equation and known boundary

conditions are given, an approximate solution is often obtainable by

the application of numerical methods, where a numerical solution is

obtained at discrete values of the independent variable.

The solution of differential equations by numerical methods is a

wide subject.

3

Page 4: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Taylor ’ SeriesTBS - DTM FT. USU

Let us start off by briefly revising the fundamentals of

Maclaurin's and Taylor's series.

4

Page 5: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

Therefore at P :

If the y-axis and origin are moved a units to the left, the equation of the same curve relative to the new axes becomes y = f(a + x) and the function value at K is f(a).

This is one common form of Taylor's series.

5

Page 6: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Fungsi Increment

TBS - DTM FT. USU

If we know the function value f(a) at A, i.e. at x = a, we can apply

Taylor's series to determine the function value at a neighbouring

point B, i.e. at x = a + h.

This entails evaluation of an infinite number of derivatives at x = a:

in practice an approximation is accepted by restricting the number

of terms that are used in the series.

6

Page 7: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

First Order Differential Equations

TBS - DTM FT. USU

Numerical solution of dy/dx = f(x,y) with the initial condition

that, at x = x0, y = y0.

Euler's Method

The simplest of the numerical methods for solving first-order

differential equations is Euler's method, in which the Taylor's

series

7

Page 8: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

This is a severe approximation, but in practice the approximately equals'

sign is replaced by the normal 'equals' sign, in the knowledge that the

result we obtain will necessarily differ to some extent from the function

value we seek.

With this in mind, we write f(a + h) = f(a) + hf '(a)

If h is the interval between two near ordinates and if we denote f(a) by

y0, then the relationship f(a + h) = f(a) + hf ‘(a) becomes yi =y0 +

h(y')0

Hence, knowing y0, h and (y’) 0, we can compute y1, an approximate

value for the function value at B.8

Page 9: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

ExampleTBS - DTM FT. USU

Given that dy/dx = 2(1 + x) - y with the initial condition that at

x = 2, y = 5, we can find an approximate value of y at x = 2.2, as

follows.

Solution

We have y' = 2(1+x) - y with x0 = 2 ; y0 = 5

(y‘)0 = 2 (1+ x0) - y0 = 2(l + 2) - 5 ; (y‘)0 = 1

So we have x0 = 2; y0 = 5; (y‘)0 = 1 ; xi = 2.2; h = 0.2.

By Euler's relationship : y1=y0 + h(y')0 = 5 + (0.2)1 = 5.2

9

Page 10: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

If we take the values of x, y and y' that we have just found for

the point B and treat these as new starter values x0, y0, (y’)0,

we can repeat the process and find values corresponding to the

point C.

Then at C :

10

Page 11: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

So we could continue in a step-by-step method. At eachstage, the determined values of x1, y1 and (y’)1 become thenew starter values xo, yo and (y’)o for the next stage.

Continue the table with a constant interval of h = 0-2.

11

Page 12: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

Now you can continue in the same way and complete thetable for x = 2.0, 2.2, 2.4, 2.6, 2.8, 3.0

In practice, we do not, in fact, enter the values in the right-hand half of the table, but write them in directly as newstarter values in the left- hand section of the table.

12

Page 13: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

The particular solution is given by the values of y against x

and a graph of the function can be drawn.

Draw the graph of the function carefully on graph paper.

13

Page 14: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU

Graph of the solution of dy/dx = 2(1 + x) - y with y = 5 at x = 2.

14

Page 15: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

“Using Spreadsheet”

TBS - DTM FT. USU15

Page 16: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU16

Page 17: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU17

Page 18: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU18

Page 19: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU19

Page 20: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU20

Page 21: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU21

Page 22: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU22

Page 23: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Metode Euler Cauchy

TBS - DTM FT. USU23

Page 24: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Metode Euler Cauchy

TBS - DTM FT. USU24

Page 25: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Using Spreadsheet

TBS - DTM FT. USU25

Page 26: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU26

Page 27: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU27

Page 28: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

TBS - DTM FT. USU28

Page 29: Kuliah - Solusi Numerik Persamaan Diferensial -MHS

Summary

TBS - DTM FT. USU29