Advanced Engineering Mathematics Presentation

  • Uploaded by: reborn2
  • 0
  • 0
  • February 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Advanced Engineering Mathematics Presentation as PDF for free.

More details

  • Words: 9,894
  • Pages: 145
Loading documents preview...
Advanced Engineering Mathematics A.Emamzadeh

Spring 2009

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

Reference texts [1]

Faires & Burden

Numerical Methods 3rd ed. ,Brooks/Cole 2003

[2]

Froberg

Introductions to Numerical Analysis, AddisonWesley

[3]

Powers

Boundary Value Problems

[4]

Pipes & Harvill

Applied Mathematics for Engineers and Physicists, McGraw-Hill

[5]

Churchill

Complex variable and applications

Ordinary Differential Equations 1) 2) 3)

Introduction Initial Value Problems (IVP) Boundary Value Problems (BVP)

1) Introduction 1- Sources of errors 1.1- Initial data error 1.2- Round off error 1.3- Truncation error 2- Type of problems 2.1- well – behaved 2.2- ill – conditioned 3- Stability 4- Big

Oh

2) Methods of solving IVP 1- Introduction 2- Taylor series method 3- Single step methods 4- Multi step methods 5- Extrapolation methods

3) Methods of solving BVP 1- Shooting methods 2- Finite difference methods 3- Variational methods 4- Eigen Value Problems (EVP)

Types of problems in IVP Single first order equation  System of n first order equations  Single n th order equation 

Single first order equation y   f ( x, y)

, with initial condition (IC),

y ( x0 )  y 0

To find y at x1 to a specified accuracy.

System of n first order equations y1  f1 ( x, y1 ,..., yn )  yn  f n ( x, y1 ,..., yn ), With initial conditions

y1 ( x 0 )  y10  y n ( x0 )  y n 0 To find y1,…yn at x1 to a specified accuracy.

In matrix form

Y   F(x,Y) Y(x0 )  Y0

Where

and

Y  y1 ,, yn  F   f1 ,, f n 

t

t

Single n th order equation y

(n)

( n 1)     f ( x, y , y , y ,  , y ),

with initial conditions y ( x0 )  y10 ,  , y

( n 1)

( x0 )  yn 0

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

y  y1

Let

y  y2  y ( n 1)  yn

then

yn  f  x, y1 , y2 ,  , yn  and

y1 ( x0 )  y10 ,  yn ( x0 )  yn 0 The whole system can be written in the matrix form

Y   F ( x,Y ) Y ( x0 )  Y0 Where

Y  y1,  , yn  and F  y2 , y3 , , yn , f  t

t

Finally we are dealing with the form

y   f ( x, y )

as a single first order equation or

y ( x0 )  y 0

as a system of n first order equations

Taylor series method y   f ( x, y ) y ( x0 )  y 0

To find y at x1 correct to md

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

h2 h3 y  x1   y x0  h   y0  hy0  y0  y   2! 3!

here

y0

is given

y0  f ( x0 , y0 )  f f  y0    f  y  0  x    f f    f f    f   f  y0     f y  y  x y  0  x  x

and so on Example : Given

y   3  x  y 2

y 0   1 y 0   2

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

w e have

y  1  2 yy ( 4) 2 y  2 y  yy

y(0)  2  y(0)  5 

y  23 yy  yy  (5)

y (0)  12 ( 4)

y (0)  14 (5)

5 3 1 4 7 5 y h   1  2h  h  h  h  h   6 2 60 2

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

Taking n=10 y(0.1)= .8107846019 y(0.5)= .3276448999 y(1.0)= .4951609347 y(2.0)= 9.887477949

Compare the accuracy

Single step methods Def.: Local truncation error Global truncation error Order of a method

First order method (Euler's method) Statement of the problem given

y  f x, y  yx0   y0

To find y at x=b correct to md Let b-x0=h then

y b   y0  hy0  y0  h f  x0 , y0  

oh 

Here O(h2) is the local truncation error In the standard form

yn1  yn  k1

k1  h f xn , yn 

where

n  0,1, 

2

Second order methods

 

1. yn 1  yn  k 2  O h k1  h f xn , yn 

2

where

h k1   k 2  h f  xn  , y n   2 2  2 and O h is the global truncation error

 

 

1 1 2 2. yn 1  yn  k1  k 2  O h 2 2 k1  h f  xn , yn  k 2  h f xn  h, yn  k1 

 

Oh

2

as before g.t.e.

where

A third order method 1 3 yn 1  yn  k1  4k 2  k3   Oh  6 where k1  h f xn , yn  h k1   k 2  h f  xn  , y n   2 2  k3  h f xn  h, yn  2k 2  k1 

n  1,2,

A 4th order method (runge – kutta) yn 1

 

1  yn  k1  2k 2  2k3  k 4   O h 4 6

where

k1  h f  xn , yn  h k1   k 2  h f  xn  , y n   2 2  h k2   k 3  h f  xn  , y n   2 2   k 4  h f  xn  h, yn  k3 

Example:

y   sin  x  2 y  y y 0   1 , y0   2

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

Let

y  p then p  sin x  2 y  p  y 0  1 p0  2

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

1 y1  y0  k1  k 2  2 1 p1  p0  l1  l2  2 where

k1  h p0

k 2  h p0  l1 

l1  h sin x0  2 y0  p0 

l2  h sinx0  h   2 y0  k1    p0  l1 

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

Modified Euler's method ynp1  yn  h f xn , yn 

  

  



h p 2 y  yn  f xn , yn   f xn 1 , yn 1  O h 2 2 where O h is the g.t.e. c n 1

Mid - Point rule

yn 1  yn1  2hf xn , yn   Oh where O

2



h  is the local truncation error. 2

How to control the truncation error 1)

