%
% testing the linear shooting method.
%
%%
%% this is a good example
%%
BV.a = 1;
BV.b = 2;
BV.alpha=1;
BV.beta=2;
[fun, x] = LinearShooting(@myp, @myq, @myr, BV);
figure(1);
c2 = (8-12*sin(log(2))-4*cos(log(2)))/70;
c1 = 11/10 - c2;
exactfun = c1*x + c2./(x.^2) - (3/10)*sin(log(x))-(1/10)*cos(log(x));
clf;
subplot(2,1,1);
plot(x(:),fun(:),'b.-');
title('BVP Solution by Linear Shooting');
subplot(2,1,2);
plot(x(:),fun(:)-exactfun(:),'b.-');
title('Errors in BVP Solution');

%%
%% a bad example 
%%
BV.a = 0;
BV.b = 1;
BV.alpha=1;
BV.beta=exp(-100);
[fun, x] = LinearShooting(@myp1, @myq1, @myr1, BV);
exactfun = exp(-100*x);
figure(2);
clf;
subplot(2,1,1);
plot(x(:),fun(:),'b.-');
title('BVP Solution by Linear Shooting');
subplot(2,1,2);
plot(x(:),fun(:)-exactfun(:),'b.-');
title('Errors in BVP Solution');

