%% Script collapse 2
%Bifurkáció?
clear
clc
close
figure
% x0 = [-2 -1.2];
% 
%         [t, x] = ode45('Collapse',[0 100], x0);
% hold on
% plot(x(:,1),x(:,2));

k=0;
step=0.1;
[x1, x2] = meshgrid(-1.2:step:1.2, -1.2:step:1.2);
for k=0:0.01:1%10
%    k
    x1dot=x1-x1.^3+k*(x2-x1);
    x2dot=x2-x2.^3+k*(x1-x2);

    quiver(x1,x2,x1dot, x2dot, 1.5);
    s=sprintf('k %1.4f',k);
    title(s);
    xlim([-1.2 1.2]);
    ylim([-1.2 1.2]);
    waitforbuttonpress;
%    pause(0.01);
  
    
end