2)

By lowering the step size and repeat the whole calculations: Runge-Kutta method By considering the 1st neglected term in the Taylor expansion: Merson’s method A 2nd and third order method Fehlberge’s method

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

y n 1  y n  where

k1

6 k1  hf

k 2  hf k 3  hf k 4  hf k 5  hf E 



 4k 4  k5   O h 5



 xn , y n    xn    xn    xn    xn 

h h1   , yn   3 3  h k k   , yn  1  2  3 6 6  k  h k  , yn  1  3 3  2 8 8  k3 k1   h, y n  3  2k 4  2 2 

1 2k1  9k3  8k 4  k5  30

Fehlberg method ~

16 6656 28561 9 2 k1  k3  k4  k5  k6 135 12825 56430 50 55 25 1408 2197 1  yn  k1  k3  k 4  k5 216 2565 4104 5

y n 1  y n  y n 1

where

k1  hf  xn , y n  h 1   k 2  hf  xn  , y n  k1  4 4   3h 3 9   k3  hf  xn  , yn  k1  k2  8 32 32   12h 1932 7200 7296   k 4  hf  xn  , yn  k1  k2  k3  13 2197 2197 2197   439 3680 845   k5  hf  xn  h, y n k1  8k 2  k3  k4  216 513 4104   h 8 3544 1859 11   k 6  hf  xn  , y n  k1  2k 2  k3  k4  k5  2 27 2565 4104 40  

Multi step methods Predictor formulas  Corrector formulas 

Predictor formulas yn 1  yn  h f n 1 3  yn 1  yn  h  f n  f n 1  2 2  16 5  23  yn 1  yn  h  f n  f n 1  f n 2  12 12  12  59 37 9  55  yn 1  yn  h  f n  f n 1  f n 2  f n 3  24 24 24  24  2774 2616 1274 251  1901  yn 1  yn  h  fn  f n 1  f n2  f n 3  f n4  720 720 720 720  720  7923 9982 7298 2877 475  4277  yn 1  yn  h  fn  f n 1  f n2  f n 3  f n4  f n 5  1140 1440 1440 1440 1440  1140 

Corrector formulas 1  1 yn1  yn  h  f n1  f n  2  2 8 1 5  yn1  yn  h  f n1  f n  f n1  12 12   12 19 5 1 9  yn1  yn  h  f n1  f n  f n1  f n 2  24 24 24  24  646 264 106 19  251  yn1  yn  h  f n1  fn  f n1  f n2  f n 3  720 720 720 720  720  1427 798 482 173 27  475  yn1  yn  h  f n1  fn  f n 1  f n2  f n 3  f n4  1440 1440 1440 1440 1440  1440 

Extrapolation methods 1.Introduction: Consider calculating p as the area of a unit circle (Fig.1), by calculation of the area of n sided polygon inscribed in the circle.

Let

A0n

be the area of n sided polygon.

n n  2p  A  sin n  sin   2 2  n  n 0

n 1

Fig. 1

Using Taylor expansion of Sin x 3 5 7    2p   2p   2p          n 2 p n  n  n  A0n         2 n 3! 5! 7!     a6 a2 a4  p  2  4  6  n n n

Where a2, a4, a6, … are constants, do not depend on n. Now if we double n then

a6 a2 a4 A p  2    4 6 4n 16n 64n 2n 0

To form a linear combination of A0n and A02 n in such away that in the linear combination the first term be p and the second term vanishes, that is, for some a and b say

b4 b6 b8 aA  bA  A  p  4  6  8   n n n n 0

2n 0

n 1

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

a  b 1

The implies that

and

a   13

a and

b

0

4 b 4

3

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

b6 b8 b4 A p     4 6 8 16n 64n 256n 2n 1

Again to form a linear combination of

n 1

A

and

2n 1

A

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

aA  bA n 1

2n 1

say

c6 c8  A  p  6  8  , n n n 2

