I have a Manipulate
plot and want to add another function, in addition to the existing a
and e
. The existing code is as follows:
SetOptions[Plot, Frame -> True, Axes -> False,
LabelStyle -> {FontFamily -> "Arial", FontSize -> 12, Bold},
FrameStyle -> Directive[Thick, Black], ImageSize -> Medium];
Constants
au = QuantityMagnitude[UnitConvert[Quantity[1, "AstronomicalUnit"], "Meters"]];
c = QuantityMagnitude[UnitConvert[Quantity[1, "SpeedOfLight"], "MetersPerSecond"]];
Qpr = 1;
Lsun = QuantityMagnitude[UnitConvert[Quantity[1, "SolarLuminosity"], "Watts"]];
Rsun = QuantityMagnitude[UnitConvert[Quantity[1, "SolarRadius"], "Meters"]];
Msun = QuantityMagnitude[UnitConvert[Quantity[1, "SolarMass"], "Kilograms"]];
G = QuantityMagnitude[UnitConvert[Quantity[1, "GravitationalConstant"],
("Meters"^2*"Newtons")/"Kilograms"^2]];
year = QuantityMagnitude[UnitConvert[Quantity[1, "Years"], "Seconds"]];
Myr = year*10^6;
Gyr = year*10^9;
Mwd = 0.6*Msun;
Cst = 1.27;
U = 1*10^17;
Functions
L[t_] := (3.26*Lsun*(Mwd/(0.6*Msun)))/(0.1 + t/Myr)^1.18;
Roche[dens_] := (0.65*Cst*Rsun*(Mwd/(0.6*Msun))^(1/3))/(dens/3000)^3^(-1);
Papsis[t_] := a[t]*(1 - e[t]);
Radiative Drag
RDdadtRρa = -((3*L[t]*Qpr*(2 + 3*e[t]^2))/(c^2*(16*Pi*2000*Rast*a[t]*(1 - e[t]^2)^(3/2))));
RDdedtRρa = -((15*L[t]*e[t])/(c^2*(32*Pi*Rast*2000*a[t]^2*Sqrt[1 - e[t]^2])));
RDsolRρa = ParametricNDSolveValue[{Derivative[1][a][t] == RDdadtRρa,
Derivative[1][e][t] == RDdedtRρa, a[0] == a0, e[0] == 3/10}, {a, e}, {t, 0, 9*Gyr},
{Rast, ρ, a0}];
fRDticks = {{Automatic, Automatic}, {Charting`FindTicks[{0, 1}, {0, 1/Myr}], Automatic}};
Manipulate[Plot[RDsolRρa[Rast, ρ, a0*au][[func]][t], {t, 0, 9*Gyr}, FrameTicks -> fRDticks],
{{func, 1}, {1 -> "a", 2 -> "e"}}, {{Rast, 0.005}, 0.0001, 0.1, 0.001, Appearance -> "Labeled"},
{{ρ, 3000}, 1000, 7000, 50, Appearance -> "Labeled"}, {{a0, 10, "a0 (au)"}, 3, 20, 0.2,
Appearance -> "Labeled"}]
I want to add a further plot, which is defined as: q=a(1-e)
, where a
and e
are already plotted. Any help is appreciated.
q[a_,e_]:=a (1-e)
outsideManipulate[...]
and then insert theq[a,e]
function intoManipulate
. This would normally work. $\endgroup$Papsis
in the above code, but I don't know how to add it into my currentManipulate
function and have another tab, in addition toa
ande
on the plot which showsPapsis
plotted. Sorry I'm relatively new to Mathematica. $\endgroup$