% Driver for Ikeda

% Ikeda, K., 1979, Multiple-valued stationary state and its
% instability of the transmitted light by a ring cavity
% system, Opt. Commun., 30, 257.

% Equations
% x_{i+1} = 1.0 + \mu*(x_i*cos(t) - y_i*sin(t))
% y_{i+1} = \mu*(x_i*sin(t) + y_i*cos(t))
% t       = a - b/(x_i*_i + y_i*y_i + 1.0)

% Written by Jim Hansen, Feb 2003 for 12.990 students

% Specify the dimension of the system
dim = 2;

% Specify the initial conditions
x = [0.1 0.2];

% Specify the parameter values (a, b, mu)
par = [0.4 6.0 0.9];

% Specify the length of integration
steps = 2^12;

% Integrate the equations over length steps to remove any transient behavior
for i=1:steps
 xout=ikeda(x,par,dim);
 x=xout;
end

% Integrate the equations over length steps and record state for plotting
for i=1:steps
 xout=ikeda(x,par,dim);
 state(i,:)=xout;
 x=xout;
end

plot(state(:,1),state(:,2),'.')
xlabel('x');ylabel('y');title('Ikeda map');

print -djpeg90 ikeda.jpg