say

c6 c8 aA  bA  A  p  6  8  , n n Where c6, c8, … are constants, do not depend on n. n 1

Then

2n 1

n 2

a  b 1

and

a

b

16

 0,

1 16 this impliesthat a   and b  15 15 n 1 4 In general a   n and b  n 4 1 4 1 for n  1,2,

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

A

2n 0

A

4n 0

A

8n 0

A

1

4

3

3

n 1

A

2n 1

A

4n 1

A

1 15 16 15

n 2

A

2n 2

A

1 64

63

63

n 3

A

Note that truncation error of the columns respectively are

 1   1   1 O 2 , O 4 , O 6 ,  and so on. n  n  n 

Numerically 1. Starting with a triangle (the least accuracy), we have

A 

1.299038

A 

2.598077

3.03109

3.000001

3.133975

3.140834

3.105829

3.141105

3.141581

3.141593

3.132629

3.141563

3.141593

3.141593

3 0

6 0

A  A  A  12 0 24 0 48 0

Are these coefficients (a and b) general?

3.141593

A04 

2

A08 

2.828427

3.10457

3.061468

3.139148

3.141453

3.121446

3.141439

3.141591

3.141593

3.136549

3.141584

3.141593

3.141593

A  A  A  16 0 32 0 64 0

3.141593

A05 

2. 377642

A010  2.938927

3.126022

A020 

3.09017

3.140584 3.141555

A 

3.12869 3.3014153 3.141593 3.141593

40 0 80 0 160 0

A  3.138364

A

 3.140786

3.141489 3.141593 3.141594 3.141594 3.141593 3.141593 3.141593 3.141593 3.141593

A010  2. 938926 20 0

 3.09017

40 0 80 0 160 0 320 0

 3.12869  3.138364  3.140786  3.141391

A

A A A A

3.140584 3.14153

3.141593

3.141589 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593 3.141593

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

Extrapolation in differentiation Starting with central difference formula for the first and second derivative f x  h   f x  h  f x    O h2 2h f x  h   2 f x   f x  h  2   f x    O h h2

 

 

Denote the RHS of (1) as

h 0

F

(1) (2)

and the RHS of (2) as

S

h 0

Similar extrapolation table looks like F0h h 2 0

F

1

4

3

3

h 4 0

F

F1h F1

1 15

h 16 2 15

F2h

The truncation error of the columns in order are

    and Oh  and so on.

O h2 , O h4

6

Similarly for the second derivative

Extrapolation in integration Consider the trapezoidal rule

 

b

 f x dx  T

h 0

O h

2

a

h  where T  f 0  f n  2 f i   2 i 1  n 1

h 0

h 0

T

h 2 0

T

h 4 0

T

1

4

3

3

h 1

T

T1

1 15

h 16 2 15

T2h

Extrapolation in IVP Suppose y'=f(x,y) , y(x0)=y0 to find y(b) correct to md, with extrapolation method. Start with Mid-Point rule

 

y1  y1  2hf  x0 , y0   O h

2

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)

therefore with h<0

y  y0  hf  x0 , y0  E 1

and





h E y  y0  f  x0 , y0   f x1 , y1 2 c 1

If we denote

h 0

y1 by Y

then in extrapolation notation

Y0h h 2 0

Y

h 4 0

Y

1

4

3

3

Y1h Y1

1 15

h 16 2 15

Y2h



And so on. Compare this method with single step methods and multi step methods.

Example Consider y'=y , y(0)=1 correct to 3d . start with h=1 , y0=1 , x0=0 y

E 1

0

, y

c 1

. To find y(1)

1 1  1  1  0  2 2

1  2  2.5 2 1 with h 2 1 1 E y 1  1   2 2 5 13 y1   1  8 8

Y01 

1 1 5 y  1  1    4 2 8 1 13 21 y2  1    Y0 2 8 8 c 1

1 1 4 12 Y   Y0  Y0 3 3 1  5  4  21  5 7 16            2.6666 3 2 3 8  6 2 6 1 1

1

1

To continue calculate Y0 4 and Y0 8 and extrapolate.

Shooting methods Statement of a boundary value problem  y  f x, y, y Given   ya   a , yb  b Find y for a<x
Let us start with secant method as the root finder Step 1. Guess S0=y'(a) Step 2. Solve the IVP

y  f x, y, y , ya   a , ya   S0 ,

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

Step 3. Guess S1  ya   S0

if

yb, S0   b

S1  ya   S0 if

Step 4. Solve the IVP

y  f x, y, y ,

to find y(b, S1).

ya   a

,

otherwise

yb, S0   b

ya   S1 ,

Is y(b, S1)=b  If yes then stop, otherwise continue. Step 5. Find the next Sn+1 ,using secant method.

 y b, S n   b S n  S n 1  S n 1  S n  y b, S n   y b, S n 1  Step 6. Solve the IVP

