Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.

Post on 26-Dec-2015

222 views 0 download

Tags:

Transcript of Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.

Lecture 35Lecture 35

NumericalAnalysis

NumericalAnalysis

Chapter 7Ordinary

Differential Equations

Chapter 7Ordinary

Differential Equations

IntroductionIntroductionTaylor SeriesTaylor SeriesEuler MethodEuler MethodRunge-Kutta MethodRunge-Kutta MethodPredictor Corrector Predictor Corrector MethodMethod

INTRODUCTIONINTRODUCTIONMany problems in science Many problems in science and engineering when and engineering when formulated mathematically formulated mathematically are readily expressed in are readily expressed in terms of ordinary differential terms of ordinary differential equations (ODE) with initial equations (ODE) with initial and boundary condition.and boundary condition.

ExampleExampleThe trajectory of a The trajectory of a ballistic missile, the ballistic missile, the motion of an artificial motion of an artificial satellite in its orbit, are satellite in its orbit, are governed by ordinary governed by ordinary differential equations.differential equations.

Theories concerning electrical Theories concerning electrical networks, bending of beams, networks, bending of beams, stability of aircraft, etc., are stability of aircraft, etc., are modeled by differential modeled by differential equations. equations. To be more precise, the rate of To be more precise, the rate of change of any quantity with change of any quantity with respect to another can be respect to another can be modeled by an ODEmodeled by an ODE

Closed form solutions Closed form solutions may not be possible to may not be possible to obtain, for every obtain, for every modeled problem, while modeled problem, while numerical methods numerical methods exist, to solve them exist, to solve them using computers.using computers.

In general, a linear or In general, a linear or non-linear ordinary non-linear ordinary differential equation can differential equation can be written asbe written as

1

1, , , ,

n n

n n

d y dy d yf t y

dt dt dt

Here we shall focus on a Here we shall focus on a system of first ordersystem of first orderdifferential equations of the differential equations of the formform

( , )dy

f t ydt

with the initial condition with the initial condition y y ((tt00) = ) = yy00, which is called an , which is called an

initial value problem (IVP).initial value problem (IVP).

It is justified, in view of It is justified, in view of the fact that any higher the fact that any higher order ODE order ODE can be can be reduced to a system reduced to a system of first order of first order differential equations differential equations by substitution. by substitution.

For example, consider For example, consider a second order a second order differential equation differential equation of the formof the form

( , , )y f t y y

Introducing the substitution Introducing the substitution the above equation the above equation

reduces to a system of two reduces to a system of two first order differential first order differential equations, such asequations, such as

,p y

, ( , , )y p p f t y p

Theorem Theorem Let Let ff ( (t, yt, y) be real and ) be real and continuous in the strip continuous in the strip R, defined byR, defined by

0 , ,t t T y

Then for anyThen for any and for and for any any yy11, , yy22, there exists a , there exists a

constant L, satisfying the constant L, satisfying the inequalityinequality

0[ , ]t t T

1 2 1 2( , ) ( , )f t y f t y L y y

so thatso thatfor every for every Here, L is called Here, L is called Lipschitz Lipschitz constantconstant. .

( , ) ,yf t y L

, .t y R

If the above conditions If the above conditions are satisfied, then for any are satisfied, then for any yy00, the IVP has a unique , the IVP has a unique

solution solution y y ( ( t t ), for ), for 0 ,t t T

In fact, we assume the In fact, we assume the existence and uniqueness of existence and uniqueness of the solution to the above IVPthe solution to the above IVP

The function may be linear The function may be linear or non-linear. We also or non-linear. We also assume that the function assume that the function ff ((t, yt, y) is sufficiently ) is sufficiently differentiable with respect differentiable with respect to either to either tt or or yy. .

TAYLOR’S TAYLOR’S SERIESSERIES

METHODMETHOD

Consider an initial value Consider an initial value problem described byproblem described by

0 0( , ), ( )dy

f t y y t ydt

Here, we assume that Here, we assume that ff ( (t, yt, y) is ) is sufficiently differentiable with sufficiently differentiable with respect to x and y.respect to x and y.

If If y y ((tt) is the exact solution, ) is the exact solution, we can expand we can expand y y ((tt) by ) by Taylor’s series about the Taylor’s series about the point point tt = = tt00 and obtain and obtain

20

0 0 0 0

