% ode driver_td
% sample for Math 451 Fall 2012 for 
% function [y,t] = euler_tdelillo(f,y0,t0,tf,n)
tspan=[0 2*pi]; % = [t0 tf] initial and final times
y0=[1 0];  % initial conditions as row vector
%y0=1;
n = 100;
% f = @(t,y) y  % dy/dt = y so y(t) = Aexp(t)
%[t,y] = euler_tdelillo2(f,tspan,y0,n); % output y(t,:) column vector
%varargin(1)=1; % = k spring constant%
varargin(2)=1; % = m mass
[t,y] = euler_tdelillo2(@osc_td,tspan,y0,n); % output y(t,:) is column vector
y1=y(:,1);
y2=y(:,2);
%y2=cos(t);
%y2=exp(t);  % if exact value of y(:,1) is known
plot(t,y1,'o',t,y2,'.');