y  f x, y, y ,

to find

yb, Sn1 

ya   a , ya   Sn1 ,

Step 7. Test for convergence Is

yb, Sn1   b  Tol

Step 8. Go to step 5.

n  1,2, 

if yes then stop

Example 1:

2 Given y     y   2  [note that this is a linear differential equation] x 1 y   3 , y 1  3 2 To find y for

1  x  1 correct to 3d. 2

S0  1

y 1, S 0   3.7500

1 S1  2

y 1, S 0   3.6250

3.6250  3  1 

1 2  S2    2 2 3.6250  3.7500 y 1, S 2   3.0001

x

y

0.5

3

0.6

2.8667

0.7

2.8287

0.8

2.8501

0.9

2.9112

1

3.0001

Example 2:  1 2 y  [this is a nonlinear differential equation] Given y  y   y  x y 1  4 , y 2  8 To find y for 1<x<2 correct to 3d.

F S   y2, S   8  0

 y2, S n   8S n  S n 1  S n 1  S n  y2, S n   y2, S n 1 

n  1,2,

S0  2 S1  1 S 2  1.16667 S3  1.375 S 4  1.328125 S 5 1.3331706 S 6  1.333333

y 2, S 0   16

y 2, S1   6.4

y 2, S 2   7.111111

y 2, S3   8.2580645

y 2, S 4   7.9688716

y 2, S5   7.9902356

y 2, S 6   8.000000

x

y

1

4

1.1

4.1450

1.2

4.3165





1.9

7.0793

2

7.9994

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

 y  f  x, y, y  y f y f y       S y S y S  y a   a   ya   S 0   y a   0  S  ya   1  S

(1)

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

y y b, S0  , b, S0  S S Step 3. Find a new Sn using Newton’s method yb, S n   b S n 1  S n  n  0,1, y b, Sn  s Step 4. Solve the system(1) with new Sn=y'(a)

Step 5. Test for convergence, i.e.

yb, Sn   b  Tol

if yes then stop

Step 6. Go to step 3. Example: Find y for 1<x<2, given

 1 2 y   y  y  y  x y 1  4 , y 2  8 guess

S0  2

now to solve system(1) let us denote

y Y S

and

y U S

then

if y   p

then

 1 2p   p  p  y  x Y U  1 4p  2 p2   U U    2  Y    y y  x y 1  4 p 1  S 0

Y 1  0 U 1  1

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

y 2, S 0   16 this implies

and

y 2, S0   24 S

S1  1.66666667

Next five iterations yields S1  1.66666667 y 2, S1   10.6666667 S 2  1.416666667

y 2, S 2   8.5333333

S3  1.33854166

y 2, S3   8.03137248

S 4  1.333353689

y 2, S 4   8.00012208

S5  1.33333333

y 2, S5   8.000000

y 2, S1   10.6666667 S y 2, S 2   6.82666667 S y 2, S3   6.04715063 S y 2, S 4   6.00018279 S y 2, S5   6.000000 S

Finite difference methods Statement of the problem: Given the BVP y  f  x, y, y

y a   a

,

y b   b

Find y for a<x
y  p x  y  q x  y  r  x  y a   a , y b   b

2. Non linear equation

y  f  x, y, y y a   a , y b   b

The above two cases are called BVPs with separated boundary conditions. BVP with general linear boundary values are of the form

y  f x, y, y A1 y a   A2 ya   A3 y b   A4 yb   A5 B1 y a   B2 ya   B3 y b   B4 yb   B5

BVP with general boundary conditions are of the form

y  f x, y, y g1 a, y a , ya , y b , yb   0

g 2 b, y a , ya , y b , yb   0 The idea of finite difference methods is to discretise the equation by dividing the interval [a,b] into n equal divisions, i.e.

b  a say  h n

then x0

 a, xi  x0  ih i  1,, n  1, xn  b

The BVP becomes

yi  f xi , yi , yi  x0  a,

y0  a ,

yn  b

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

Central-difference expressions with error of order h2

yi  yi  yi yi

yi 1  yi 1 2h yi 1  2 yi  yi 1 2 h yi  2  2 yi 1  2 yi 1  yi  2 3 2h yi  2  4 yi 1  6 yi  4 yi 1  yi  2 h4

Central-difference expressions with error of order h4

yi  yi  yi yi

 yi  2  8 yi 1  8 yi 1  yi  2 12h  yi  2  16 yi 1  30 yi  16 yi 1  yi  2 12h 2  yi 3  8 yi  2  13 yi 1  13 yi 1  8 yi  2  yi 3 8h 3  yi 3  12 yi  2  39 yi 1  56 yi  39 yi 1  12 yi  2  yi 3 6h 4

Forward-difference expressions with error of order h

yi  yi  yi yi

