Page 325 - Applied Numerical Methods Using MATLAB
P. 325
314 ORDINARY DIFFERENTIAL EQUATIONS
(b) Apply the routines “bvp2_shoot()”, “bvp2_fdf()”, and “bvp4c()”to
solve the following BVPs. Fill in Table P6.10 with the mismatching
errors defined by Eq. (P6.9.0b) for the three numerical solutions and
plot the solution graphs if they are reasonable solutions.
y
(i) y − e = 0 with y(0) = 0,y(1) = 0 (P6.10.2)
1 2
2
(ii) y − y − (y ) = 0 with y(1) = 4,y(2) = 8 (P6.10.3)
t y
2 1 20
(iii) y − = 0 with y(1) = ,y(4) = (P6.10.4)
y + 1 3 3
2
(iv) y = t(y ) with y(0) = π/2,y(2) = π/4 (P6.10.5)
1
(v) y + y = 0 with y(2) = 2,y (8) = 1/4 (P6.10.6)
y 2
Especially for the BVP (P6.10.6), the routine “bvp2m_shoot()”
or “bvp2mm_shoot()” developed in Problems 6.7 and 6.8 should be
used instead of “bvp2_shoot()”, since it has a mixed-boundary con-
dition I.
(cf) Originally, the shooting method was developed for solving nonlinear BVPs,
while the finite difference method is designed as a one-shot method for solv-
ing linear BVPs. But the finite difference method can also be applied in an
iterative way to handle nonlinear BVPs, producing more accurate solutions in
less computation time.
6.11 Eigenvalue BVPs
(a) A Homogeneous Second-Order BVP to an Eigenvalue Problem
Consider an eigenvalue boundary value problem of solving
2
y (x) + ω y = 0 (P6.11.1)
with c 01 y(x 0 ) + c 02 y (x 0 ) = 0,c f 1 y(x f ) + c f 2 y (x f ) = 0
to find y(x) for x ∈ [x 0 ,x f ] with the (possible) angular frequency ω.
In order to use the finite difference method, we divide the solu-
tion interval [x 0 ,x f ]into N subintervals to have the grid points x i =
x 0 + ih = x 0 + i(x f − x 0 )/N and then, replace the derivatives in the
differential equation and the boundary conditions by their finite differ-
ence approximations (5.3.1) and (5.1.8) to write
y i−1 − 2y i + y i+1 2
+ ω y i = 0
h 2
2
y i−1 − (2 − λ)y i + y i+1 = 0 with λ = h ω 2 (P6.11.2)