Professional Documents
Culture Documents
The Linear Shooting Method - (8.4)
The Linear Shooting Method - (8.4)
4)
Consider the boundary value problems (BVPs) for the second order differential equation of the form
(*) y ′′ fx, y, y ′ , a ≤ x ≤ b, ya and yb .
Under what conditions a boundary value problem has a solution or has a unique solution.
1. Existence and Uniqueness:
Suppose that f is continuous on the set
D x, y, y ′ ; a ≤ x ≤ b, − y , − y ′
and the partial derivatives f y and f y ′ are also continuous on D. If
(i) f y x, y, y ′ 0, for all x, y, y ′ in D, and
(ii) there exists a constant M such that
f y ′ x, y, y ′ ≤ M for all x, y, y ′ in D,
then the boundary value problem (*) has a unique solution.
Example Rewrite the initial-value problem for the system of 2 second-order differential equations
2
y ′′1 y ′1 − 2y ′2 2y 1 − y 2 t
, y 1 0 1, y 2 0 −1, y ′1 0 2, y ′2 0 3
y ′′2 − 3y ′1 y 1 4y 2 2 sint
3
u ′1 u 2
u ′2 − 4x u 2 − 22 u 1 22 ln x
x x , u 1 1 1 , u 2 1 0, u 3 1 0, u 4 1 1.
′ 2
u3 u4
u ′4 − 4x u 4 − 22 u 3
x
2 2
Shooting Method: y"=-4/x*y-2/x *y+2*ln(x)/x , y(1)=1/2,y(2)=ln2
0.8
0.7
0.5
2 2
0.4 IVP: y "=-4/x*y -2/x *y +2*ln(x)/x , y (1)=1/2,y (1)=0
1 1 1 1 1
0.3
0.2
2
0.1 IVP: y "=-4/x*y -2/x *y , y (1)=0, y (1)=1
2 2 2 2 2
0
1 1.2 1.4 1.6 1.8 2
4
2 2
Shooting Method: y"=-4/x*y-2/x *y+2*ln(x)/x , y(1)=1/2,y(2)=ln2
-5
10
-6
10
-7
|y(x i)-y i| 10
-8
10
-9
10
-10
10
-11
10
1 1.2 1.4 1.6 1.8 2
x
5
MatLab program for this example:
clf
alpha1/2;
betalog(2);
a1;
b2;
[xv,yv]ode45(’funsysa’,[a b],[alpha;0;0;1]);
plot(xv,yv(:,1),’r-.’,xv,yv(:,3),’m–’)
hold
nlength(yv(:,1));
y1nyv(n,1);
y2nyv(n,3);
yvsolyv(:,1)(beta-y1n)/y2n*yv(:,3);
truesol-1./(xv.^2).*(2-4*xv3/2*xv.^2-xv.^2.*log(xv));
plot(xv,yvsol,’b-’,xv,truesol,’k-’)
title(’Shooting Method: y"-4/x*y-2/x^2*y2*ln(x)/x^2, y(1)1/2,y(2)ln2’)
text(1.2,0.4,’IVP: y_1"-4/x*y_1-2/x^2*y_12*ln(x)/x^2, y_1(1)1/2,y_1(1)0’)
text(1.3,0.1,’IVP: y_2"-4/x*y_2-2/x^2*y_2, y_2(1)0, y_2(1)1’)
text(1.2,0.6,’- yy_1(beta-y_1(2))/y_2(2)*y_2’)
axis([1 2 0 0.8])
hold off
figure(2)
semilogy(xv,abs(yvsol-truesol),’b-.’)
title(’Shooting Method: y"-4/x*y-2/x^2*y2*ln(x)/x^2, y(1)1/2,y(2)ln2’)
ylabel(’|y(x_i)-y_i| ’)
xlabel(’x’)
Notes: ode45.m is a MatLab building-in function which solves initial-value problems for systems of
n first-order differential equations:
u ′1 f 1 x, u 1 , . . . , u n
, a ≤ x ≤ b, u 1 a 1 , . . . , u n a n .
u ′n f n x, u 1 , . . . , u n
It is called by:
[xv,uv]ode45(’funsysa’,[a b],[ 1 , . . . , n ]); where funsysa.m is a user-provided Matlab program that
6
x0 a
x1
evaluates functions of the system at x. The outputs are the vector xv and
x N−1
xN b
u 10 u n0
u 11 u n1
uv . That is, for a ≤ x ≤ b,
u 1N u nN
y 1 x ≈ u 10 , u 11 , . . . , u 1N , . . . , y n x ≈ u n0 , u n1 , . . . , u nN .