Getting the wrong plot?

1 vue (au cours des 30 derniers jours)
Andrew Davies
Andrew Davies le 19 Mai 2014
Modifié(e) : Yao Li le 19 Mai 2014
function dLdt = Lorentz(t,xyz,s,b,r)
xyz = [3;2;3];
s = 10;
b = 8/3;
r = 0.5;
dx = s*(xyz(2) - xyz(1));
dy = r*xyz(1) - xyz(2) - xyz(1)*xyz(3);
dz = xyz(1)*xyz(2) - b*xyz(3);
dLdt = zeros(3,1);
dLdt(1)=dx;
dLdt(2)=dy;
dLdt(3)=dz;
Then i use this code to call it
[t,xyz]=ode45('Lorentz1',0:0.001:1,[0;0;0]);
plot3(xyz(1),xyz(2),xyz(3));
I'm getting a straight line plot, which it definitely shouldn't be. Is it the way i've defined my initial conditions?
  1 commentaire
Yao Li
Yao Li le 19 Mai 2014
Modifié(e) : Yao Li le 19 Mai 2014
Your function name is "Lorentz", but the function called by ode45 is 'Lorentz1'. Anything wrong here?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Graphics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by