• Tidak ada hasil yang ditemukan

Part 3 - Approximate Solutions of Differential Equations

N/A
N/A
Protected

Academic year: 2024

Membagikan "Part 3 - Approximate Solutions of Differential Equations"

Copied!
69
0
0

Teks penuh

(1)

Faculty Name

Prof. A. A. Saati

(2)
(3)

Part 3 - Approximate Solutions of Differential Equations

1. Introductory Remarks 2. Taylor Series Expansion

3. Solutions of Differential Equations

(4)

1. Introductory Remarks

The ODE & PDE must be expressed as

approximate expressions, so that a digital computer can be employed to obtain a

solution

There are two methods for approximating the differentials of the function f

First method of approximation often used is the Taylor series

Second method is the use of a polynomial of degree n.

(5)

2. Taylor Series Expansion:

 Given a function f(x), which is analytical, can be expanded in a Taylor series about x as

)

(x x

f

   

 

n n

n

n

x f n

f(x) x

x f x

x f x

x x f

x f x

x f

1

3 3 3

2 2 2

!

! ...

3

! ) 2

( ) ( )

(

(6)

Forward Difference Formulations

 Solving for one obtains

 The truncation error of order x

f

   

 

x ,

) o ( )

(

! ...

3

! 2 )

( )

(

3 3 3

2 2 2

x

x f x

x f x

f

x f x

x x

f x

x x

x f x

x f x

f

) ( x o

) ( x o

   

! ...

3

! ) 2

( ) ( )

( 3

3 3 2

2 2

x

f x

x f x

x x f x

f x

x f

(7)

Finite Difference Formulations

 If the subscript index i is used to represent the discrete point in the x-direction

 The truncation error of order

 This equation is known as forward difference of order

 

x ,

1 o

x f f

x

f i i

) ( x o )

( x o

1 i i

(8)

Backward Difference Formulations

 Now consider the Taylor series expansion of about x.

 Solving for one obtains

 This is known as backward difference of order x

f

)

(x x

f

   

   

n n

n

n n

x f n

f(x) x

x f x

x f x

x x f

x f x

x f

1

3 3 3

2 2 2

1 !

! ...

3

! ) 2

( ) ( )

(

 

 

x ,

o

, x ) o

( )

(

1

x f f

x f

x

x x

f x

f x

f

i i

) ( x o

(9)

Central Difference Formulations

 Now consider the Taylor series

expansion of and about x.

Subtracting the above equations, one obtains:

 Solving for

x

f

/

)

(x x

f

   

   

! ...

3

! ) 2

( ) ( )

(

! ...

3

! ) 2

( ) ( )

(

3 3 3

2 2 2

3 3 3

2 2 2

x f x

x f x

x x f

x f x

x f

x f x

x f x

x x f

x f x

x f

)

(x x

f

 

....

! 2 3

) (

2 )

( )

( 3

3 3

x

f x

x x f

x x

f x

x f

) 2 (

) (

)

( 2

x x o

x x

f x

x f x

f

 

f f f

) ( x2 o

(10)

Forward & Backward Difference Formulations

 Again consider the Taylor series expansion of and about x.

Multiply the first equation by 2 and subtract it from the second equation:

 Solving for )

(x x

f

   

   

! ...

3 2

! 2 ) 2

2 ( ) ( )

2 (

! ...

3

! ) 2

( ) ( )

(

3 3 3

2 2 2

3 3 3

2 2 2

x f x

x f x

x x f

x f x

x f

x f x

x f x

x x f

x f x

x f

) 2

(x x

f

 

....

) (

) ( )

