advanced engineering mathematics presentation

145
Advanced Engineering Advanced Engineering Mathematics Mathematics A.Emamzadeh A.Emamzadeh Spring Spring 2009 2009

Upload: reborn2

Post on 28-Oct-2015

490 views

Category:

Documents


46 download

DESCRIPTION

Advanced Engineering Mathematics

TRANSCRIPT

Page 1: Advanced Engineering Mathematics presentation

Advanced Engineering Advanced Engineering MathematicsMathematics

A.EmamzadehA.Emamzadeh

Spring Spring 20092009

Page 2: Advanced Engineering Mathematics presentation

Syllabus# Topic Reference Duration (weeks)

1 Numerical solution of ODE [1] Chapter 5 & 11 2

2 Numerical solution of PDE [1] Chapter 12 2

3 Matrix Algebra [1] Chapters 6, 7 and 10 2

4 Integral equations [2] Chapter 16 1

5 Fourier series and Integrals [3] Chapter 1 1

6 Partial differential equations [3] Chapters 2 to 6 2

7 Special functions [4] Appendix B 1

8 Complex functions [5] Chapter 2 to 10 2

9 Monte Carlo method [2] Chapter 19 1

10 Integral transforms [4] Chapter 13 1

Total 15

Reference texts

Page 3: Advanced Engineering Mathematics presentation

Reference texts

[1] Faires & Burden Numerical Methods 3rd ed. ,Brooks/Cole 2003

[2] FrobergIntroductions to Numerical Analysis, Addison-Wesley

[3] Powers Boundary Value Problems

[4] Pipes & HarvillApplied Mathematics for Engineers and Physicists, McGraw-Hill

[5] Churchill Complex variable and applications

Page 4: Advanced Engineering Mathematics presentation

Ordinary Differential Equations

1) Introduction

2) Initial Value Problems (IVP)

3) Boundary Value Problems (BVP)

Page 5: Advanced Engineering Mathematics presentation

1) Introduction

1- Sources of errors1.1- Initial data error1.2- Round off error1.3- Truncation error

2- Type of problems2.1- well – behaved2.2- ill – conditioned

3- Stability

4- Big Oh

Page 6: Advanced Engineering Mathematics presentation

2) Methods of solving IVP

1- Introduction

2- Taylor series method

3- Single step methods

4- Multi step methods

5- Extrapolation methods

Page 7: Advanced Engineering Mathematics presentation

3) Methods of solving BVP

1- Shooting methods

2- Finite difference methods

3- Variational methods

4- Eigen Value Problems (EVP)

Page 8: Advanced Engineering Mathematics presentation

Types of problems in IVP

Single first order equation System of n first order equations Single n th order equation

Page 9: Advanced Engineering Mathematics presentation

Single first order equation

, with initial condition (IC),),( yxfy

00 )( yxy

To find y at x1 to a specified accuracy.

Page 10: Advanced Engineering Mathematics presentation

System of n first order equations

),,...,,(

),...,,(

1

111

nnn

n

yyxfy

yyxfy

With initial conditions

00

1001

)(

)(

nn yxy

yxy

To find y1,…yn at x1 to a specified accuracy.

Page 11: Advanced Engineering Mathematics presentation

Where tn1 y,,yY

and tn1 f,,fF

In matrix form

00 Y)Y(x

Y)F(x,Y

Page 12: Advanced Engineering Mathematics presentation

Single n th order equation

),,,,,,( )1()( nn yyyyxfy with initial conditions

00)1(

100 )(,,)( nn yxyyxy

This equation with the given initial conditions can be transformed into a system of n first order equations as follows,

Page 13: Advanced Engineering Mathematics presentation

Let nn yyyyyy )1(

21 then

nn yyyxfy ,,,, 21

and

001001 )(,)( nn yxyyxy

The whole system can be written in the matrix form

00 )(

),(

YxY

YxFY

Where tnt

n fyyyFyyY ,,,,,, 321 and

Page 14: Advanced Engineering Mathematics presentation

Finally we are dealing with the form

00 )(

),(

yxy

yxfy

as a single first order equation or

as a system of n first order equations

Page 15: Advanced Engineering Mathematics presentation

Taylor series method

00 )(

),(

yxy

yxfy

To find y at x1 correct to md

Let x1 – x0 = h then the Taylor expansion of y about

x = x0 is

yh

yh

yhyhxyxy!3!2

3

0

2

0001

Page 16: Advanced Engineering Mathematics presentation

0

0

0

0

000

0

),(

y

ff

x

f

yf

y

ff

x

f

xy

y

ff

x

fy

yxfy

y givenishere

Page 17: Advanced Engineering Mathematics presentation

20

10

3 2

y

y

yxyGiven

:Example

onsoand

Find y(h) correct to 2d where h=0.1, 0.5,1 and 2.

Page 18: Advanced Engineering Mathematics presentation

14)0(32

12)0(2

5)0(21

2)0(

)5()5(

)4(2)4(

yyyyyy

yyyyy

yyyy

yhavewe

5432

60

7

2

1

6

521 hhhhhhy

Page 19: Advanced Engineering Mathematics presentation

Taking number of terms n=6

When h=0.1 y(0.1)=.8107845000

h=0.5 y(0.5)=.3265625000

h=1 y(1)=.4500000000

h=2 y(2)=3.400000000

Taking number of terms n=7

y(0.1)= .8107846111

y(0.5)= .3282986111

y(1)= .5611111111

y(2)= 10.51111111

Page 20: Advanced Engineering Mathematics presentation

Taking n=10

y(0.1)= .8107846019

y(0.5)= .3276448999

y(1.0)= .4951609347

y(2.0)= 9.887477949

Compare the accuracy

Page 21: Advanced Engineering Mathematics presentation

Single step methodsDef.:

Local truncation error

Global truncation error

Order of a method

First order method (Euler's method)

Statement of the problem

00

,

yxy

yxfy

given

Page 22: Advanced Engineering Mathematics presentation

To find y at x=b correct to md

Let b-x0=h then

200000 , hyxfhyyhyby o

Here O(h2) is the local truncation error

In the standard form

,1,0,1

11

nyxfhk

kyy

nn

nn where

Page 23: Advanced Engineering Mathematics presentation

Second order methods

errortruncationglobaltheisand

where1.

2

12

1

221

2,

2

,

hO

ky

hxfhk

yxfhk

hOkyy

nn

nn

nn

Page 24: Advanced Engineering Mathematics presentation

g.t.e.beforeas

where2.

2

12

1

2211

,

,2

1

2

1

hO

kyhxfhk

yxfhk

hOkkyy

nn

nn

nn

Page 25: Advanced Engineering Mathematics presentation

A third order method

123

12

1

33211

2,

2,

2

,

,2,146

1

kkyhxfhk

ky

hxfhk

yxfhk

nhOkkkyy

nn

nn

nn

nn

where

Page 26: Advanced Engineering Mathematics presentation

A 4th order method (runge – kutta)

34

23

12

1

443211

,

2,

2

2,

2

,

226

1

kyhxfhk

ky

hxfhk

ky

hxfhk

yxfhk

hOkkkkyy

nn

nn

nn

nn

nn

where

Page 27: Advanced Engineering Mathematics presentation

Example:

20,10

2sin

yy

yyxy

Find y(0.1) and y’(0.1) using h=0.1 and a 2nd order method.

20

10

2sin

p

y

pyxp

py thenLet

Page 28: Advanced Engineering Mathematics presentation

Take k for the slope of y and l for the slope of p then

101002102

000101

2101

2101

2sin

2sin

2

12

1

lpkyhxhllphk

pyxhlphk

llpp

kkyy

where

Now calculate [Note the argument of sine must the in radiance].

Page 29: Advanced Engineering Mathematics presentation

Modified Euler's method

g.t.e.theiswhere

2

2111

1

,,2

,

hO

hOyxfyxfh

yy

yxfhyy

pnnnnn

cn

nnnpn

error.truncationlocaltheiswhere

2

21 ,2

hO

hOyxhfyy nnnn 1

Mid - Point rule

Page 30: Advanced Engineering Mathematics presentation

How to control the truncation error1) By lowering the step size and repeat the

whole calculations: Runge-Kutta method

2) By considering the 1st neglected term in the Taylor expansion:

Merson’s method

A 2nd and third order method

Fehlberge’s method

Page 31: Advanced Engineering Mathematics presentation

A single-step method with error estimator Merson’s method

5431

431

5

314

213

12

1

55411

89230

1

22

32

,

83

8,

2

66,

3

3,

3

,

46

1

kkkkE

kkk

yhxhfk

kky

hxhfk

kky

hxhfk

hy

hxhfk

yxhfk

hOkkkyy

nn

nn

nn

nn

nn

nn

where

Page 32: Advanced Engineering Mathematics presentation

Fehlberg method

543216

43215

3214

213

12

1

54311

654311

~

40

11

4104

1859

2565

35442

27

8,

2

4104

845

513

36808

216

439,

2197

7296

2197

7200

2197

1932,

13

12

32

9

32

3,

8

3

4

1,

4

,

5

1

4104

2197

2565

1408

216

2555

2

50

9

56430

28561

12825

6656

135

16

kkkkkyh

xhfk

kkkkyhxhfk

kkkyh

xhfk

kkyh

xhfk

kyh

xhfk

yxhfk

kkkkyy

kkkkkyy

nn

nn

nn

nn

nn

nn

nn

nn

where

Page 33: Advanced Engineering Mathematics presentation

Multi step methods Predictor formulas Corrector formulas

Page 34: Advanced Engineering Mathematics presentation

Predictor formulas

543211

43211

3211

211

11

1

1440

475

1440

2877

1440

7298

1440

9982

1140

7923

1140

4277

720

251

720

1274

720

2616

720

2774

720

1901

24

9

24

37

24

59

24

55

12

5

12

16

12

23

2

1

2

3

nnnnnnnn

nnnnnnn

nnnnnn

nnnnn

nnnn

nnn

ffffffhyy

fffffhyy

ffffhyy

fffhyy

ffhyy

fhyy

Page 35: Advanced Engineering Mathematics presentation

Corrector formulas

432111

32111

2111

111

11

1440

27

1440

173

1440

482

1440

798

1440

1427

1440

475

720

19

720

106

720

264

720

646

720

251

24

1

24

5

24

19

24

9

12

1

12

8

12

5

2

1

2

1

nnnnnnnn

nnnnnnn

nnnnnn

nnnnn

nnnn

ffffffhyy

fffffhyy

ffffhyy

fffhyy

ffhyy

Page 36: Advanced Engineering Mathematics presentation

Extrapolation methods1.Introduction:Consider calculating as the area of a unit circle

(Fig.1), by calculation of the area of n sided polygon inscribed in the circle.

n

1

Fig. 1nA0Let be the area of n sided polygon.

n

nnA n

n 2sin

2sin

20

Page 37: Advanced Engineering Mathematics presentation

Using Taylor expansion of Sin x

66

44

22

753

0 !7

2

!5

2

!3

22

2

n

a

n

a

n

a

nnnn

nAn

Where a2, a4, a6, … are constants, do not depend on n.

Now if we double n then

6

64

42

220 64164 n

a

n

a

n

aA n

Page 38: Advanced Engineering Mathematics presentation

To form a linear combination of

in such away that in the linear combination the first term be and the second term vanishes, that is, for some and

nn AA 200 and

88

66

44

1200 n

b

n

b

n

bAAA n

saynn

Where b4, b6, b8, … are constants, do not depend on n.

04

1 andThen

The implies that 34

31 and

Page 39: Advanced Engineering Mathematics presentation

To go further we can repeat the same procedure by doubling the sides again and hence.

8

86

64

421 2566416 n

b

n

b

n

bA n

Again to form a linear combination of

in such away that in the linear combination the first term be p and the second term vanishes, that is for some and .

nn AA 211 and

,88

66

22

11 n

c

n

cAAA n

saynn

Page 40: Advanced Engineering Mathematics presentation

Where c6, c8, … are constants, do not depend on n.

,88

66

22

11 n

c

n

cAAA n

saynn

1,2,nfor

andgeneralIn

andthatimpliesthis

andThen

14

4

14

1

15

16

15

1

,016

1

n

n

n

Page 41: Advanced Engineering Mathematics presentation

The result of above operations can be presented in an extrapolation table as follows.

nnnn

nnn

nn

n

AAAA

AAA

AA

A

322

41

80

22

140

120

0 31

34

151

1516

Note that truncation error of the columns respectively are

on.soand,1

,1

,1

642

nO

nO

nO

631

6364

Page 42: Advanced Engineering Mathematics presentation

Numerically1. Starting with a triangle (the least accuracy),

we have

Are these coefficients ( and ) general?

30A

60A

120A

240A

480A

1.299038

2.598077

3.000001

3.105829

3.132629

3.03109

3.133975

3.141105

3.141563

3.140834

3.141581

3.141593

3.141593

3.141593

3.141593

Page 43: Advanced Engineering Mathematics presentation

40A

80A

160A

320A

640A

2

2.828427

3.061468

3.121446

3.136549

3.10457

3.139148

3.141439

3.141584

3.141453

3.141591

3.141593

3.141593

3.141593

3.141593

Page 44: Advanced Engineering Mathematics presentation

50A

100A

200A

400A

800A

2. 377642

2.938927

3.09017

3.12869

3.138364

3.126022

3.140584

3.3014153

3.141489

3.141555

3.141593

3.141593

3.141593

3.141594

3.141594

1600A 3.14078

63.14159

33.14159

33.14159

33.14159

33.14159

3

Page 45: Advanced Engineering Mathematics presentation

100A

200A

400A

800A

1600A

2. 938926

3.09017

3.12869

3.138364

3.140786

3.140584

3.14153

3.141589

3.141593

3.141593

3.141593

3.141593

3.141593

3.141593

3.141593

3200A 3.14139

13.14159

33.14159

33.14159

33.14159

33.14159

3

Page 46: Advanced Engineering Mathematics presentation

1. yes, whenever the accuracy parameter is changed by factor of 2. and the terms of the Taylor expansion are alternatively zero.

2. No otherwise

Page 47: Advanced Engineering Mathematics presentation

Extrapolation in differentiation Starting with central difference formula for

the first and second derivative

)2(2

)1(2

22

2

hOh

hxfxfhxfxf

hOh

hxfhxfxf

Denote the RHS of (1) as and the RHS of (2) as hF0hS0

Page 48: Advanced Engineering Mathematics presentation

Similar extrapolation table looks like

hhh

hh

h

FFF

FF

F

22

14

0

12

0

0 31

34

151

1516

The truncation error of the columns in order are

.onsoandand642 , hOhOhO

Similarly for the second derivative

Page 49: Advanced Engineering Mathematics presentation

Extrapolation in integrationConsider the trapezoidal rule

1

100

20

22

n

iin

h

hb

a

fffh

T

hOTdxxf

where

hhh

hh

h

TTT

TT

T

22

14

0

12

0

0 31

34

151

1516

Page 50: Advanced Engineering Mathematics presentation

Extrapolation in IVPSuppose y'=f(x,y), y(x0)=y0 to find y(b)

correct to md, with extrapolation method.

Start with Mid-Point rule

20011 ,2 hOyxhfyy

Either y-1is known previously or it should be

calculated by, say, Euler's method and corrected by modified Euler's method to have the same accuracy as O(h2)

Page 51: Advanced Engineering Mathematics presentation

therefore with h<0

Ec

E

yxfyxfh

yy

yxhfyy

110001

0001

,,2

,

and

If we denote then in extrapolation notationhYy 01 by

hhh

hh

h

YYY

YY

Y

22

14

0

12

0

0 31

34

151

1516

Page 52: Advanced Engineering Mathematics presentation

And so on.

Compare this method with single step methods and multi step methods.

Page 53: Advanced Engineering Mathematics presentation

ExampleConsider y'=y , y(0)=1 . To find y(1)

correct to 3d .

start with h=1 , y0=1 , x0=0

21

021

11

10

11

8

21

8

131

8

131

8

5

8

5

2

11

4

11

2

1

2

11

2

1

5.222

12

101

2

11,0

Yyy

yy

h

Y

yy

cE

cE

with

Page 54: Advanced Engineering Mathematics presentation

To continue calculate and and extrapolate.

6666.26

16

2

7

6

5

8

21

3

4

2

5

3

13

4

3

1 21

01

01

1

YYY

41

0Y 81

0Y

Page 55: Advanced Engineering Mathematics presentation

Shooting methodsStatement of a boundary value problem

byay

yyxfy

,

,,Given

Find y for a<x<b correct to md.

Shooting method changes the BVP into an IVP by assuming a value for y'(a) , say S, then using a root finder to find the

root of y(b,S)-=0 up to a desired accuracy.

1. Secant method

2. Newton’s method

Page 56: Advanced Engineering Mathematics presentation

Let us start with secant method as the root finder

Step 1. Guess S0=y'(a)Step 2. Solve the IVP

,,,,, 0Sayayyyxfy

to find y(b, S0) .

Is y(b, S0)=? if yes then stop, otherwise continue

001

001

,

,

SbyifSayS

SbyifSayS otherwiseGuess

Step 4. Solve the IVP

,,,,, 1Sayayyyxfy

to find y(b, S1).

Step 3.

Page 57: Advanced Engineering Mathematics presentation

Is y(b, S1)=If yes then stop, otherwise continue.

Step 5. Find the next Sn+1 ,using secant method.

,2,1

,,

,

1

11

n

SbySby

SSSbySS

nn

nnnnn

Step 6. Solve the IVP

1

1

,

,,,,,

n

n

Sby

Sayayyyxfy

findto

Step 7. Test for convergence

stopthenyesifIs TolSby n 1,

Step 8. Go to step 5.

Page 58: Advanced Engineering Mathematics presentation

Example 1:Given

31,32

1

22

yy

yx

y [note that this is a linear differential equation]

To find y for 12

1 x correct to 3d.

0001.3,1

27500.36250.3

21

36250.3

2

1

6250.3,12

1

7500.3,11

2

2

01

00

Sy

S

SyS

SyS

Page 59: Advanced Engineering Mathematics presentation

x y

0.5 3

0.6 2.8667

0.7 2.8287

0.8 2.8501

0.9 2.9112

1 3.0001

Page 60: Advanced Engineering Mathematics presentation

Example 2:

Given

82,41

21

yy

y

y

xyy [this is a nonlinear differential equation]

To find y for 1<x<2 correct to 3d.

,2,1

,2,2

8,2

08,2

1

11

n

SySy

SSSySS

SySF

nn

nnnnn

Page 61: Advanced Engineering Mathematics presentation

000000.8,2333333.1

9902356.7,23331706.1

9688716.7,2328125.1

2580645.8,2375.1

111111.7,216667.1

4.6,21

16,22

66

55

44

33

22

11

00

SyS

SyS

SyS

SyS

SyS

SyS

SyS

Page 62: Advanced Engineering Mathematics presentation

x y

1 4

1.1 4.1450

1.2 4.3165

1.9 7.0793

2 7.9994

Page 63: Advanced Engineering Mathematics presentation

In case of Newton's method as the root finder the steps will be as follows

Step 1. Guess S0=y'(a)Step 2. Solve the system

1

0

,,

0

S

ayS

ay

Say

ay

S

y

y

f

S

y

y

f

S

y

yyxfy

(1)

Page 64: Advanced Engineering Mathematics presentation

By any IVP method find y(b, S0), y' (b, S0) and

00 ,,, SbS

ySb

S

y

Step 3. Find a new Sn using Newton’s method

,1,0,

,1

n

Sbsy

SbySS

n

nnn

Step 4. Solve the system(1) with new Sn=y'(a)

Step 5. Test for convergence, i.e.

stopthenyesifTolSby n ,

Page 65: Advanced Engineering Mathematics presentation

Step 6. Go to step 3.

Example: Find y for 1<x<2, given

thenanddenoteuslet

system(1)solvetonow

guess

US

yY

S

y

S

yy

y

y

xyy

2

82,41

21

0

Page 66: Advanced Engineering Mathematics presentation

if

11

01

1

41

412

21

0

2

2

U

Y

Sp

y

Uy

p

xY

y

pU

UY

y

p

xpp

py then

Page 67: Advanced Engineering Mathematics presentation

Solve by 4th order Runge-Kutta with h=0.01 (say) then

66666667.1

24,216,2

1

00

S

SS

ySy

impliesthis

and

Next five iterations yields

000000.6,2000000.8,233333333.1

00018279.6,200012208.8,2333353689.1

04715063.6,203137248.8,233854166.1

82666667.6,25333333.8,2416666667.1

6666667.10,26666667.10,266666667.1

555

444

333

222

111

SS

ySyS

SS

ySyS

SS

ySyS

SS

ySyS

SS

ySyS

Page 68: Advanced Engineering Mathematics presentation

Finite difference methodsFinite difference methodsStatement of the problem:Given the BVP

byay

yyxfy

,

,,

Find y for a<x<b correct to md.

There are two cases:

1. Linear equation, in general

byay

xryxqyxpy

,

Page 69: Advanced Engineering Mathematics presentation

2. Non linear equation

byay

yyxfy

,

,,

The above two cases are called BVPs with separated boundary conditions.

BVP with general linear boundary values are of the form

54321

54321

,,

BbyBbyBayBayB

AbyAbyAayAayA

yyxfy

Page 70: Advanced Engineering Mathematics presentation

BVP with general boundary conditions are of the form

0,,,,

0,,,,

,,

2

1

bybyayaybg

bybyayayag

yyxfy

The idea of finite difference methods is to discretise the equation by dividing the interval [a,b] into n equal divisions, i.e.

hn

ab say

Page 71: Advanced Engineering Mathematics presentation

bxniihxxax ni ,1,,1, 00 then

The BVP becomes

n

iiii

yyax

yyxfy

,,

,,

00

Now we replace the derivatives by an approximate value of finite difference such as:

Page 72: Advanced Engineering Mathematics presentation

42112

32112

211

11

4642

22

22

h

yyyyyy

h

yyyyy

h

yyyy

h

yyy

iiiiii

iiiii

iiii

iii

Central-difference expressions with error of order h2

Page 73: Advanced Engineering Mathematics presentation

Central-difference expressions with error of order h4

4321123

3321123

22112

2112

6

12395639128

81313812

16301612

88

h

yyyyyyyy

h

yyyyyyy

h

yyyyyy

h

yyyyy

iiiiiiii

iiiiiii

iiiiii

iiiii

Page 74: Advanced Engineering Mathematics presentation

Forward-difference expressions with error of order h

41234

3123

2112

1

464

33

2

h

yyyyyy

h

yyyyy

h

yyyy

h

yyy

iiiiii

iiiii

iiii

iii

Page 75: Advanced Engineering Mathematics presentation

4

12345

31234

2123

12

31426241122

51824143

2542

34

h

yyyyyyy

h

yyyyyy

h

yyyyy

h

yyyy

iiiiii

i

iiiiii

iiiii

iiii

Forward-difference expressions with error of order h2

Page 76: Advanced Engineering Mathematics presentation

Backward-difference expressions with error of order h

44321

3321

211

1

464

33

2

h

yyyyyy

h

yyyyy

h

yyyy

h

yyy

iiiiii

iiiii

iiii

iii

Page 77: Advanced Engineering Mathematics presentation

454321

34321

2321

21

21124261432

31424185

4522

43

h

yyyyyyy

h

yyyyyy

h

yyyyy

h

yyyy

iiiiiii

iiiiii

iiiii

iiii

Backward-difference expressions with error of order h2

Page 78: Advanced Engineering Mathematics presentation

In linear case we have, using the central difference forms with truncation error of O(h2),

1,,1,2

2

0

112

11

niyy

xryxqh

yyxp

h

yyy

n

iiiii

iiii

After some simplifications

1,,1,0

11

niyy

DyCyByA

n

iiiiiii

Where

ii

ii

ii

ii

rhD

hpC

qhB

hpA

2

2

2

2

24

2

Page 79: Advanced Engineering Mathematics presentation

In matrix form

11

2

11

1

2

1

11

222

11

nnnnn CD

D

AD

y

y

y

BA

CBA

CB

O

O

This linear system can be solved by

1.Direct methods (gauss elimination, …)

2. Iterative methods (Jacobi's method, Gauss Seidel method, Successive Over Relaxation method, SOR).

Page 80: Advanced Engineering Mathematics presentation

Example:

3d.tocorrectforFind 12

1

31,32

1

22

xy

yy

yx

y

Take n=5 h=0.1 then

Page 81: Advanced Engineering Mathematics presentation

96.2

04.0

04.0

46.1

8.18.000

9.06.17.00

08.04.16.0

007.02.1

4

3

2

1

y

y

y

y

Using Gauss elimination method

91111111.285000000.2

8285714.2866666667.2

43

21

yy

yy

Page 82: Advanced Engineering Mathematics presentation

In non linear case, using central difference formulas with truncation error O(h2)

1,,1,,

2/,,2

0

112

11

niyy

hyyyxfhyyy

n

iiiiiii

Using simple iteration method, with suitable initial guess

,1,0

1,,1,

2,,

22

1

0

)1(1

)(1)(

2)(1

)1(1

1

k

niyy

h

yyyxf

hyyy

n

ki

kik

iik

ik

iki

Page 83: Advanced Engineering Mathematics presentation

Example:

82,41

21

yy

y

y

xyy

Find y for 1<x<2 correct to 5d.

Upon discritisation we have,

,1,0,1,,18,4

1

222

1

0

)(

)1(1

)(1

)1(1

)(1

2)(

1)1(

1)1(

kniyy

yh

yy

xh

yyhyyy

n

ki

ki

ki

i

ki

kik

ik

ik

i

Page 84: Advanced Engineering Mathematics presentation

Now, takeN=5 h=0.2 After k= 50 iterations and Tol=

610

1.2 4.30868851

1.4 4.74347837

1.6 5.37398310

1.8 6.34221887

ix iy

Page 85: Advanced Engineering Mathematics presentation

Take N=10 h=0.1

After k= iterations

1.1

1.2 4.31464627

1.3

1.4 4.75747894

1.5

1.6 5.39795103

1.7

1.8 6.37355180

1.9

ix iy

Page 86: Advanced Engineering Mathematics presentation

To improve the accuracy1. Either increase n smaller hLarger system of equations2. Use extrapolation,In the above example

Improved 3

14.1 y less accurate

3

44.1 y more accurate y(1.4)

4762145797.4

75747894.43

474347837.4

3

1

hO

Continue to improve accuracy.

Page 87: Advanced Engineering Mathematics presentation

Iterative methods for system of linear equations.To solve

1) Ax=b

Where

nnnnn

n

b

b

b

x

x

aa

aa

A

11

1

111

,,x

2)

