Ode 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

7.11.

BOUNDARY VALUE PROBLEM (BVP)


We now discuss the finite difference method for solving second order linear differential
equation,
dy
d+p(*)+q()y
d dx
=r(), asx<b, (7.43)
with appropriate boundary conditions prescribed at the end points x = a and x = b; the
functions p (*), q(*) andr () which are functions ofx alone, are continuous in (a, b).
The general form of the boundary conditon (b.c.) may be like, ay +8 =Y, where O.,
dx
Band y are constants. Ifß =0, the condition is said to be of Dirichlet type, i.e. function value
is prescribed, If . =0, then the condition is called Neumanntype, i.e.
derivative is prescribed.
And when none of them is zero, the condition is said to be a mixed boundary condition.
When y=0. the condition is said to be homogeneous. Let us suppose mixed
conditions are
prescribed at both ends, i.e.

(7.44)
(7.45)
Eirst of all we subdivide the solution domain [a, b] into suitable number of
intervals, 1
sav, each of width h, i.e. h= (b-a)n, and identify (nodal/pivotal) points x, i =0 (1)n
such
that a =X, <x, <x, ...<x, =b. The solution y, i=0(1) nwillbe obtained at these points.
The differential equations (7.43) is then discretized at the internal points x, i= 1())n-1,
i.e. derivatives are replaced by their finite difference approximations. Similarly, boundary
conditions(7.44) and (7.45) are also replaced by finite differences. By doing so, we arrive at
a setof linear simultaneous algebraicequations which after solving, give the values of o»
yj ...), which is the required solution.
Let us recall the derivatives of first and second order derived in Chapter 5- in terms or
Forward, Backward and Central differences; we reproduce them below:
A. First Derivative
() By Forward Difference

y' &) ="1"+0(%)


Vi+1-Y
h
-+O (7.46)

(i) By Backward Difference

y'(«)= y,-Yi-l+0 (h)


h
(7.47)
(ii) By Central Difference
Vi+1--1
y'(«) = 2h
-+0(#') (7.48)

B. Second Derivative

) By Forward Difference
y, -2y,+|ti+2+2+0 (h)
y" (x) =
(7.49)
Aii) By Backward Difference
y, -2y;-1t}i-2o(h)
y"a) = (7.50)
(iii) ByCentral Difference

y"a) =
y,-1-2y, +i+1 -+0(').
(7.51)
It may be noted that for small h, the central difference approximation for the first
derivative as well as for the second would be better as compared to the forward and backward
difference approximation. Therefore, central difference formula will be used where-ever
possible.
Thus at the internal points x, i= 1(1)n - 1, the differential equation is discretized,
replacing the derivatives by central difference formulae. Consequently we get,
y,-1-2, + ,+1
+px) +1+q()y,
2h =r«), i= 1(1)n-1. (7.52)
After rearranging the terms, and putting p(x) =P, q () = 4, and r (x) =r, equation
(7.52) may be written as,
(7.53)
(2- hp) y,--2 (2-hg)y, +(2+ hp) y,.-2hr, i=1()n-1.
The boundary conditions (7.44)and (7.45) are discretized in the following manner:
derivative
(a) Atthe end-point x= a=X, as there is no pivotal point to the left of x, the
in (7.44) is replaced by forward difference formula, giving
o'o +B,
h
(7.54)
or
(ayh-B,) ,+ Bo' = Yoh.
Similarly, since there is no point to the right of x, = bthe derivative is replaced by
backward difference, giving,
4,+B
O,- Yn-1) = Y
or
-By,-1t(ha, + B,) , = Yih. (7.55)
There are (n+ 1) equations given by (7.53), (7.54) and (7.5S) in (n + 1) unknowns yoy,
V..yg Which may be determined by solving these equations. The number of equations
may reduce to n or n-lif P,= B, =0 or B, or ß, =0. The resulting system of equations
would be tri-diagonalwhich can be solved as discussed in Sec 2.16.
(b)There is also a technique to replace the derivative at the end point by central difference
formula. Suppose we want to discretize the b.c. (7.44) at x = x then we extend the domain
tothe left of x,and assume a fictitious point x_ =X-h. The boundary condition can now
be discretized as,
}--)
Oo'o + Bo 2h
or -Bo'_+ 2ha,, +B, = 2hYo (7.56)
The differential equation too is discretized at x =xo giving
(2- hp) y_-2 (2-4) Y, +(2 + hp,) y, = 2hro (7.57)
where po, gos Io are the values ofp, q and r respectively at x=x,=a.
Substituting the value ofy_ from (7.56) in (7.57), we get
{ha, (2 - hp,)-P, (2-g,)} Yo + 2B =%h (2 -hp,) + B,ro (7.58)
Similarly for discretizing the b.c. (7.45), we assume a fictitious point ..,to the right of
x, =b and replace the b.c. as,
,y, +B 2h
or-By,+2ha, y, +B,+=2hy,. (7.59)
Discretization of d.e. at x=x, =b gives
(2-hp,)y, -1-2 (2-hg)y, +(2 + hp,) y, -1=2hr (7.60)
Eliminating y, +, from (7.60) using (7.59), we get
-2B,- + (ha, (2 +hp,) +B, (2 -g,)} y, - y,h (2 +hp,) -r,B,. (7.61)
The (n - 1) equations (7.53) together with (7.58) and (7.6l) form a system of (n+ 1)
linear equations in y ».y, which can be evaluated by solving the equations.The system
of equations would be tri-diagonal and can be solved as discussed in Sec 2.16.
Example 7.9. Solve the differential equation,
y"+ 2xy'+ 2y = 5x, 0<x<0.5,
satisfying the boundary conditions,
y (0) = l,y (0.5) = 1.5.
Compute up to 4 decimals taking h = 0.1.
Solution. Discretizing the differential equation at the internal points x, =X, + ih=0.1 x i,
i=1,2, 3,4, i.e. x, =0.1, x, =0.2, x, =0.3 and x, =0.4
y,-1-2y, +};+1 -+ 2x, Vi+1-i-1
2h
-+2y, = 5x,

