0

I used the following commands:

s = NDSolve[{X'[t] == 10 (X[t] - Y[t]), 
   Y'[t] == X[t] (28 - Z[t]) - Y[t], Z'[t] == X[t] Y[t] - (8/3) Z[t], 
   X[0] == Y[0] == Z[0] == 0.001}, {X, Y, Z}, {t, 100}]

ParametricPlot3D[Evaluate[{X[t], Y[t], Z[t]} /. s], {t, 0, 100}]

but I am not sure if I am right, the results are strange. Am I right? How can I plot $X,Y,Z?$

Michael E2
  • 235,386
  • 17
  • 334
  • 747
George
  • 317
  • 1
  • 7
  • Try restricting the PlotRange: ParametricPlot3D[Evaluate[{X[t], Y[t], Z[t]} /. s], {t, 0, 100}, PlotRange -> 40] -- looks like it then goes off to infinity instead of getting orbiting another critical point. – Michael E2 Nov 23 '19 at 16:27
  • nice, is the command "s=..." right? How can i plot $X,Y,Z$? – George Nov 23 '19 at 16:29
  • 1
    Do you mean separately? Use Plot, look in the documentation for NDSolve, or look at these examples: https://mathematica.stackexchange.com/questions/134222/easy-way-to-plot-ode-solutions-from-ndsolve – Michael E2 Nov 23 '19 at 16:34
  • the link doesn't help me. I am trying to understand, I am a beginner. I used https://reference.wolfram.com/language/ref/NDSolve.html, but I need to plot them in one graph – George Nov 23 '19 at 16:43
  • Did you try replacing ParametricPlot3D with Plot? -- Also, if you want the Lorenz system, I think the first equation has X and Y switched. – Michael E2 Nov 23 '19 at 17:03

1 Answers1

3

As long as this system is the Lorenz attractor, you have a changed sign in the first equation, so it blows up. Now it is fixed.

s = Quiet @ NDSolve[{X'[t] == -10 (X[t] - Y[t]), Y'[t] == X[t] (28 - Z[t]) - Y[t], Z'[t] == X[t] Y[t] - (8/3) Z[t], X[0] == Y[0] == Z[0] == 1/100}, {X[t], Y[t], Z[t]}, {t, 0, 10}]

ParametricPlot3D[Evaluate[{X[t], Y[t], Z[t]} /. s], {t, 0, 10}]
Cesareo
  • 3,963
  • 7
  • 11