%fill in gaps ad experiemnt for varius linear functions, p(t), q(t), and g(t).
function ????????????plot2ndODEs(fnct, indptvar, Iy, It, c1, c2, sp)
% Dr. M. Sakalli
% note dsolve expects D#y = ... Diff y and equality in text.. 
% in fact there are two solutions, I don't knw how 
% matlab determines to present solutions in array of 2, 
% or a superposed solution..

% ie plot2ndODEs('D2y=-.01*Dy-.02*y', 't', 2, 4)
% fnct function, 
% indtvar;
% c1 c2 arbitrary variables. 
% It, Iy: Intervals. 
% chose sp an integer btw 1 =< sp<=5 ie..
% try someother functions, implicit solutions are okey.. 
% in the case of implicit solutions you need to give mesh x and y
% in the case of explicit solutions.. as below.. 

if ((sp-round(sp))|(sp<1)|(sp>5)) 
	sp=2;
end
sol=dsolve(??????, indptvar),
soll=subs(sol,{'C1', 'C2'},{c1,c2}),
scalefactor=1;%=1/25*(t(50)-t(1))

if (~diff(It)|??????????)
	disp(sprintf('One of the intervals you entered is zero!, quiting'));
	return;
end

num=50;
xh=(It(2)-It(1))/num;      
yh=????????????????;
[x,y] = meshgrid(?????????????????,Iy(1):yh:Iy(2));

%if solution is implicit this won't work..
% why need to take diff og solution.. 
slopes_=subs(diff(soll),'t',x);

rr=sqrt(xh.^+slopes_.^2);
dxx=(1./rr)*scalefactor;
dyy=(slopes_./rr)*scalefactor;
quiver(x(1:sp:end, 1:sp:end),y(1:sp:end, 1:sp:end),dxx(1:sp:end, 1:sp:end),dyy(1:sp:end, 1:sp:end),.7, 'r');        % Here is the direction field
hold on
plot(It(1):xh:It(2),subs(soll,'t',It(1):xh:It(2)), '*')
axis tight
hold off
