%%
%  Author: Peter Polcz (ppolcz@gmail.com) 
%  Created on 2023. September 21. (2023a)
%

mus = 1;

T_Max = 100;

fig = figure(300 + round(100*mu));
fig.Position(3:4) = [761 977];
delete(fig.Children)
ax = axes(fig);
hold on; grid on; box on;

Eq = @(t,x) [
    x(2)
    mu*(1-x(1).^2).*x(2) - x(1)
    ];


[t,x_sol] = ode45(Eq,[0,T_Max],[2;0]);

Utolso_nehany_sec = linspace(T_Max-7,T_Max,50);
LC = interp1(t,x_sol,Utolso_nehany_sec);

plot(LC(:,1),LC(:,2),'.','LineWidth',2,'MarkerSize',30)
drawnow

axis equal
    
    
    
    
    






















%%


f = @(t,x) [
    1 - x(1)
    1
    ];

fig = figure(123);
delete(fig.Children)
ax = axes(fig);
hold on

[t,x] = ode45(f,[0,10],[0.5;0]);
x1 = x(:,1).*cos(x(:,2));
x2 = x(:,1).*sin(x(:,2));
plot(x1,x2)

[t,x] = ode45(f,[0,10],[1.5;0]);
x1 = x(:,1).*cos(x(:,2));
x2 = x(:,1).*sin(x(:,2));
plot(x1,x2)


