Ode 2
Ode 2
Ode 2
(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
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,
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
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
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: