% Example: Saddle (n°2)

clear all
tfinal=100;
[t xa]=ode45(@saddle2,[0 tfinal],[0.0001 0.0001]);
[t xb]=ode45(@saddle2,[0 tfinal],[-0.0001 -0.0001]);
[t xas]=ode45(@saddle2,[0 tfinal],[20.*0.270333111 -20.*0.9628]);
[t xbs]=ode45(@saddle2,[0 tfinal],[-20.*0.270333111 20.*0.9628]);
[t xc]=ode45(@saddle2,[0 tfinal],[0.5 -7]);
[t xd]=ode45(@saddle2,[0 tfinal],[1 -7]);
[t xdb]=ode45(@saddle2,[0 tfinal],[1.7 -7]);
[t xe]=ode45(@saddle2,[0 tfinal],[2 -7]);
[t xf]=ode45(@saddle2,[0 tfinal],[2.5 -7]);
[t xg]=ode45(@saddle2,[0 tfinal],[3 -7]);
[t xgs]=ode45(@saddle2,[0 tfinal],[3.75 -7]);
[t xh]=ode45(@saddle2,[0 tfinal],[20.*0.27 -20.*0.9624]);
[t xi]=ode45(@saddle2,[0 tfinal],[-0.5 7]);
[t xj]=ode45(@saddle2,[0 tfinal],[-1 7]);
[t xjb]=ode45(@saddle2,[0 tfinal],[-20.*0.27 20.*0.9628]);
[t xk]=ode45(@saddle2,[0 tfinal],[-1.5 7]);
[t xl]=ode45(@saddle2,[0 tfinal],[-2 7]);
[t xm]=ode45(@saddle2,[0 tfinal],[-2.5 7]);
[t xn]=ode45(@saddle2,[0 tfinal],[-3 7]);
[t xo]=ode45(@saddle2,[0 tfinal],[-4 7]);
[t xp]=ode45(@saddle2,[0 tfinal],[1 -7]);


plot(xa(:,1),xa(:,2),'b');
hold on
plot(xb(:,1),xb(:,2),'b');
hold on
plot(xas(:,1),xas(:,2),'b');
hold on
plot(xbs(:,1),xbs(:,2),'b');
hold on
plot(xc(:,1),xc(:,2),'b');
hold on
plot(xd(:,1),xd(:,2),'b');
hold on
plot(xdb(:,1),xdb(:,2),'b');
hold on
plot(xe(:,1),xe(:,2),'b');
hold on
plot(xf(:,1),xf(:,2),'b');
hold on
plot(xg(:,1),xg(:,2),'b');
hold on
plot(xgs(:,1),xgs(:,2),'b');
hold on
plot(xh(:,1),xh(:,2),'b');
hold on
plot(xi(:,1),xi(:,2),'b');
hold on
plot(xj(:,1),xj(:,2),'b');
hold on
plot(xjb(:,1),xjb(:,2),'b');
hold on
plot(xk(:,1),xk(:,2),'b');
hold on
plot(xl(:,1),xl(:,2),'b');
hold on
plot(xm(:,1),xm(:,2),'b');
hold on
plot(xn(:,1),xn(:,2),'b');
hold on
plot(xo(:,1),xo(:,2),'b');
hold on
plot(xp(:,1),xp(:,2),'b');
hold on
xlabel('X1');
ylabel('X2');
title('Saddle 2');
axis([-7 7 -7 7]);
grid;



% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009
% Copyright(c).