yi 1  yi h yi  2  2 yi 1  yi 1 h2 yi 3  3 yi  2  3 yi 1  yi 3 h yi  4  4 yi 3  6 yi  2  4 yi 1  yi 4 h

Forward-difference expressions with error of order h2

yi  yi  yi yi

 yi  2  4 yi 1  3 yi 2h  yi 3  4 yi  2  5 yi 1  2 yi h2  3 yi  4  14 yi 3  24 yi  2  18 yi 1  5 yi 3 2h  2 yi 5  11yi  4  24 yi 3  26 yi  2  14 yi 1  3 yi h4

Backward-difference expressions with error of order h

yi  yi  yi yi

yi  yi 1 h yi  2 yi 1  yi 1 2 h yi  3 yi 1  3 yi  2  yi 3 3 h yi  4 yi 1  6 yi  2  4 yi 3  yi  4 4 h

Backward-difference expressions with error of order h2

3 yi  4 yi 1  yi  2 yi  2h 2 yi  5 yi 1  4 yi  2  yi 3 yi  2 h 5 yi  18 yi 1  24 yi  2  14 yi 3  3 yi  4 yi 3 2h 3 yi  14 yi 1  26 yi  2  24 yi 3  11yi  4  2 yi 5 yi 4 h

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

yi 1  2 yi  yi 1 yi 1  yi 1  p  xi   q xi  yi  r  xi  2 h 2h y0  a , y n  b i  1,  , n  1

After some simplifications

Ai yi 1  Bi yi  Ci yi 1  Di y0  a ,

yn  b

Where Ai  2  hpi

Bi  4  2h 2 qi Ci  2  hpi Di  2h 2 ri

i  1,, n  1

In matrix form

 B1   A2    O 

C1 B2 C2   

O   y1   D1  A1a 

  An 1

    D2   y2                     Bn 1   yn 1   Dn 1  Cn 1b 

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).

Example:

2  y  2 y  x 1 y   3 , y 1  3 2 1 Find y for  x  1 correct to 3d. 2 Take n=5

 h=0.1

then

0 0   y1    1.46   1.2 0.7    0.6  1.4 0.8    y 0 0 . 04 2        0 0.7  1.6 0.9   y3   0.04       0 0.8  1.8  y4   2.96  0 Using Gauss elimination method

y1  2.866666667

y2  2.8285714

y3  2.85000000

y4  2.91111111

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

yi 1  2 yi  yi 1  h f xi , yi ,  yi 1  yi 1  / 2h  2

y0  a ,

yn  b

,

i  1,, n  1

Using simple iteration method, with suitable initial guess (k ) ( k 1) 2

1 ( k 1) h  (k ) ( k ) yi 1  yi 1 y  yi 1  yi 1  f  xi , yi , 2 2  2h y0  a , yn  b i  1,, n  1 k 1 i





k  0,1,

  

Example:

 1 2 y   y  y  y  x y 1  4 , y 2  8 Find y for 1<x<2 correct to 5d. Upon discritisation we have, yi( k 1)

(k ) ( k 1) (k ) ( k 1) 2     y  y y  y 1 ( k 1) h 1 (k ) i 1 i 1 i 1 i 1   yi 1  yi 1        (k ) 2 2  2h h yi   xi 

y0  4 ,

yn  8

i  1,, n  1 , k  0,1,

Now, take N=5 h=0.2





After k= 50

iterations and Tol=

10

6

xi

yi

1.2

4.30868851

1.4

4.74347837

1.6

5.37398310

1.8

6.34221887

Take N=10 After k=

 h=0.1 iterations

xi 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9

yi 4.31464627 4.75747894

5.39795103 6.37355180

To improve the accuracy

1. Either increase n  smaller h Larger system of equations 2. Use extrapolation, In the above example



1 4 Improved y 1.4    less accurate y1.4  more accurate y(1.4) 3 3

1 4   4.74347837   4.75747894 3 3  4.762145797  O h 4

 

Continue to improve accuracy.



Iterative methods for system of linear equations. To solve  a11   a1n   x1   b1  1) Ax=b

       , x    ,b    Where A               a a x nn   n1  n bn 

2) a11 x1    a1n xn  b1

 an1 x1    ann xn  bn 3) ai1 x1    ain xn  bi n

4)

a x j 1

ij

j

 bi

i  1, , n i  1,, n

Pivoting

,

Scaling i  1, , n

( 0) i

Jacobi’s method: guess x ( k 1) i

x

  n 1  (k )   bi   aij x j  aii  j 1   j i

i  1,, n  k  0,1,

Test for convergence at each iteration

x

( k 1) j

x

(k ) j

 Tol

For all

j=1,…,n

Guess – Seidel method Guess

(0) i

x

i  1,, n

i 1 n   1 ( k 1) ( k 1) (k ) xi  bi   aij x j   aij x j  aii  j 1 j i 1  i  1,, n , k  0,1, 