2 (

) (

2 3

3 3 2

2

2

x

x f x

x f x

f x

x f x

x f

2 f

) ( x o

(11)

Forward Difference Formulations

 Solving for

2 2

x f

 

 

2 ( )

) ) (

( )

( 2 )

2 (

2 1 2

2 2

2 2 2

x x o

f f

f x

f or

x x o

x f x

x f x

x f x

f

i i

i

) ( x o

(12)

Backward Difference Formulations

 A similar approximation for B.D. using the Taylor series expansions of

and about x. The result is )

(x x

f )

2

(x x

f

 

 

( )

2

) ) (

2 (

) (

2 )

(

2

2 1

2 2

2 2 2

x x o

f f

f x

f or

x x o

x x

f x

x f x

f x

f

i i

i

) ( x o

(13)

Center Difference Formulations

 Approximation expression for higher order derivatives

 Now consider the Taylor series expansion of and about x.

Add the above equations, one obtains the center difference:

   

   

! ...

3

! ) 2

( ) ( )

(

! ...

3

! ) 2

( ) ( )

(

3 3 3

2 2 2

3 3 3

2 2 2

x f x

x f x

x x f

x f x

x f

x f x

x f x

x x f

x f x

x f

2

) ) (

( )

( 2 )

( 2

2 2

2

f f

f

x x o

x x

f x

f x

x f x

f

)

(x x

f f (x x)

) ( x2 o

(14)

Forward Difference Formulations

 Now by considering additional terms in the Taylor series expansion, a more accurate

approximation of the derivatives is produced.

 Consider the Taylor series expansion,

 Solving for

   

! ...

3

! ) 2

( ) ( )

( 3

3 3 2

2 2

x

f x

x f x

x x f

x f x

x f

! ...

3 ) (

2 )

( )

(

3 3 2 2

2

x f x

x f x

x

x f x

x f x

f

x f

) ( x2 o

(15)

 Substitute a forward difference expression for

 And 0ne obtains a second-order for

! ...

3 ) (

2 )

( )

(

3 3 3 2

2

x f x

x f x

x

x f x

x f x

f

2 2

x f

) ) (

(

) 2

( )

( 2 )

(

2 2

2

x x o

x x

f x

x f x

f x

f

3 3 2

2

) ( 3 ) (

4 ) 2 (

or 6 ...

) (

) ) (

(

) ( )

( 2 ) 2 (

2 )

( )

(

x f x

x f x

x f f

x f x

x x o

x f x

x f x

x f x x

x f x

x f x

f

x f

(16)

Forward & Backward Difference Formulations

 The finite difference approximation to the time derivative is expressed for a forward and

backward difference as t

f f

t

f inj inj

 

, 1 ,

t f f

t

f inj inj

 

, , 1

) ( t o

(17)

1 –FD

2 – BD

3 – CD

4 – FD

5 - BD

Finite Difference Formulations

) ( x o

1

x f f

x

f i i

x f f

x

f i i

1

) ( x2 o x

f f

x

f i i

2

1 1

) ( x o

x

f f

f x

f i i i

2

3

4 1

2 o(x2)

) ( x2 o

x

f f

f x

f i i i

2

3

4 1

2

(18)

6 - FD

7 – BD

8 – CD

9 – FD

10 - BD

) ( x o

) ( t o

) ( x o

) ( x2 o

 

21

2 2

2 2

x

f f

f x

f i i i

 

12 2

2

2 2

x

f f

f x

f i i i

2

1 1

2

2 2

x

f f

f x

f i i i

t f f

t

f inj inj

 

, 1 , o(t)

t f f

t

f inj inj

 

, , 1

Finite Difference Formulations

(19)

Read Example:

2.1 , 2.2, 2.3, & 2.4

2.6, 2.7, & 2.8

(20)

3. Solutions of Differential Equations

Example:

Given the function compute the first derivative of f at x = 2 using forward and back ward difference of order

Compare the results with a central differencing of order and the exact analytical value. Use a step size of

Solution:

Form Eq.1

With

4 / )

(x x2

f

) (x

) (x2

1 .

0

x

)

1 o( x

x f f

x

f i i

1 .

0

x

(21)

Example (cont.)

The back ward of order

1 o( x) x

f f

x

f i i

) 1 . 0 ( 975

. 0 )

1 . 0 1 (

. 0

) 9 . 1 ( )

2

( f o o

f x

f

) (x

(22)

Example (cont.)

The central differencing of order

The exact value is

22

) (x2 )

2 (

1 2

1 o x

x f f

x

f i i

) 01 . 0 ( 0

. 1 )

1 . 0 ) (

1 . 0 ( 2

) 9 . 1 ( )

1 . 2

( f o o

f x

f

. 1 /

is 2 at x

which ,

4 / ) 2 (

/

f x x f x

(23)

Example (cont.)

Read Example:

2.6, 2.7, & 2.8

(24)

 Home work

Solve problems:

2.7

2.12

(25)

 Finite Difference Equations

( FDE ) next……….

(26)

Finite Difference Equations

 The finite difference approximations are replace the derivatives that appear in the PDEs.

 Consider the following example, where f is f = f(t,x,y).

 Assume is constant.

 Let represent

 Assume are constant step.

 Now use forward difference in time

 And use center difference in space.



 

 

 

2 2 2

2

y f x

f t

f

n j

i, , x, y, t

t y x

, ,

(27)

Finite Difference Equations

 Now use forward difference in time

 And use center difference in space.



 

 

 

2 2 2

2

y f x

f t

f

)

, (

1

, O t

t f f

t

f inj inj

) 2 (

) 2 (

2 2

1 , ,

1 , 2

2

2 2

, 1 ,

, 1 2

2

y f o

f f f

x x o

f f

f x

f

n j i n

j i n

j i

n j i n

j i n

j i

(28)

Finite Difference Equations

The finite difference formulation of PDE is:

Note that in this formulation, the spatial approximations are applied at time level n

This lead to one unknown

This equation is classified as explicit formulation

( ),( ),( )

2 2

2 2

2

1 , ,

1 , 2

, 1 ,

, 1 ,

1 ,

y x

t o

y

f f

f x

f f

f t

f

finj inj in j inj in j inj inj inj

1 ,

n

j

fi

(29)

Finite Difference Equations

The second case evaluated the spatial approximations at n+1 time level.

Therefore, the first-order backward difference approximation in time is employed

The finite difference formulation for PDE takes the form:

This lead to 5 unknown

( ),( ),( )

2 2

2 2

2

1 1 , 1

, 1

1 , 2

1 , 1 1

, 1

, 1 ,

1 ,

y x

t o

y

f f

f x

f f

f t

f

finj inj in j inj in j inj inj inj

1 1 , 1

1 , 1 , 1 1

, 1 1

,nj , in j, inj, inj and inj

i f f f f

f

(30)

 Applications

(31)

Applications

Example 2.2

(32)
(33)
(34)
(35)
(36)
(37)
(38)
(39)
(40)
(41)
(42)
(43)
(44)
(45)
(46)
(47)

 Finite Difference Approximation

of Mixed Partial Derivatives

(48)

Finite Difference Approximation of Mixed Partial Derivatives

Approximating mixed partial derivatives can be performed by using Taylor series expansion for two variables

Consider

The Taylor series expansion for two variables x and y, become as

)

2 /(

y x f

) ,

(x x y y

f

 

 2 2 2 2

   3 3

2 2 2

! , 2 2

! 2

! ) 2

, ( )

, (

y x

y O x

f y

x y

f y

x f x

y y f x

x f y

x f y

y x x

f

(49)

Taylor Series Expansion

Using indices to represent a grid point at x, y.

Similarly, the expansion j i and

 

2 2 2

 

2 2 2

    

3 3

2 ,

1 , 1

! , 2

! 2

O x y

y f y

x f x

y x y f y x

y f x

x f f

fi j i j

) ,

(x x y y

f

 

2 2

 

2 2

    

3 3

2 ,

1 , 1

,

x f y f O x y

y x y f y x

y f x

x f f

fi j i j

(50)

Taylor Series Expansion

And the expansion

And the expansion

 

2 2 2

 

2 2 2

    

3 3

2 ,

1 , 1

! , 2

! 2

O x y

y f y

x f x

y x y f y x

y f x

x f f

fi j i j

) ,

(x x y y

f

 

2 2

 

2 2

    

3 3

2 ,

1 , 1

,

x f y f O x y

y x y f y x

y f x

x f f

fi j i<

Referensi

Dokumen terkait

Dynamical behavior of mixed type lump solution [7], exact optical solution of perturbed nonlinear Schrodinger equation [8], ¨ nonlinear complex fractional emerging telecommunication

In this study, an unconditionally stable implicit finite difference scheme and the 𝛽 order Caputo fractional partial derivative were executed to discretize the SFDE and to obtain the

Regular mesh allows you to use different discretization methods, in particular the finite difference method and finite volume method.Usually when you create regular grids in complex

SOR iterative method for the linear rational finite difference solution of second- order Fredholm integro-differential equations ABSTRACT In this paper, a new three-point linear

Refinement of SOR iterative method for the linear rational finite difference solution of second-order Fredholm Integro-differential equations ABSTRACT The primary objective of this

The similarity finite difference solutions for two-dimensional parabolic partial differential equations via SOR iteration ABSTRACT This paper purposely attempts to solve

In order to approximate the solutions of linear and non-linear fuzzy differential equations, we propose a new fuzzification of the classical Euler method and then incorporate an

4 Develop the new algorithm; Overset Grid Generation OGG method in Forward Backward Time Stepping FBTS technique utilizes Finite Difference Time Domain FDTD method for image