nnnnn

nn

bxaxa

bxaxa

11

11111

3)

nibxa

nibxaxan

jijij

inini

,,1

,,1

1

11

4)

Page 88: Advanced Engineering Mathematics presentation

Pivoting , ScalingJacobi’s method: guess nixi ,,1)0(

,1,0

,,11

1

)()1(

k

nixab

ax

n

ijj

kjiji

ii

ki

Test for convergence at each iteration

Tolxx kj

kj )()1( For all j=1,…,n

Page 89: Advanced Engineering Mathematics presentation

Guess – Seidel method

,1,0,,,1

1

,,1

1

)(1

1

)1()1(

)0(

kni

xaxaba

x

nix

n

ij

kjij

i

j

kjiji

ii

ki

iGuess

Test for convergence

Page 90: Advanced Engineering Mathematics presentation

Successive Over Relaxation (SOR) method

,1,0,,,1

,,1

)(1

1

)1()()1(

)0(

kni

xaxaba

xx

nix

n

ij

kjij

i

j

kjiji

ii

ki

ki

i

Guess

Test for convergence

required?isor bopt .

Page 91: Advanced Engineering Mathematics presentation

1. No general formula for

2. depends on the form of A.

3. 0< <2

When 1< <2 we have over relaxation and when 0< <1 we have under relaxation

4. to be calculated numerically.

bb

bb

b

b

Page 92: Advanced Engineering Mathematics presentation

Example: solve

96.2

04.0

46.1

8.18.000

9.06.17.00

08.04.16.0

007.02.1

4

3

2

1

x

x

x

x

w 1 1.1 1.2 1.3 1.4 1.5 1.6

k 34 27 21 15 18 24 30

bw

Minimum When k=1428.1

Page 93: Advanced Engineering Mathematics presentation

Variational methodsVariational methods IntroductionDistance between two points

2

1

2

1

222 1

x

x

x

xdx

dx

dydydxyI

To minimize I[y] set its derivative to zero.

There are certain restrictions on each y which must pass through ,etc. 2211 ,, yxyx &

2y

1y

1x 2x

4y

3y 2y1y

Page 94: Advanced Engineering Mathematics presentation

E-L eqn. yyxFy

yyxFydx

d

,,,,

If F is independent of 0

y

Fy

If F is independent of Cy

F

y

F

dx

dy

0

If F is independent of

0

y

FyF

dx

d

Cy

FyFx

or

Page 95: Advanced Engineering Mathematics presentation

Now to solve the BVP

010

yy

xfyxqyxp

The Rayleigh - Ritz method minimizes the E-L equation

1

0

22 2 dxxuxfxuxqxuxpuI

Choose u to be a linear combination of some basis function such as few first terms of Taylor expansion or in general iicu

Page 96: Advanced Engineering Mathematics presentation

Where are chosen in such away to satisfy the boundary conditions

Now for minimization find

and equate to zero

These are called the normal equations which can be solved by a method of linear systems.

i 010 ii ni

c

I

i

,,1

nic

I

i

,,10

Page 97: Advanced Engineering Mathematics presentation

Example:Let us choose the basis to be the linear functions

10

00

1

11

11

1

1

xx

xxxh

xx

xxxh

xx

xx

x

i

iii

ii

iii

i

i

i

xi

x0

1

1ix ix1ix 1

Page 98: Advanced Engineering Mathematics presentation

The normal equations yield a tridiagonal linear system which can be solved by previously introduced methods.

Example:

010

422 22

yy

xyyxyxGiven

Use h=0.1 and linear approximation.Now given

0

byay

xfQyy

Page 99: Advanced Engineering Mathematics presentation

Then E-L equation

b

a

dxfuQuuuI 222

to be minimized.

B.C.&If2

210 xcxccu

210210

,0,0,0 cccc

I

c

I

c

Igivesthen

B.C.&If3

32

210 xcxcxccu

on.so&

givesthen 3,2,1,03,2,1,00

icic

Ii

i

Page 100: Advanced Engineering Mathematics presentation

Eigen Value Problems(Homogeneous BVP)

Consider the problem:

010

2

yy

yy

To find the nontrivial solution of the above system

,2,1

,2,10sin0sin

01

sin

00

sincos

kk

kkB

y

xBy

y

xBxAy

k

B.C.&

B.C.&

Page 101: Advanced Engineering Mathematics presentation

The Eigen Values are

and are the Eigen functions.

Let us use finite difference method

222 kk xBy kkk sin

1,,10

2

0

2211

niyy

yhyyy

n

iiii

In matrix form, let th 222

0

0

1

1

1

11

1

1

1

ny

y

t

t

t

O

O

Page 102: Advanced Engineering Mathematics presentation

This homogeneous linear system has nontrivial solution when

0

1

1

11

1

det

t

t

t

A

O

O

Choosing n=2 then 21h

and an approximation to the analytical value

80 2 t8696.922

1

Page 103: Advanced Engineering Mathematics presentation

Choosing n=4 then 41h

6274.5422

32

3726.922

0

10

11

01

23

22

21

t

t

t

and

The analytical value of

8264.88

4784.39

8696.9

23

22

21

Page 104: Advanced Engineering Mathematics presentation

Again for improvement there are two methods

1) To increase n and have smaller h leading to a higher degree polynomial equation and hence more round off error.

