Maths Complete Notes
Maths Complete Notes
where
and
For j = 0, we have
t0 = 0, u0 = I, K 1 = 0, = -0.4 (0.1) (1)2 = -0.04.
K2
For j = 1, we have
!1 = 0.2, U1 = 0.96, K1 = -0.4 (0.2) (0.96)2 = -0.073728.
2
K 2 = - 0.4 (0.2 + 0.1) (0. 96 - 0.036864) = - 0.102262.
with boundary conditions y(a) = a, y(b) = /3. To solve this problem using finite
differences, we divide the interval [a, b] into n subintervals, so that h = (b - a)/n.
To approximate the function y(x) at the points x 1 = a+h, ... , Xn-l = a+ (n- l)h,
we use the central difference formulas from Chapter 11:
y
"( ) ~~ Yi+l -
Xi
2yi
h2
+ Yi-1
' y
'(
Xi
) ' Yi+l - Yi-1
2h
Substituting these expressions into the BVP and writing p(xi) as Pi, q(xi) as
q;, and r(xi) as r; gives
t hen (for i = 2, . .. ,n - 2) ,
(2 + hp.~Yi-1 - (4 + 2h 2 qi)Yi + (2 - hp;)Yi+l = 2h2r;
and , finally (for i = n- 1),
(2 + hPn-l)Yn-2 - (4 + 2h2 qn-dYn-1 = 2h2 Tn-1 - /3(2 - hPn-1)
(2 + hp.) (2 - hp.)
L
EXAMPLE 14.5 A Finite-Difference Problem
Use the finite-difference method to solve the problem
y
11
= y +X(X - 4), 0$ X $ 4
with y(O) = y(4) = 0 and n = 4 subintervals. The finite-difference method will find
an approximate solution at the points x 1 = 1, x 2 = 2, and X3 = 3. Using the central
difference formula for the second derivative, we find that the differential equation
becomes the system
Y2 - 2y1 + 0 = Y1 + 1(1 -
4}
Y3 - 2y2 + Y1 = Y2 + 2(2 - 4)
0 - 2y3 + Y2 = y3 + 3(3 - 4)
Combining like terms and simplifying gives
-3y1 + Y2 =-3
Y1 - 3y2 +y3 =-4
+ Y2 -3y3 =-3
At x = 1, the exact solution is 1.8341 (to four decimal places) ; the finite-difference
solution is Y1 = 13/7 = 1.8571.
+X T in( m)
h: 0-2S
) 3 ) =o,
J. y ) Jl»)D No:
- ?
(24) i)= o
-(u2)***i
m a
0 tAS3*1
1 o 3S Pao
(
al44)
(44)
4-
130
30
SL
120
(4)-°)