ODE45 for phase trajectory plot
Show older comments
Hi, I'm new in Matlab.
I used in ODE45 code to find phase trajectory of the following equations:

when my initial conditions are 0,0,0 I run the code with these initial conditions but I don't get any point on the plot. This is the code I wrote:
f1=[0 0 1];
f = @(t,x) [1*x(1)+x(2)-x(1)*x(3);-x(1);-0.9*x(3)+(x(1)^2);];
x0 = [0;0;0];
dt= 0.001;
tspan= 0.1:0.45:10;
[t,x] = ode45(f,tspan,x0);
p%lot3(x(:,1),x(:,2),x(:,3), "o")
u = gradient(x(:,1));
v = gradient(x(:,2));
w = gradient(x(:,3));
quiver3(x(:,1),x(:,2),x(:,3),u,v,w, '-b')
grid on
title('Phase trajectory')
subtitle('g=0.9')
xlabel('x'), ylabel('y'), zlabel('z')
this is the plot that comes out when my initial conditions are 0,0,0:

Is it possible that ODE45 is not suitable for my problem? Where am I wrong?
I would appreciate any help.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations 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!