MS18 #discussion channel
These were the side discussions discussed in Part 4.
force
calculation only once for each pair. Create an upper triangular matrixforce
with .+= instead of =trajectory
and forces
in simulate
Some animation. I forgot what the parameters were :P
As mentioned in the video, I’ve taken planetary data from NASA and I’ve run an animation for 12 earth years (1 Jupyter year), with a time step of 1 day. dt
of one week is too inaccurate
It ran in a pretty short time, so I suppose you could add the rest of the planets too, but I don’t suppose it will change much.
I’ve plotted at the 10th time step (10 days) and created a gif at 30fps. So every second is about 10 months
force
needs to be initialized as a 3 vector, and plot the z component too, as scatter(xs, ys, zs, ...)
. Try the same in Python. Note that gr doesn’t give you a nice rotatable 3d plot. You can either use the camera
argument in the scatter(...)
or, what I prefer, is to use the Plotly or PlotlyJS backends. More info can be found in the Plots.jl docs. FIRST PLOTS TAKE TIME. Use planetary data from NASA and also use the Orbital Inclination
parameter in the dataset to set your initial conditions. If possible, use data for planets on some day, instead of the averages.xlims
and ylims
to see the moon separately from the earth.dt
? When objects are very close, they tend to accelerate quickly. Using smaller dt
for this is better, while we can use larger dt
for smaller forces. How will you calculate this dt
? Try some guess functions. Make sure to use the same dt
for each planet, otherwise they’ll end being in different times!