You are on page 1of 2

MAT 425: Homework 7 (03/25)

Ex 1.
a) Consider the boundary-value problem:
(
y ′′ + y = 0
y(0) = 0 , y(b) = β.
Find b and β such that the problem has:

i) no solution ii) only one solution iii) infinitely many solutions.

Hint: find the general solution of y ′′ + y = 0.


b) Consider now the boundary-value problem:
(
y ′′ − y = 0
y(0) = 0 , y(b) = β.
What happens here?
Hint: use the theorem of existence and uniqueness of solution for BVP.

Ex 2. Implement the linear shooting-method to solve:


(
y ′′ = p(x)y ′ + q(x)y + r(x)
y(a) = α , y(b) = β.
Application. Find the numerical solution of:
(
y ′′ = 4(y − x)
y(0) = 0 , y(1) = 2.
[Extra] Find the accuracy of the scheme.
2
Hint: the exact solution is y(x) = e4e−1 (e2x − e−2x ) + x.

Ex 3. Consider the non-linear BVP:


(
y ′′ = y 3 − yy ′
y(1) = 21 , y(2) = 13 .
Use the non-linear shooting method [with secant method] to find the solution with tol-
erance 10−3 .
1
Compare the solution with the explicit solution: y(x) = 1+x .

1
Review
b−a
Algorithm linear shooting: Fix ∆x = N
. Use RK4 to solve the two initial value
problems:
 

 y ′′ = p(x)y ′ + q(x)y + r(x) 
y ′′ = p(x)y ′ + q(x)y + 0
i)  y(a) = α ii)  y(a) = α
y (a) = 0.
 ′
y (a) = 1.
 ′

Denote by y1 and y2 (resp.) the solutions. The solution of the BVP is given by the linear
combination:
β − y1 (b)
y(x) = y1 (x) + y2 (x).
y2 (b)

Algorithm non-linear shooting:


b−a
1) Fix ∆x = N
, a tolerance T OL and two values for s0 and s1 (ex. s0 = 0 and
s1 = 1).

2) Use RK4 to solve the two initial value problems:


 

 y ′′ = f (x, y, y ′) 
 y ′′ = f (x, y, y ′)
i)  y(a) = α ii)  y(a) = α
y (a) = s0 .
 ′
y (a) = s1 .
 ′

Denote by y0 and y1 (resp.) the solutions.

3) If |y1 (b) − β| < T OL then STOP: y1 (x) is acceptable for the solution.
Else [correction initial condition] define:

y1 (b) − β
s2 = s1 − (s1 − s0 ).
y1 (b) − y0 (b)

Go back to 2) with (s1 , s2 ) (no need to solve again for y1 ).

You might also like