Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

32
Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005

Transcript of Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Page 1: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Numerical solution of Differential and Integral Equations

PSCi702

October 19, 2005

Page 2: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Differential Equations

• Equations where the dependent variable appears as well as one or more of its derivatives.

• The highest derivative present determines the order of differential equation.

• The highest power of the dependent variable or its derivative sets the degree of the differential equation.

Page 3: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Differential Equations

• Y’-Y=0 (1st order)

• Y’(t)-Y(t)=exp(t) (1st order)

• Y’(t)-Y(t)=t2 (1st order)

• Y’’+Y’-2Y=0 (2nd order)

• Y’’’+Y’’-2Y=0 (3rd order)

• Y’+Y2=0 ( 2nd degree, 1st order)

• Y’’(t)+(Y’(t)-Y(t))2 =t ( 2nd degree, 2nd order)

Page 4: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Differential Equations

• Higher order equations can be reduced to a system of first order equations.

)()('

)()('

)()()(')(')('

)()()(')('')('''

xzxf

xyxz

xgxfxfxzxy

xgxfxfxfxf

Page 5: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Differential Equations

• When solving differential equations, the final answer has a constant of integration in it.

• If all the constants of integrations are specified at the same place, they are then called initial values and the solution is called initial value problem.

• If the initial values are not given at the same place and are specified at different locations, then the solution to the problem is called boundary value problem.

Page 6: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Solution to Differential Equations

• Start the solution at the value of the independent variable for which the solution is equal to initial values.

• Proceed step by step by changing the independent variable and obtaining solution across the required range.

• Since most methods use local polynomial approximation methods, stability becomes an issue.

Page 7: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

One Step Methods

• Picard’s Method

)]([5.0)(

)()(

)](,[)(

),()(

),(),(),(

),()('

0)1(

0)1(

0)1()1(

)1(00

)(

0

0

0

0

0

0

0

0

hxyyxy

hxyxy

dxxyxgyhxy

dxyxgyxy

dxyxgdydxyxdyyxgdx

dy

yxgxy

kk

kk

hx

x

kk

hx

x

hx

x

y

Page 8: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

Use Picard iteration to find the solution of

222)2()(

),()(

2

001

0

0

0

xxdxxyxy

dxyxgyxy

x

hx

x

Page 9: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

Page 10: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

• The exact solution is:

Page 11: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Runge-Kutta

• The method doesn’t rely on polynomial approximation.

• Solution can be presented by a finite taylor series of the form:

kknn

knknk

nnnnnn

kn

k

nnnn

ttty

hbyhxga

hbyhxgayxgahyy

yk

hy

hhyyy

11001

11101

)(2

1

y

equations twoabove theCombine

)}(),[(

)](),[(),({!

''!2

'

Page 12: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Runge-kutta

)](),[(t

)](),[(t

)](),[(t

),(t

where

y

11,11,00,k

11,200,222

00,111

0

11001

kkkkknkn

nn

nn

nn

kknn

tttyhxhg

ttyhxhg

tyhxhg

yxhg

ttty

Page 13: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Runge-Kutta

]

]5.05.0

]5.05.0

],

6/)22(

4kFor

]

],

5.05.0

1kFor

23

12

01

0

32101

01

0

101

)th),(yhg[(xt

)th),(yhg[(xt

)th),(yhg[(xt

)yhg[(xt

ttttyy

)th),(yhg[(xt

)yhg[(xt

ttyy

nn

nn

nn

nn

nn

nn

nn

nn

Page 14: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Error Estimate

• If solution is monotonically increasing, then the error is increasing as well due to truncation.

• In oscillatory solutions, the truncation error introduces a phase shift.

• The general accuracy can not be arbitrarily increased by decreasing the step size. While it will reduce the truncation error, it will increase the effects of round-off error.

Page 15: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Error Estimation

)(

initially

)(/)(

:as rangegiven over the uniformerror

n truncatio themake toabjusted becan size step theSo

)(y

:is term1)(k for theerror The

0

1

11

11n

th

y

yyhh

h

k

nnnn

k

Page 16: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

Page 17: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

Page 18: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Example

Page 19: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Predictor-Corrector Method

• By using the solution at n points, we can fit an (n-1) degree polynomial.

• The predictor part extrapolates the solution over some finite range h based on the information at prior points and inherently unstable.

• The corrector part makes correction at the end of the interval based on some prior information.

Page 20: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Predictor-Corrector Method

][5.0y

: versionModified

2y

predictorpoint Two

y

predictor step-One

')1('1n

'1n

'1n

1)(k

nknn

nn

nn

yyhy

hyy

hyy

Page 21: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Predictor-Corrector Method

Page 22: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Predictor-Corrector Method

Page 23: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Systems of Differential Equations

],,,,[

],,,,[

],,,,[

21'

212'2

211'1

nnn

n

n

yyyxgy

yyyxgy

yyyxgy

Page 24: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Systems of Differential Equations

Page 25: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Systems of Differential Equations

• In vector form:

• Where consists of elements which are functions of dependent variables yi,n and xn.

• A set of basis solutions is simply a set of solutions, which are linearly independent.

• Consider a set of m linear first order differential equations where k values of the dependent variables are specified at x0 and (m-k) values corresponding to the remaining dependent variables are specified at xn.

)y(Ay n1n

)y(A n

Page 26: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Systems of Differential Equations

• solve (m-k) initial value problems starting at x0 and specifying (m-k) independent, sets of missing initial values so that the initial value problems are uniquely determined. Let us denote the missing set of initial values at x0 by

)( 0)0( xy

)()( 0)(

0)0( xAyxy t

Page 27: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

• The columns of are just the individual vectors

• Matix A will have to be diagonal to always produce

• So one can choose

• So the missing initial values will be

)( 0)0( xy

)( 0)0( xyj

)( 0)0( xy

ijij xy )( 0

)0(

A)( 0)0( xy

Page 28: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Systems of Differential Equations

)(A

Afor Solving

)]([1)(y

may write

wesolutions trialofset complete for the and

)]([)(y

:by )(ysolution

k -m yield willinterval theacross gIntegratin

)0(1

)((0)

)((0)

j (t)

n

nt

n

ntj

n

n

xyy

xyAx

xyAx

n

Page 29: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Integral Equations

• Equations can be written where the dependent variable appears under an integral as well as alone.

• Such equations are the analogue of the differential equations and are called integral equations.

• It is often possible to turn a differential equation into an integral equation which may make the problem easier to numerically solve.

Page 30: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Integral Equations

Page 31: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Integral Equations

• The parameter K(x,t) appearing in the integrand is known as the kernel of the integral equation.

• Its form is crucial in determining the nature of the solution. Certainly one can have homogeneous or inhomogeneous integral equations depending on whether or not F(x) is zero. Of the two classes, the Fredholm are generally easier to solve.

Page 32: Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.

Integral Equations