Hey there,
I’m quite new to Mathematica, but am required to use it by university. Anyways.
The topic actually says it all. I try to get a parametric plot, which works just fine. But Mathematica does not label my functions completely (and the one label that is applied was applied to the wrong function, 1 MeV is supposed to be the blue one).
Here’s the Code:
solution[energy_] :=
NDSolve[{2 (z*e^2)/(r*(x[t]^2 + y[t]^2)^(3/2))*x[t] == m*x''[t],
2 (z*e^2)/(r*(x[t]^2 + y[t]^2)^(3/2))*y[t] == m*y''[t], y[0] == p,
y'[0] == 0, x'[0] == v[energy], x[0] == a}, {x, y}, {t, 0, max}];
sol = {solution[1], solution[10 ], solution[50]};
ParametricPlot[
{
{Evaluate[{x[t], y[t]} /. sol[[1]]]},
{Evaluate[{x[t], y[t]} /. sol[[2]]]},
{Evaluate[{x[t], y[t]} /. sol[[3]]]}
}, {t, 0, max}, PlotRange -> {-5*10^-12, 5*10^-12},
AxesLabel -> {"x[t]", "y[t]"},
PlotLegends -> {"1 MeV", "10 MeV", "50 MeV"}, ImageSize -> Large]
Also on a side note:
Is it possible to directly use solution in parametric plot without using the workaround with sol ={..} ? I’d like to use a manipulate plot with it. ![]()
Edit:
Is it possible to scale the x and y axis in a Parametric Plot differently?
Next Edit:
When I se PlotLegend->“Expressions” it seems to write everything in one line
I managed to workarond it using PlotLegends->SwatchLegends