or (1 - hx) y,-1-2(1)y, +(1+ hx) y,| 5xh


or (1 0. lx) y,-1- 1.98 y, +(I+0.lx) y;+=0.05 x,
For various vlaues of x,, we get,
X,=0.1 ’ 0.99y, - 1.98y, + 1.0ly, =0.005
- 1.98y, + 1.0ly, -0.985
or

x, =0.2’ 0.98y, - 1.98y, + 1.02y, = 0.01


x =0.3 ’ 0.97y, - 1.98y, + 1.03y, = 0.015
X4=0.4 ’ 0.96, - 1.98y, + 1.04y, = 0.020
or 0.96y, - 1.98y, = - 1.540
We are required to solve following system of equations:

1.98 -1.01 0 0 0.985


0.98 -1.98 1.02 0 0.01
0.97 -1.98 1.03 0.015
0.96 -1.98-1.540
This willbe reduced to the following upper triangular form
1.98 -1.01 0 0.985
-1.480 1.02 0 -0.4775
0 -1.3114 1.03 0.2980
0 0 -1.2260-1.758 1I
After back substitution we get,
y, = 1.4340, y, =1.3535, y, = 1.2554 y, =1.1378
y (0.1) ~ 1.1378; y(0.2) = 1.2554
y (0.3) 1.3535; y(0.4) = 1.4340
Example 7.10. Solve the differential equation.
xy" +(x- 1)y'-y = 0,0<x< 0.75,
subject to conditions,
y'(0) = 1,y(0.75) = 1.3125.
Replace the derivative boundary condition by second order formula, taking h = 0.2s.
Solution. The pivotal points are x,=0,x =0.25, x, = 0.50, x, = 0.75 Discretization at
X=x, gives,
y-1-2y, + l(x
-+(x,-)"Y-l-y
2h
=0
or 2x, ;--2y,+ y,+)th(«,-1) ,+)-),-)-2h'y, =0
or (2x,-hx, + h) y,_ -(4x,+ 2h) y, +(2x, +hx,- h) y,*=0
After substituting the value of h and rationalising,
(7x, +1) ,--(l6x,+0.5) y,+ (9x,- 1) },+|=0 .(1)
Atx =0, the discretization of b.c. gives

2x0.25 = lor y_- ) 0.5 ...(2)


From (1) we get at x = 0,
y--0.5'o-, = 0
Using (2), gives 'o =-1 . .(3)
Applying (1) at x, = 0.25,
2.75y, - 4.5y, + 1.25y, = 0
Using (3),
0.9y,- 0.25y, = -0.5S ....(4)
Discretizing at x, = 0.50, we get from (1),
4.5y, 8.5y, +3.5y, = 0
or 0.9y, - 1.7y, +0.7y, 0
Using boundary condition y, =0.31125,
0.9y, + 1.7y, = -0.21875 .... (5)

Solving (4) and (5)we get,


, = -0.2284, y, -0.6746
'o =- l, y, =-0.6746, y, =-0.2284.
Note: The analytical solution is y =x-1+x*.

7.12. BVP AS AN EIGENVALUE PROBLEM


Consider a linear second order equation

+q (x) y = Ay, a s x s b e n a b o (7.62)


