  function [tvals,yvals,fvals] = StartAB(fname,t0,y0,h,k)
%
% Uses k-th order Runge-Kutta to generate approximate
% solutions to
%               y'(t) = f(t,y(t))   y(t0) = y0
%
% at t = t0, t0+h, ... , t0 + (k-1)h. 
%
% Pre: 
%       fname is a string that names the function f.
%       t0 is the initial time.
%       y0 is the initial value.
%       h is the step size.
%       k is the order of the RK method used.
%
% Post:
%       tvals = [ t0, t0+h, ... , t0 + (k-1)h].
%       For j =1:k, yvals(:,j) = y(tvals(j))  (approximately).
%       For j =1:k, fvals(:,j) = f(tvals(j),yvals(j))  .
% 
  tc = t0;
  yc = y0;
  fc = feval(fname,tc,yc);
  tvals = tc;
  yvals = yc;
  fvals = fc;
  
  for j=1:k-1
	  [tc,yc,fc] = RKstep(fname,tc,yc,fc,h,k);
      tvals = [tvals tc];
      yvals = [yvals yc];
      fvals = [fc fvals];
  end
      
      