Test for convergence

Successive Over Relaxation (SOR) method Guess

( 0) i

x

i  1, , n

i 1 n    ( k 1) (k ) ( k 1) (k ) xi  xi  bi   aij x j   aij x j  aii  j 1 j i  i  1,, n , k  0,1,

Test for convergence

opt . or b

is required?

1. No general formula for  b 2.  bdepends on the form of A. 3. 0<  b<2 When 1<  b <2 we have over relaxation and when 0<  b<1 we have under relaxation 4.  bto be calculated numerically.

Example: solve 0 0   x1    1.46   1.2 0.7    0.6  1.4 0.8    x 0 0 . 04 2        0 0.7  1.6 0.9   x3          0 0.8  1.8  x4   2.96  0 wb w

1

1.1

1.2

1.3

1.4

1.5

1.6

k

34

27

21

15

18

24

30

When

  1.28

Minimum

k=14

Variational methods Introduction Distance between two points 

I y  

x2

x1

dx  dy  2

2



2

 dy  1    dx  dx 

x2

x1

To minimize I[y] set its derivative to zero. There are certain restrictions on each y which must pass through x1 , y1  & x2 , y2  ,etc. y4 y2 y 3 y 2 y1

y1 x1

x2

  d   E-L eqn. F x, y, y  F x, y, y  dx  y  y If F is independent of y 

F 0 y

d  F  F C If F is independent of y     0  dx  y  y

F C If F is independent of x  F  y  y or

d  F  F  y   0  dx  y 

Now to solve the BVP

 

  px  y   qx  y  f x  y 0  y 1  0

The Rayleigh - Ritz method minimizes the E-L equation 1





I u    px ux   qx u x   2 f x u x  dx 2

2

0

Choose u to be a linear combination of some basis function such as few first terms of Taylor expansion or in general u   cii

Where i are chosen in such away to satisfy the boundary conditions i 0  i 1  0 I Now for minimization find i  1,, n ci I and equate to zero 0 i  1,  , n



ci



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

Example: Let us choose the basis to be the linear functions 0  x  xi 1 0 x  x i 1  xi 1  x  xi  hi 1 i x     xi 1  xi xi  x  xi 1  hi  xi 1  x  1 0

i  x  1

0

xi 1 x i

xi 1

1

x

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

2     x y  2 xy  2 y  4 x 2

y0  y1  0

Use h=0.1 and linear approximation. Now given

y  Qy  f x  y a   y b   0

Then E-L equation b





I u    u  Qu 2  2 fu dx 2

a

to be minimized. If

u  c0  c1 x  c2 x

then

&

B.C.

I I I 0 ,  0, 0 c0 c1 c2

then

If

2

u  c0  c1 x  c2 x  c3 x 2

I 0 ci

& so on.

i  0,1,2,3

3

gives

gives

c0 , c1 c2

&

B.C.

ci

i  0,1,2,3

Eigen Value Problems (Homogeneous BVP) Consider the problem:

y  2 y

y0  y1  0 To find the nontrivial solution of the above system y  A cos x  B sin x

y 0  0  y  B sin x & B.C. y 1  0  B sin   0  sin   0    kp  k  kp  k  1,2, &

B.C.

k  1,2,

The Eigen Values are   k p and y k  Bk sin k x are the Eigen functions. Let us use finite difference method 2 2 yi 1  2 yi  yi 1   h yi 2 k

y0  y n  0

2

i  1,, n  1

In matrix form, let  2  2 h 2  t t 1 O  y1  0      1 t 1             1          1       O   yn 1  0 1 t  

2

This homogeneous linear system has nontrivial solution when

det A 

t 1

O

1 t 1      1

O 0 1 t

Choosing n=2 then h  1 2 2 t  0    8 an approximation and to the analytical value 12  p 2  9.8696

Choosing n=4 then h  1 4 2   t 1 0 1  2  2  9.3726  2 and 1 t 1  0  2  32  2 0 1 t 3  2  2  54.6274 The analytical value of 2 1  9.8696

22  39 .4784 32  88 .8264

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 1 4 2 2 2 Improved 1   less accurate 1   more accurate 1  3 3 1 4   8  9.3726 3 3  9.8301

Numerical Solution of PDE (Finite difference method) We are going to consider 1) Heat equation 2) Steady – State equation 3) Wave equation

Consider the heat equation in the form

u u D 2 t x u a, t    t  2

a xb , t 0

u b, t    t  u  x, t   f  x  To find u(x,t) using finite difference method.

1. Explicit method As before let x0  a, xi  x0  ix and

i  0,1,, n

t0  0 , t j  t0  jt denote

j  0,1,

u xi , t j   uij

The partial derivatives will be as,

uij 1  uij  u   Ot     t  t ij

(forward difference)



ui ij  2uij  ui 1 j   2u  2  2      O  x 2  x x   ij



(central difference)

t . D Finally, let r  2 x  Upon substitution in the equation,



uij 1  uij  r ui 1 j  2uij  ui 1 j   O t  x

2



1 Stability condition is r  2 1

When r 

2

1 uij 1  ui 1 j  ui 1 j  2

The explicit method looks like i, j+1

i-1, j

i, j

i+1, j

In the whole problem

t

u ij a

r

1 6

Problem: show that when the local truncation error will reduce to O t 2  x 4



b



The restriction on r causes higher number of operations which leads to higher round off error. Hence we move to implicit procedures.

x

2.Implicit methods   2u   2   x 

Let us replace by a linear combination of the known time step and the unknown (next) time step as follows, 2 2   u  u   u     D   2   1    2    t ij   x ij  x ij 1  where 0    1

When 1 then we have the Explicit method. 1 2

When  then we have the Implicit Crank Nicolson method

When 0 then we have the fully implicit method (backward difference method) Implicit Crank – Nicolson method



r uij 1  uij  ui 1 j  2uij  ui 1 j  ui 1 j 1  2uij 1  ui 1 j 1 2 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



r r  ui 1 j 1  1  r uij 1  ui 1 j 1  bij 2 2 r r where bij  ui 1 j  1  r uij  ui 1 j 2 2 i  1,2,  , n  1 , j  0,1,  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,…

r r  ui 1  1  r ui  ui 1  bi 2 2 i  1,2, , n  1

Taking into consideration the boundary conditions then in matrix form,

r  1  r  2  r  1 r  2     O 

r  2  

 r   O u  1   b1  u0  2    b2                             u  r   r b  u n  1   n  1 n  1 r 2    2 

This system can be solved by SOR method, For each j=0,1,…

 

r ( k 1) r (k )  (k ) u u  bi  ui 1  1  r ui  ui 1   1 r  2 2  i  1,2,, n  1 ; k  0,1, ( k 1) i

(k ) i

k is the number of iterations In this special case

b 

2 1 1 

2

 opt .

is found to be

r p ,  cos 1 r n

Example Given

u  2u D 2 t x u 0, t   0 u 20, t   100

0  x  20 , t  0 t  0 , D  0.16 t 0

x u x,0   20  x  Find u  x,   at x=4,8,12,16 and at x=2,4,…,18

0  x  10 10  x  20

0.16 t As you know r  x 2 Take r=1 and x  4 then t  100 each j

 0.5 0 0   u1  4  2  0.5  u  6 2  0 . 5 0   2      0  0.5 2  0.5 u3  6      0  0.5 2  u4  4  0 note that u0  0 & u5  0

and for

u1  3.27273  u2  5.09091  at t  100 u3  5.09091 u4  3.27273  For the next time step u0  0 and u5  100

b1  2.545455 b2  4.18182 b3  4.18182

b4  52.545455

Now at t=200

 u1   b1  u   b  A  2   2  u3   b3      u4  b4  50 u1  3.1057 u2  7.33188 u3  17.8582 u4  55.7373 & so on.



Elliptic Problems Consider the Poisson equation

u u  u  x, y   2  2  f  x, y  x y a xb , c yd 2

2

2

on with let for

u  x, y   g  x, y 

xi  a  ih i  0,1, , n

and and

on the boundaries

y j  c  jk j  0,1, , m

y

ym  d









  

y2

y1

y0  c x0  a

x1

x2

x3

x4

b  xn

x

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

ui 1 j  2uij  ui 1 j h or

k

2

u

i 1 j

2

 ui 1 j



uij 1  2uij  uij 1

  h u 2

k ij 1

i  1,, n  1 The diagram looks like

2

 uij 1 ;

  2h

 f ij 2

k

2

u

 h k f ij 2

ij

j  1,, m  1

2

ij+1

i-1j

ij

ij-1 Five point formula.

i+1j

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

b  where

2 1 1 c

2

1  p   p  c  cos   cos  2 n  m 

Example:

u xi , y j  , given the Poisson equation

Find

u u  2  2 2 x y 2

2

0 x6 , 0 y 8

u=0 on the boundaries. Take

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

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

y 8

u31 u 23 u 21 u 22 u11 u 21 6

x





1 uij  ui 1 j  ui 1 j  uij 1  uij 1  8 4 i  1,2 , j  1,2,3

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

u11  4.56

u21  4.56

u12  5.72

u22  5.72

u13  4.56

u23  4.56

For the case b) there are 35 linear equations in i  1,  ,5 ; j  1,  ,7 35 unknowns uij  ?

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

x x x x

x x x x

x x x x

6

x

Preparing the system to be solved by SOR it looks like

u

( k 1) ij

u

(k ) ij



b

 8u 4

( k 1) i 1 j