dy
parameter to be determined. Let the
where p (r), g (x) are known functions of xand 2 is a
associated boundary conditions be homogeneous, given as
a , + B, =0, x= a
a , t B'; = 0, x=b | e l o e b e (7.63)
where o Bo and a, B, are constants.
problems. As
Such problems frequently arise in science and engineering, like vibration
tri-diagonal system. Refer case
we have seen, the finite difference equations reduce to linear
(7.54),
(a) of Sec 7.11, for discretization of (7.62) and (7.63); the corresponding equations
(7.53) and (7.55) modified as follows:
Putting in these equations respectively,
bo = (agh-B), eo = P o ; e e s
a, = 2-hp, b, =-2 (2-g), e, =(2+ hp) (7.64)
i=1,2, ...n-1

Therelevant equations may be written in matrix from as


Ay = y or (A-)y = 0 (7.65)
where coefficient matrix A and vector yare given as
b,
b, C

b,

A = (7.66a)

0 0 a, b, Ct
0 0 00 a, b,

and (7.66b)
e.values of
Obviously (7.65) is an e.value problem which requires determination of
matrix A. Normally largest/smallest e. valuesare of interest in practical problems which can
be computed by Power Method discussed in Chapter 2.
EXERCISE 7
7.1. Find the solution of the differential equation,
dy
dx
= -2xy, y(0) = 1
by Picard's method so that theerror is not more than 0.0005 for 0 <x<0.4, i.e. computed
value ofyis correct up to3 decimals.
7.2. Findthe solution of the differential equation,
dy
dx
= 1+y',y(0) = 0.
1
by Picard's method so that the error is not more than X10 for 0 <x< 0.2, i.e.
approximately correct up to four decimals.
7.3. Find first four terms by Picard's method in the solution ofy'= xy', y(0) = 1.
7.4. Using Taylors series, find the solution up to four non-zero terms, of the differential equation,
y'= x+y, y(1) = 0.
Compute y at x = 1.5, up to 4 decimals. What maximum error do youexpect in your result.
7.5. Solve the differential equation,
1d
y' =x-y',y(0)=
by Taylor's series and compute y for x = 0.2 so that the error is not more than 0.0005, i.e.
value is correct up to 3 places of decimal.
7.6. Compute the value of y, y' and y" at x = 0.1. by Taylor series of order four, (1.e. up to
x terms), from the
differential equation,
y"+ 2y"+y'-y = cos x, 0<x<1,
y (0) = 0,y' (0) =l and y" (0) =2.
Compute error in each of them.
7.7. Estimate the value of y(0.1) and y (0.2) using Euler's method, with h = 0.1, from the
differential equation

dx
x-y, y(0) = 1.
What is the magnitude of errors in both cases.
7.8. Compute the value ofy for x=1.2 with () h= 0.2 (i) h=0.1, by Euler's method, from the
differential equation,
dy C ()=2
dx y+x

7.9. Using Eulers modified formula, find the approximate value ofy (0.2), from the differential
equation,
y'= xtNy(0)=1
decimals.isnooh
Take h =0.2and compute up to four
and 0.4, with
7.10. Using fourth order classical R-K methodcompute the values of yforx= 0.2
h=0.2, from the differential equation,
y'= x(1+), y(0) = 1.
7.11. Solve the system of differentialequations,
dy dz
= Z+1: =y-x,
dx

y (0) = 1,z (0) = 1


for x = 0.2, using fourth order R-K
method.

dy y(+y)
7.12. Given
dx x y(1)=2, compute theapproximate values ofy for x= 1.1(0.1) 1.3
byPredictor-Corrector formula. First two values should be computed by Euler's P-C formula
(modified Euler's method) and then the third value by Adams-Bashforth formula.
dy
7.13. Solve
d
y(0)=1by Taylor's series method, taking only first three non-zero terms in

the power series.Obtain vlaues ofy for x= 0.1 (0.1)0.3 from the Taylor's series. Then use
Milne's P-Cmethod to compute the approximate value ofy at x=0.4.
(Hint: Differentiate yy'= x)
7.14. Find the approximate solution of the boundary value problem,
xy" +(r- 1) y'-y =0,0<x<l.0,
with baundary conditions y(0) = 1,y(1)=3, subdividing the interval into four equal parts.
7.15. Find the approximate solution of the boundary value problem,
y"-xy'+2y = x+4,0<x<0.6
subject to boundary conditions, y'(0) =1,y(0.6) =1.96, subdividing the interval into three
equalsub-intervals. Discretize the derivative boundary conditon by centraldifference.
Also solve replacing the derivative b.c. at x=0 by forward difference.
REFERENCES AND SOME USEFUL RELATED BOOKSPAPERS
1. Collatz, L., Numerical Treatment of Differential Equations, Springer-Verlag.
2. Fox, L., Numerical Solution ofOrdinary and Partial Differential Equations,
Pergamon.
3. Gerald,C.F., and Wheatley, P.O., Applied Numerical Analysis, Pearson Education Asia.
4. Jain, M.K., Numerical Solution of Differential Equations, Wiley Eastern Ltd.

baitibo

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy