


% program for plotting phase portrait



% the parameters in the function in fund2.m


% setting the graphical window
hold off,
xmin=input('minimal x coord in plot ');
xmax=input('maximal x coord in plot ');
ymin=input('minimal y coord in plot ');
ymax=input('maximal y coord in plot ');


ind=1;id=1;

% loop for plotting some collection of trajetories
while ind>0,
n=input(' how many curves ');
t1=input(' how long curves in time ');
p=input(' forward =1, backward =-1 ');
plot(xmin,ymin);
axis([xmin,xmax,ymin,ymax]);
hold on;
t0=0;
for i=1:n,
	'give initial point in figure',
	[xstart,ystart]=ginput(1);
x0(1)=xstart;x0(2)=ystart;
initPoint=[x0(1),x0(2)],
[t,x]=ode23('fun00a',[t0,t1],x0);
plot(x(:,1),x(:,2));
u=size(x);
xend=x(u(1),1);
yend=x(u(1),2);
endPoint=[xend,yend],
x=[];t=[];

% to make the arrows for the directions
Helpus1='plot arrows giving three points, one on one side ';
Helpus2='then on curve and last on next side';
[Helpus1,Helpus2],
[qx(1),qy(1)]=ginput(1);plot(qx(1),qy(1),'.','MarkerSize',0.5);
[qx(2),qy(2)]=ginput(1);plot([qx(1),qx(2)],[qy(1),qy(2)]);
[qx(3),qy(3)]=ginput(1);
plot(qx,qy),


end


% do we wish more trajectories or not
ind=input(' for more curves give 1 else 0 ');
if ind==1,
id=input(' for changing axis give 0 ');
if id==0,
xmin=input('minimal x coord in plot ');
xmax=input('maximal x coord in plot ');
ymin=input('minimal y coord in plot ');
ymax=input('maximal y coord in plot ');
axis([xmin,xmax,ymin,ymax]);
end
end
end






