function [T,Y]=threeplot(name,xo,yo,zo,tspan)
%Integrates a system of ODEs
%
%  Usage: [T,Y]=threeplot('model',x0,y0,z0,tspan); 
%         where 'model' = 'Lorenzmio' or 'Rossler'
%
%  Examples:
%             [T,Y]=threeplot('lorenzmio',8,3,33,[0,100]);
%             [T,Y]=threeplot('Rossler',5,-5,0.1,[0,500]);


%global b B lambda 

options= odeset('Reltol',1.e-5);
%options= odeset('Reltol',1.e-22,'OutputFcn','odephas3');
%options= odeset('Reltol',1.e-3,'OutputFcn','odephas3','Refine',2);
%options= odeset('Reltol',1.e-3);

 %figure(1);
 %clf;
 init=[xo yo zo]';
 %tspan=[to tf];
 
 [T,Y]=ode45(name,tspan,init,options);
 
 figure(2)
 clf
 plot3(Y(:,1),Y(:,2),Y(:,3))
 hold on
 xlabel('x')
 ylabel('y')
 zlabel('z')
 title(name)
 rotate3d
 view([60 45]);
 axis tight
 hold off

 figure(3)
 clf
 hold on
 xlabel('t')
 ylabel('x!y!z')
 plot(T,Y(:,1),'r-',T,Y(:,2),'b-',T,Y(:,3),'g-')
 hold off
 axis tight

