function exe_lnx
% Nonlinear system: 
% 		x1d=x1-x1*x2
% 		x2d=x1*x2-x2
figure(1); clf
x10=1;                                  % Equilibrium point
x20=1;
%
V=[[-1 1]*1+x10 [-1 1]*1+x20];          % Finestra di graficazione
xx=x10+(0.1:0.1:1);
In_Con=[xx',ones(size(xx'))];			% Initial conditions
Tspan=(0:0.001:1)*6.6;					% Simulation time 
fr=100;	dx=0.035; dy=dx;
for jj=(1:size(In_Con,1))
    [t,x]=ode45(@exe_lnx_ode,Tspan, In_Con(jj,:));      % Simulation
    plot(x(:,1),x(:,2)); hold on      					% Data plot
    freccia(x(fr,1),x(fr,2),x(fr+1,1),x(fr+1,2),dx,dy)  % Arrows
end            
grid on 
axis(V)
xlabel('Variable x_1(t)') 
ylabel('Variable x_2(t)') 
title('Trajectories in the vicinity of the equilibrium point')

function dx=exe_lnx_ode(t,x)
dx(1,1)=x(1)-x(1)*x(2);
dx(2,1)=x(1)*x(2)-x(2);

function f = freccia(x0,y0,x,y,rx,ry)
% Plot an arrow in (x,y) with directio dx=x-x0, dy=y-y0. 
dx=(x-x0)/rx;
dy=(y-y0)/ry;   
dxy=sqrt(dx^2+dy^2);
fx=-dx/dxy;
fy=-dy/dxy;
rotpiu=[rx,0;0,ry]*[cos(pi/6), -sin(pi/6); sin(pi/6), cos(pi/6) ]*[fx,fy]';
rotmeno=[rx,0;0,ry]*[cos(pi/6), sin(pi/6); -sin(pi/6), cos(pi/6) ]*[fx,fy]';
plot([x0,x],[y0,y],'-')
plot([x,x+rotpiu(1)],[y,y+rotpiu(2)],'-')
plot([x,x+rotmeno(1)],[y,y+rotmeno(2)],'-')
return