Solution to Assignment 4.

MCE 567 Assignment # 4 Solution
David Chelidze
04/11/2011
Problems 3.1
We see that delay 1 gives the best resemblance to the original, and increasing the delay complicates the picture.
Now if we denote
Then we can write the map in delay coordinates:
𝑧𝑛+1 = π‘₯𝑛
𝑧𝑛+1 = π‘₯𝑛
π‘₯𝑛+1 = π‘Ž βˆ’ π‘₯𝑛2 + 𝑏 𝑧𝑛
It is clear that reconstruction with delay 1 gives exactly the same map.
Problem 3.2
According to average mutual information plot the optimal delay is 16. Looking and the plots of reconstruction we
see that at delay 8 the phase space is very similar to the original one. However, at delay 16 it retains the same
shape but achieves maximal separation of trajectories. Increasing the delay further complicates the geometry of
the attractor. Therefore, the first zero crossing (about delay 300) of the autocorrelation function is not a good
delay for phase space reconstruction.
Problem 3.3
Problem 3.4
We can see that the actual and reconstructed Poincare sections are quite different from the previous problem.
This is caused by the fact that on average there are five local maxima before zero crossing occurs for the x variable.
Appendix: Actual MATLAB code used in generating the figures
%% Assignment #4 for MCE 567
function [] = Assignment4
%% Problem 3.1
a = 1.4; b = 0.3;
x = zeros(1,10011);
y = x;
x(1) = 0; y(1) = 0;
for n = 2:10011
x(n+1) = a - x(n)^2 + b*y(n);
y(n+1) = x(n);
end
x = x(12:10011);
y = y(12:10011);
subplot(3,3,1)
plot(x,y,'.','markersize',3)
xlabel('x_n')
ylabel('y_n')
title('Original')
for k = 1:8
subplot(3,3,k+1)
plot(x(1:end-k),x(1+k:end),'.','markersize',3)
xlabel('x_n')
ylabel(['x_{n+' num2str(k) '}'])
title('Reconstructed')
end
% delay 1 gives a phase space that look like an original
%% Problem 3.2
sigma = 10; r = 28; b = 8/3;
[t,y] = ode45(@lorentz,0:0.01:500,ones(3,1));
x = y(101:end,1);
figure(2)
subplot(121)
ami(x,4000,100,32);
subplot(122)
aco = xcorr(x,1000,'coeff');
plot(0:1000,aco(1000:2000),'linewidth',1)
grid on
xlabel('Delay (sampling time)')
ylabel('Autocorrelation')
figure(3)
subplot(3,3,1)
plot(y(:,1),y(:,2))
xlabel('x(t)')
ylabel('y(t)')
title('Original')
for k = 1:8
subplot(3,3,k+1)
plot(x(1:end-2^k),x(1+2^k:end))
xlabel('x_n')
ylabel(['x_{n+' num2str(2^k) '}'])
end
function dy = lorentz(t,y)
dy = [sigma*(y(2) - y(1));
r*y(1) - y(2) - y(1)*y(3);
-b*y(3) + y(1)*y(2)];
end
%% Problem 3.3
options = odeset('Events',@events);
[t,y,te,ye] = ode45(@lorentz,[0 5000],ones(3,1),options);
figure
plot(ye(:,2),ye(:,3),'.','markersize',3)
xlabel('y')
ylabel('z')
title('Poincare Section for x=0 & x''<0')
function [value,isterminal,direction] = events(t,y)
% Locate the time when x passes through zero in a
% decreasing direction and record x and y.
value = y(1);
% Detect x crossing 0
isterminal = 0;
% Do not stop the integration
direction = -1;
% Negative direction only
end
%% Problem 3.4
options2 = odeset('Events',@events2);
[t,y,te,ye] = ode45(@lorentz,[0 5000],ones(3,1),options2);
figure
subplot(1,2,1)
plot(ye(:,2),ye(:,3),'.','markersize',3)
xlabel('y_n')
ylabel('z_n')
title('Poincare Section for dx/dt=0 & x''''<0')
subplot(1,2,2)
plot(ye(1:end-1,1),ye(2:end,1),'.','markersize',3)
xlabel('x_n')
ylabel('x_{n+1}')
title('Reconstructed Poincare Section')
function [value,isterminal,direction] = events2(t,y)
% Locate the time when dx/dt passes through zero in a
% decreasing direction...
dy = lorentz(t,y);
value = sigma*(dy(2)-dy(1)); % Detect dx/dt crossing 0
isterminal = 0;
% Do not stop the integration
direction = -1;
% Negative direction only
end
%%
end