( )( ) ( ) ( ) ( ) ( )

2!

t ty t y t t t y t y t

3 40 0

0 0

( ) ( )( ) ( )

3! 4!IVt t t t

y t y t

Since, the solution is not Since, the solution is not known, the derivatives in the known, the derivatives in the above expansion are not above expansion are not known explicitly. However, known explicitly. However, ff is is assumed to be sufficiently assumed to be sufficiently differentiable and therefore, differentiable and therefore, the derivatives can be the derivatives can be obtained directly from the obtained directly from the given differential equation.given differential equation.

Noting that Noting that ff is an implicit is an implicit function of function of yy, we have, we have

( , )

x y

y f t y

f f dyy f ff

x y dx

SimilarlySimilarly

2

2

2

2

( ) ( )

2 ( )

3 3

( 2 )

3( )( )

( )

xx xy xy yy y x y

xx xy yy y x y

IVxxx xxx xyy

y xx xy yy

x y xy yy

y x y

y f ff f f ff f f ff

f ff f f f f ff

y f ff f f

f f ff f f

f ff ff ff

f f ff

Continuing in this manner, Continuing in this manner, we can express any we can express any derivative of derivative of yy in terms of in terms of ff ( (t, yt, y) and its partial ) and its partial derivatives. derivatives.

Example Example Using Taylor’s series method, Using Taylor’s series method, find the solution of the initial find the solution of the initial value problemvalue problem

, (1) 0dy

t y ydt

at at tt = 1.2, with = 1.2, with hh = 0.1 and = 0.1 and compare the result with the compare the result with the closed form solutionclosed form solution

SolutionSolution Let us compute the first few Let us compute the first few derivatives from the given derivatives from the given differential equation as follows:differential equation as follows:

, 1 , ,

,IV V IV

y t y y y y y

y y y y

Prescribing the initial Prescribing the initial condition, that is, at condition, that is, at tt00 =1, =1, yy00 – – y y ((tt00) = 0, we have) = 0, we have

0 0

0 0 0

1, 2,

2IV V

y y

y y y

Now, using Taylor’s Now, using Taylor’s series method, we haveseries method, we have

2 30 0

0 0 0 0 0

4 50 0

0 0

( ) ( )( ) ( )

2 6

( ) ( )

24 120IV V

t t t ty t y t t y y y

t t t ty y

Substituting the above values Substituting the above values of the derivatives, and the of the derivatives, and the initial condition, we obtaininitial condition, we obtain

0.01 0.001 0.00001(1.1) 0 (0.1)(1) (2) (2) (2)

2 6 120y

0.001 0.0001 0.000010.1 0.01

3 12 60

0.1 0.01 0.000333 0.0000083 0.0000001

0.1103414.

Therefore, Therefore,

1(1.1) 0.1103414 0.1103y y Taking Taking yy11 = 0.1103 at = 0.1103 at tt = 1.1, = 1.1,

the values of the derivatives the values of the derivatives areare

1

1

1 1 1

1.1 0.1103 1.2103

1 1.2103 2.2103

2.2103IV V

y

y

y y y

Substituting the value of Substituting the value of yy11 and its derivatives into and its derivatives into

Taylor’s series Taylor’s series expansion we get, after expansion we get, after retaining terms up to retaining terms up to fifth derivative only……fifth derivative only……

21

1 1 1 1

3 4 51 1 1

1 1 1

( )(1.2) ( )

2

( ) ( ) ( )

6 24 120IV V

t ty y t t y y

t t t t t ty y y

(1.2) 0.1103 0.12103

0.0110515 0.0003683

0.000184 0.0000003

y

0.2429341 0.2429 0.243

To obtain the closed form To obtain the closed form solution, we rewrite the given solution, we rewrite the given IVP asIVP asdy

y tdt

( )t td ye te oror

On integration, we getOn integration, we get

( )

1

t t t t

t

y e te e ce

ce t

Using the initial condition, we Using the initial condition, we getget 0 2ce oror 2

ce

Therefore, the closed form Therefore, the closed form solution issolution is

11 2 ty t e

When When tt = 1.2, = 1.2, the closed form solution the closed form solution becomesbecomes

(1.2) 1.2 1 2(1.2214028)

2.2 2.4428056

0.2428 0.243

y

Lecture 35Lecture 35

NumericalAnalysis

NumericalAnalysis