How to represent a chaotic trajectory in MatLab?

6 views (last 30 days)
Hello everyone. I tried to represent the following ODE system in Matlab but I don't know how to find if it has chaotic trajectory or not. Any ideas?
ODEfcn = @(t,x,a) [0.25*(a*x(1)*(1-x(1))) - 0.0015*x(2) - 0.3*x(1); 0.25*x(1)*(1-x(1)) - 0.0515*x(2)];
ic = [1 1];
tspan = [0 50];
a = 2;
[t,y] = ode45(@(t,x)ODEfcn(t,x,a), tspan, ic);
figure
plot(t, y)
grid

Accepted Answer

Star Strider
Star Strider on 22 Jun 2019
I remember this system. I do not know what you intend by ‘chaotic trajectory’ here.
If you want to plot the derivative of ‘k’ with respect to time as a function of the derivatve of ‘y’ with respect to time, this works:
for k = 1:numel(t)
ddt(k,:) = ODEfcn(t(k),y(k,:),a); % Calculate Derivatives From Solved Values & ‘ODEfcn’
end
figure
plot(ddt(:,1), ddt(:,2))
grid
axis equal
xlabel('$\frac{dy(t)}{dt}$', 'Interpreter','latex')
ylabel('$\frac{dk(t)}{dt}$', 'Interpreter','latex')
The integrated functions themselves are given by ‘y(:,1)’ for ‘y’, and ‘y(:,2)’ for ‘k’ (remembering those from your earlier Question).

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!