2) To use extrapolation technique.

In this case

Improved

8301.9

3726.93

48

3

13

4

3

1 21

21

21

accuratemoreaccurateless

Page 105: Advanced Engineering Mathematics presentation

Numerical Solution of PDE(Finite difference method)

We are going to consider

1) Heat equation

2) Steady – State equation

3) Wave equation

Page 106: Advanced Engineering Mathematics presentation

Consider the heat equation in the form

xftxu

ttbu

ttau

tbxax

uD

t

u

,

,

,

0,2

2

To find u(x,t) using finite difference method.

1. Explicit method

As before let nixixxax i ,,1,0, 00

and

Page 107: Advanced Engineering Mathematics presentation

ijji

j

utxu

jtjttt

,

,1,0,0 00

denote

The partial derivatives will be as,

)difference(central

)difference(forward

2

2

1

2

2

1

2xO

x

uuu

x

u

tOt

uu

t

u

jiijiji

ij

ijij

ij

Finally, let 2.

x

Dtr

Upon substitution in the equation,

2111 2 xtOuuuruu jiijjiijij

Page 108: Advanced Engineering Mathematics presentation

Stability condition is

When 2

1r

2

1r

jijiij uuu 111 2

1

The explicit method looks like

i, ji-1, j i+1, j

i, j+1

Page 109: Advanced Engineering Mathematics presentation

In the whole problem

iju

a bx

t

Problem:Problem: show that when the local truncation error will reduce to

The restriction on r causes higher number of operations which leads to higher round off error.

Hence we move to implicit procedures.

6

1r

42 xtO

Page 110: Advanced Engineering Mathematics presentation

2.Implicit methods

Let us replace by a linear combination of the known time step and the unknown (next) time step as follows,

2

2

x

u

10

11

2

2

2

2

where

ijijij x

u

x

uD

t

u

When then we have the Explicit method.

When then we have the Implicit Crank - Nicolson method

2

1

Page 111: Advanced Engineering Mathematics presentation

When then we have the fully implicit method (backward difference method)

Implicit Crank – Nicolson method

11111111 222 jiijjijiijjiijij uuuuuur

uu

The diagram of this method looks like

i-1j+1 ij+1 i+1j+1

i-1j ij i+1j

Rearrangement of the equation yields

Page 112: Advanced Engineering Mathematics presentation

,1,0,1,,2,12

12

21

2

11

11111

jni

ur

urur

b

bur

urur

jiijjiij

ijjiijji

where

This system of (n-1) equation in (n-1) unknown must be solved for each time step j . Therefore j can be omitted at each time step, that is

For each j=0,1,…

1,,2,12

12 11

ni

bur

urur

iiii

Page 113: Advanced Engineering Mathematics presentation

Taking into consideration the boundary conditions then in matrix form,

nnn ur

b

b

ur

b

u

u

rr

rr

r

rr

O

O

2

2

12

21

2

21

1

2

01

1

1

Page 114: Advanced Engineering Mathematics presentation

This system can be solved by SOR method,

For each j=0,1,…

,1,0;1,,2,1

21

21)(1

)()1(1

)()1(

kni

ur

urur

br

uu ki

ki

kii

ki

ki

k is the number of iterations

In this special case is found to be.opt

nr

rb

cos1

,11

22

Page 115: Advanced Engineering Mathematics presentation

Example Given

201020

1000,

0100,20

16.0,00,0

0,2002

2

xx

xxxu

ttu

Dttu

txx

uD

t

u

Find at x=4,8,12,16

and at x=2,4,…,18

,xu

Page 116: Advanced Engineering Mathematics presentation

As you know

Take r=1 and then and for each j

216.0

x

tr

4x 100t

00

4

6

6

4

25.000

5.025.00

05.025.0

005.02

50

4

3

2

1

uu

u

u

u

u

&thatnote

Page 117: Advanced Engineering Mathematics presentation

100

27273.3

09091.5

09091.5

27273.3

4

3

2

1

t

u

u

u

u

at

For the next time step and00 u 1005 u

545455.52

18182.4

18182.4

545455.2

4

3

2

1

b

b

b

b

Page 118: Advanced Engineering Mathematics presentation

Now at t=200

7373.55

8582.17

33188.7

1057.3

50

4

3

2

1

4

3

2

1

4

3

2

1

u

u

u

u

b

b

b

b

u

u

u

u

A

& so on.

Page 119: Advanced Engineering Mathematics presentation

Elliptic ProblemsConsider the Poisson equation

mjni

jkcyihax

yxgyxu

dycbxa

yxfy

u

x

uyxu

ji

,,1,0,,1,0

,,

,

,,2

2

2

22

andfor

andlet

boundariestheonwith

on

Page 120: Advanced Engineering Mathematics presentation

ax 0 1x 2x 3x 4x nxb

cy 0

1y2y

dym

y

x

Page 121: Advanced Engineering Mathematics presentation

Let us use the central differential formula for both derivatives, then

1,,1;1,,1

2

22

222211

211

2

2

11

2

11

mjni

fkhukhuuhuuk

fk

uuu

h

uuu

ijijijijjiji

ijijijijjiijji

or

The diagram looks like

Page 122: Advanced Engineering Mathematics presentation

ij+1

i+1jiji-1j

ij-1

Five point formula.

Page 123: Advanced Engineering Mathematics presentation

This linear system of (n-1)(m-1) equations and unknowns can be solved by Gauss – Seidel method or by SOR method with

mnc

cb

coscos2

1

11

22

where

Page 124: Advanced Engineering Mathematics presentation

Example:Example:Find , given the Poisson equation ji yxu ,

80,6022

2

2

2

yxy

u

x

u

u=0 on the boundaries.

Take a) h=k=2 b) h=k=1

