function   [x,W1]=sh112v(yprime,soln,I,bv,N,Nmax,TOL);
%% function   [x,W1]=sh112v(yprime,soln,I,bv,N,Nmax,TOL);
%%   Shooting algorithm to solve the boundary value problem
%%         y'' = f(x,y,y')   a<=x<=b, y(a)=alpha, y(b)=beta
%%                   I=[a,b]; bv=[alpha,beta];
%%   Algorithm 11.2 of Burden & Faires is implemented. It calls on the 
%%   the 4th order Runge-Kutta algorithm for systems. VERBOSE MODE
%% INPUTS:
%%   yprime - string (enclosed in ' ') of the name of the m-file where
%%            the corresponding system is set up for application of the Runge
%%            Kutta method rk4sys57.m to simultaneously solve the two systems
%%               w1'=w2             w1(a)=y(a);
%%               w2'=f(x,w1,w2)     w2(a)=y'(a)=TK; a<=x<=b
%%               u1'=u2             u1(a)=0;
%%               u2'=f_w1(x,w1,w2)u1 +f_w2(x,w1,w2)u2       u2(a)=1
%%    soln - string containing m-file for the known soluttion
%%    I  - the interval as a row vector (e.g. I=[a,b]  )
%%    bv - the boundary values as a row vector e.g. bv=[alpha,beta] 
%%    N - number of (equal) intervals with endpoints a=x0< ... <xN=b
%%    Nmax - maximum number of iterations
%%    TOL  - tolerence
%% OUTPUTS:
%%    x - the N+1 points at which the approximation is made.
%%    W1 - approximation to the solution y at x
k=1;
TK=(bv(2)-bv(1))/(I(2)-I(1));
FLAG=0;
w0=[bv(1),TK,0,1]; %% combined initial value row vector
while (k<=Nmax & FLAG==0)
  [x,U]=rksys57(yprime,I(1),I(2),w0,N);
  S=feval(soln,x);
  plot(x,U(:,1),x,S);pause
  if abs(bv(2)-U(N+1,1))< TOL
     FLAG=1;
     W1=U(:,1);W2=U(:,2);
  else
     TK=TK-(U(N+1,1)-bv(2))/U(N+1,3);
     k=k+1;
     w0=[bv(1),TK,0,1]; %% new combined initial value row vector
  end;
end;