i  1,,5

u

(k ) i 1 j

u

( k 1) ij 1

j  1,,7

b  The results are as follows

2.042 3.123  3.657   3.181

3.047 3.353  4.794 5.319 5.686 6.335  5.960 6.647

u

(k ) ij 1

 4u

(k ) ij



Hyperbolic Problem (Wave equation)

Two dimensional heat equation in Cartesian coordinates (Alternative Direction Implicit method)

ADI

Fourier Series Power series play an integral part in real(& complex) analysis. Taylor Series in ODE Fourier Series in PDE Definition: Two nonzero f(x) and g(x) are said to be orthogonal on the interval a  x  b with respect to the weight function (x) if their scalar product vanishes:

  x  f x g x dx  0 b

a

Example sin nx

sin mx arthogonal on 0,2p 



2p

0

and

mn

 x   1

are

sin nx sin mx dx  0

2l – periodic function means f x  2l   f x  np x np x   Problem: the set of function1, cos , sin  l l  

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

Furthermore, 2

l  np x    np x   l l dx  2l ; l  cos 2  dx  l  sin l   dx  l l

2

l

2

Let f(x) be sufficiently smooth function defined on  l  x  l 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  1 np x np x   f  x   a0   an cos  bn sin  2 l l  n 1

Where a 0 and the coefficients a n and to be

bn

are found

1 l a0   f x dx l l 1 l np x an   f x  cos dx l l l n  1,2, 1 l np x bn   f  x sin dx l l l

Corollary When 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

1 2l a0   xdx  2l l 0 1 2l np x an   x cos dx  0 l 0 l 1 2l np x 2l bn   x sin dx   l 0 l np

n0 n0

Therefore

2l np x  2  1 np x  f x   l    sin  l 1   sin  np l l  n 1  p n1 n 

y 2L

L

2L

4L

6L

x

Example 2. 2   f x  x Find the Fourier series of

is of period 2l

 l  x  l and

1 l 2 2l 2 a0   x dx  l l 3 n 2 l 1 np x 4l  1 2 an   x cos dx  2 2  l l l np 1 l 2 np x bn   x sin dx  0 l l l 2 2 2   l 4l  1 np x f  x    2  2 cos 3 p n 1 n l At

2 2 l 4 l 2 l   2 3 p

xl

1 p2   2 6 n 1 n 

hence

n0 n0



1  2 n n 1

,

Complex Form e i  e  i Knowing that sin   2i e i   e  i and cos   2

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

a0 f x   2 a0  2

np xi  np xi np ix  np ix   l l l l  e e e e      an  bn  2 2i n 1       an  ibn   np xi l  an  ibn   np xi l     e e 2  2  n 1  n  1

Let

c0 

then

a0

2

f x  

an  ibn , cn  2 a n  ib n cn  2 

 cn e

 np xi l

n  

where

np xi 1 l cn   f x e l dx 2l l

n0 n0

and

Fourier Sine and Cosine Series 1. When f(x) is an even function then 2 l np x an   f  x  cos dx , bn  0 l 0 l a0  np x The cosine expansion of f(x) f  x     an cos 2 n 1 l

2. When f(x) is an odd function then 2 l np x a0  a n  0 , bn   f  x sin dx l 0 l  np x The sine expansion of f(x) f  x    bn sin l n 1

Fourier Integral The Fourier series extension to none periodic functions leads to Fourier Integral Consider a periodic function f l x  of period 2l. Its Fourier expansion is a0 np f l x     an cosn x  bn sin n x , where n  . 2 l

p

Now let l   and set   n 1  n  l 1  that is  l p

1 l f l  x    f l u du  l l l l 1            cos  x   f u cos  u du  sin  x   f u sin  u du  n l n n l n      l  l  p n 1

If

f x   lim f l x  and f is absolutely integrable l 

then using the idea of definite integrals,   1  f x    cosx  f u cosu du  sin x  f u sin u du d    p 0 

f x    A  cos x  B sin x d 

or

0

where 1 A  

p





f u  cosu du , B  

1

p





f u sin u du

Example: Find the Fourier integral representation of the function

1 if x  1 f x    if x  1 0 1  1 A    f u  cosu du 

p

B  





p

f u sin u du  0  p 1



1

1

cosu du 

2 sin 

p



f x  

2

 p



0

cosx sin 



d

‫‪Powered by:‬‬ ‫‪WPiS‬‬ ‫‪Web Pardaz Internet Services‬‬

‫تهيه کننده‪:‬‬ ‫وب پرداز‬ ‫مجری طرح های اينترنتی و اساليدهای آموزشی‬ ‫جهت کسب اطالعات بيشتر می توانيد با آدرس‬ ‫‪[email protected]‬‬ ‫مکاتبه نماييد‪.‬‬

Related Documents


More Documents from "Arif md khan"