1
$\begingroup$

How can one plot a three-dimensional plot of a differential equation system of the following to show the trajectories in mathematica:

x' = yz,~ y' = -2xz,~ z' = xy

I tried using VectorPlot3D and ParametricPlot3D

  • 0
    If you send me all necessary parameters I will try to plot your system...2011-11-11

1 Answers 1

2

How about like so, parameterizing initial conditions by spherical angles $\theta$ and $\phi$:

enter image description here

The copy-paste-ready code:

Traj[\[Theta]_, \[Phi]_, tmax_] :=   Module[{sol}, {sol} =     NDSolve[And @@ {x'[t] == y[t] z[t], y'[t] == -2 x[t] z[t],        z'[t] == x[t] y[t], x[0] == Sin[\[Theta]] Cos[\[Phi]],        y[0] == Sin[\[Theta]] Sin[\[Phi]], z[0] == Cos[\[Theta]]}, {x,       y, z}, {t, 0, tmax}];   sol]  Show[ParametricPlot3D[{x[t], y[t], z[t]} /. {Traj[Pi/5, Pi/3, 7],       Traj[3 Pi/5, Pi/3, 7], Traj[2 Pi/5, Pi/7, 7]}, {t, 0, 7},     PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, Evaluated -> True] /.    Line -> Tube, Graphics3D[{Sphere[{0, 0, 0}, 1]}]] 
  • 0
    @nightown Try this `Show[ParametricPlot3D[{x[t], y[t], z[t]} /. {Traj[Pi/5, Pi/3, 7], Traj[3 Pi/5, Pi/3, 7], Traj[2 Pi/5, Pi/7, 7]}, {t, 0, 7}, PlotRange -> 1.4 {{-1, 1}, {-1, 1}, {-1, 1}}, Evaluated -> True] /. Line -> Tube, ParametricPlot3D[{Sin[\[Theta]] Cos[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Theta]]}, {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, PlotStyle -> None, MeshStyle -> LightGray], Boxed -> False, AxesOrigin -> {0, 0, 0}, Ticks -> None]`2011-11-11