image thumbnail

A toolbox for finding horseshoes in 2D maps

by

 

24 Feb 2007 (Updated )

This GUI programe presents an efficient method for finding topological horseshoes in chaotic systems

[xr,varargout]=rtmap_gnn(varargin)
function [xr,varargout]=rtmap_gnn(varargin)

p=0.025;
W=[0.3, -0.8, 0;0.8, 0.3+p, 0.4;0, 0.23, 0.2];a=-[1;1;2];
iro=[1,3];o2=0;
if nargin==1
    x0=varargin{1};
else
    x0=[-0.6 0.12]';
end
xe=[x0(1);o2;x0(2)];sg=[-1;-1;1];
for k=1:20
    [xe,sg,t,x]=xesolve(xe,sg,a,W); xe(abs(xe)<1e-5)=0;
    if xe(2)==0 & xe(1)<0, break;end
    if sg==[0;0;0], break; end
end
xr=xe(iro);
if nargout>1
    varargout{1}=1;
end

function [xe,sgn,t,varargout]=xesolve(x0,sg,a,W)
o=-W*sg./a;r=o./(o-x0);L=(r>0 & r<1);x=[];
t=min(log(r(L))./a(L));
if isempty(t)
    xe=o;t=10;sgn=sg*0;
else
    xe=o+(x0-o).*exp(a*t);
    sgn=sign(o+(x0-o).*exp(a*(t+1e-11)));
    if nargout==4
        for ti=linspace(0,t,10)
            x=[x o+(x0-o).*exp(a*ti)];
        end
    end
end
varargout{1}=x';

Contact us