% Example: Saddle (n°1)

clear all
tfinal=100;
[t xa]=ode23(@saddle1,[0 tfinal],[0 0.0001]);
[t xb]=ode23(@saddle1,[0 tfinal],[-0.0001 0]);
[t xc]=ode23(@saddle1,[0 tfinal],[0 -0.0001]);
[t xd]=ode23(@saddle1,[0 tfinal],[2 0]);
[t xdb]=ode23(@saddle1,[0 tfinal],[-2 0]);

[t xe]=ode23(@saddle1,[0 tfinal],[1 0.001]);
[t xf]=ode23(@saddle1,[0 tfinal],[2 0.001]);
[t xg]=ode23(@saddle1,[0 tfinal],[-2 0.001]);
[t xh]=ode23(@saddle1,[0 tfinal],[-1 0.001]);

[t xi]=ode23(@saddle1,[0 tfinal],[1 -0.001]);
[t xj]=ode23(@saddle1,[0 tfinal],[2 -0.001]);
[t xk]=ode23(@saddle1,[0 tfinal],[-2 -0.001]);
[t xl]=ode23(@saddle1,[0 tfinal],[-1 -0.001]);

[t xm]=ode23(@saddle1,[0 tfinal],[3 0.001]);
[t xn]=ode23(@saddle1,[0 tfinal],[4 0.001]);
[t xo]=ode23(@saddle1,[0 tfinal],[-4 0.001]);
[t xp]=ode23(@saddle1,[0 tfinal],[-3 0.001]);

[t xq]=ode23(@saddle1,[0 tfinal],[3 -0.001]);
[t xr]=ode23(@saddle1,[0 tfinal],[4 -0.001]);
[t xs]=ode23(@saddle1,[0 tfinal],[-4 -0.001]);
[t xt]=ode23(@saddle1,[0 tfinal],[-3 -0.001]);

plot(xa(:,1),xa(:,2),'b');
hold on
plot(xb(:,1),xb(:,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(xh(:,1),xh(:,2),'b');
hold on
plot(xi(:,1),xi(:,2),'b');
hold on
plot(xj(:,1),xj(:,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
plot(xq(:,1),xq(:,2),'b');
hold on
plot(xr(:,1),xr(:,2),'b');
hold on
plot(xs(:,1),xs(:,2),'b');
hold on
plot(xt(:,1),xt(:,2),'b');
xlabel('X1');
ylabel('X2');
title('Saddle 1');
axis([-2 2 -2 2]);
grid



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