I have a system of second order differential equations, with two independent variables, which represents a trajectory.
I tried solving this system using NDSolve
and it gave me something like this:
{{x[t] -> 9 InterpolatingFunction[{{0., 1. 10 }}, <>][t],
y[t] -> 9 InterpolatingFunction[{{0., 1. 10 }}, <>][t]}}
With this result, I tried plotting the trajectory Plot
, but it doesn't show anything. Can you help me visualize the trajectory? Here is my entire code:
m = 4.5;
S = 5.6^2;
T = 5.972 10^24;
L = 7.35 10^22;
G = 6.67 10^-11;
K = (5.6^2 *(3.42 10^21)*(3.98 10^-19))/(3 10^8);
d = 3.84 10^8;
r = 0.9;
s = 0.9;
mySystem = {x''[t] == -((x[t]*G*T)/(x[t]^2 + y[t]^2)^((3/2))) - (x[t]*G*L)/(x[t]^2 + y[t]^2)^(3/2), y''[t] == -(y[t]*G*T)/(x[t]^2 + y[t]^2)^(3/2) - ((d - y[t])*G*L)/(x[t]^2 + (d - y[t]^2))^(3/2)};
myUnknowns = {x[t], y[t]};
myConditions = {x[0] == 0, y[0] == 3.58 10^7, x'[0] == 3074, y'[0] == 0, x''[0] == 0, y''[0] == 0};
traj = NDSolve[{mySystem, myConditions}, myUnknowns, {t, 0, 10^9}]
Plot[{x[t] /. traj, y[t] /. traj}, {t, 0, 10^9}]
LogLogPlot
, i.e.,LogLogPlot[{x[t] /. traj, y[t] /. traj}, {t, 10^-6, 100}, PlotRange -> All, PlotLegends -> {x[t], y[t]}]
to see issue more clearly. $\endgroup$