For the case a) there are 6 unknowns ijui=1,2 ; j=1,2,3

2111

2221

2331

uu

uu

uu

8

6 x

y

Page 125: Advanced Engineering Mathematics presentation

3,2,1,2,1

84

11111

ji

uuuuu ijijjijiij

Using the symmetric property (in this particular problem) we have

56.456.4

72.572.5

56.456.4

2313

2212

2111

uu

uu

uu

For the case b) there are 35 linear equations in 35 unknowns 7,,1;5,,1? jiuij

Page 126: Advanced Engineering Mathematics presentation

Using the symmetric property the system will be reduced to 12 equations in 12 unknowns.

x x x

x x x

x x x

x x x

8

6 x

y

Page 127: Advanced Engineering Mathematics presentation

Preparing the system to be solved by SOR it looks like

b

kij

kij

kij

kji

kji

bkij

kij

ji

uuuuuuu

7,,15,,1

484

)()(1

)1(1

)(1

)1(1

)()1(

The results are as follows

647.6960.5181.3

335.6686.5657.3

319.5794.4123.3

353.3047.3042.2

Page 128: Advanced Engineering Mathematics presentation

Hyperbolic Problem Hyperbolic Problem (Wave equation)(Wave equation)

Page 129: Advanced Engineering Mathematics presentation

Two dimensional heat equation in Cartesian coordinates

(AAlternative lternative DDirection irection IImplicit methodmplicit method) ADIADI

Page 130: Advanced Engineering Mathematics presentation

Fourier SeriesFourier SeriesPower series play an integral part in real(& complex)

analysis.

Taylor Series in ODE

Fourier Series in PDE

Definition:Definition: Two nonzero f(x) and g(x) are said to be orthogonal on the interval with respect to the weight function (x) if their scalar product vanishes:

bxa

b

adxxgxfx 0

Page 131: Advanced Engineering Mathematics presentation

ExampleExample

0sinsin

2,0

1sinsin

2

0

dxmxnx

xnmmxnx

onarthogonal

areand

2l – periodic function means xflxf 2

Problem:Problem: the set of function

l

xn

l

xn sin,cos,1

are orthogonal over the interval with respect to the weight function (x)=1 .

lxl

Page 132: Advanced Engineering Mathematics presentation

Furthermore,

l

l

l

l

l

lldx

l

xndx

xnldxl

222 sin

2cos;2

Let f(x) be sufficiently smooth function defined on and periodic with period 2l.

Then we seek to express f(x) as an infinite linear sum of sines and cosines having the same period as f(x), namely 2l.

We assume that

lxl

10 sincos

2

1

nnn l

xnb

l

xnaaxf

Page 133: Advanced Engineering Mathematics presentation

Where and the coefficients and are found to be

0a na nb

l

ln

l

ln

l

l

dxl

xnxf

lb

n

dxl

xnxf

la

dxxfl

a

sin1

,2,1

cos1

10

Page 134: Advanced Engineering Mathematics presentation

CorollaryCorollaryWhen f(x) is periodic, piecewise smooth function, its

Fourier series converges to [f(x+)+f(x-)]/2.

Example 1. Find the Fourier series of f(x)=x 0<x<2l and is 2l – periodic

02

sin1

00cos1

21

2

0

2

0

2

00

nn

ldx

l

xnx

lb

ndxl

xnx

la

lxdxl

a

l

n

l

n

l

Page 135: Advanced Engineering Mathematics presentation

Therefore

1 1

sin12

1sin2

n n l

xn

nl

l

xn

n

llxf

y

x

L

2L

2L 4L 6L

Page 136: Advanced Engineering Mathematics presentation

Example 2.Example 2.Find the Fourier series of

and is of period 2l lxlxxf 2

Page 137: Advanced Engineering Mathematics presentation

1

2

2

122

222

12

2

2

22

2

22

22

22

0

6

1

,14

3

cos14

3

00sin1

014

cos1

3

21

n

n

n

l

ln

nl

ln

l

l

n

n

llllx

l

xn

n

llxf

ndxl

xnx

lb

nn

ldx

l

xnx

la

ldxx

la

hence

At

Page 138: Advanced Engineering Mathematics presentation

Complex FormComplex Form

Knowing that

2cos

2sin

ii

ii

ee

i

ee

and

Then the Fourier series of f(x) takes the form

lxin

n

nnlxin

n

nn

n

lixn

lixn

n

lxin

lxin

n

eiba

eibaa

i

eeb

eea

axf

11

0

1

0

222

222

Page 139: Advanced Engineering Mathematics presentation

l

l

lxin

n

n

lxin

n

nnn

nnn

dxexfl

c

ecxf

niba

c

niba

cac

2

1

02

02

,20

0

where

then

andLet

Page 140: Advanced Engineering Mathematics presentation

Fourier Sine and Cosine SeriesFourier Sine and Cosine Series1. When f(x) is an even function then

1

0

0

cos2

0,cos2

nn

l

nn

l

xna

axf

bdxl

xnxf

la

The cosine expansion of f(x)

2. When f(x) is an odd function then

1

00

sin

sin2

,0

nn

l

nn

l

xnbxf

dxl

xnxf

lbaa

The sine expansion of f(x)

Page 141: Advanced Engineering Mathematics presentation

Fourier IntegralFourier IntegralThe Fourier series extension to none periodic

functions leads to Fourier Integral

Consider a periodic function of period 2l. Its Fourier expansion is

xfl

.,sincos2

0

l

nxbxa

axf nnnnnl

where

Now let and set

that is

llnn

1

l

1

Page 142: Advanced Engineering Mathematics presentation

1

sinsincoscos1

1

n

l

l nln

l

l nln

l

l ll

duuufxduuufx

duufl

xf

If and f is absolutely integrable

then using the idea of definite integrals,

xfxf ll

lim

0sinsincoscos

1

dduuufxduuufxxf

0

sincos dxBxAxfor

Page 143: Advanced Engineering Mathematics presentation

duuufBduuufA

sin1

,cos1

where

Example:Example:Find the Fourier integral representation of the function

0sin1

sin2cos

1cos

1

10

11

1

1

duuufB

duuduuufA

x

xxf

if

if

Page 144: Advanced Engineering Mathematics presentation

dx

xf

0

sincos2

Page 145: Advanced Engineering Mathematics presentation

Powered by:WPiS

Web Pardaz Internet Services

کننده :تهيهپرداز پرداز وب وب

مجری طرح های اينترنتی و اساليدهای آموزشی

آدرس با توانيد می بيشتر اطالعات کسب جهت

[email protected]

. نماييد مکاتبه