|
I recommend using the command gset size ratio -1 to make the plot have equal size units on both axes. You can also use axis('equal') to get the same result.
Similarly, instead of gset size noratio you can use axis('normal').
|
On this webpage I have provided two files that contain partial solutions to the planet project. The two files are almost identical. The only difference is that one uses "plot" to do the plotting, and the other uses "gplot".
These files (planet0.m and planet0a.m) are partial solutions, because they handle only one initial condition, they do not use functions, and they do not plot all the functions of interest.
Try running each of these: you will find that the one that uses gplot runs quite a lot faster. I think it might be a good idea to learn to use gplot. The syntax for gplot is different from plot, which means extra learning; but the syntax for gplot is almost identical to the syntax for another plotting program called gnuplot, so this extra learning would not be a waste of time.
This graph shows 7 trajectories for initial conditions, all of which start at the same point, and with velocities in the same direction; the trajectories differ by the magnitude of the initial velocity, which goes from small (red) to large (blue and purple). The initial velocity is directed along the tangent where all 7 curves kiss each other. In the first 6 cases, the resulting trajectory is bounded (and is in fact an ellipse). In the final purple case, the trajectory is unbounded (and is in fact a hyperbola). The yellow box shows the sun. This picture was made using RUNplanet12.m. |
This graph shows 7 trajectories for initial conditions, all of which start at the same point, and with velocities in the same direction; the trajectories differ by the magnitude of the initial velocity, which goes from small (red) to large (blue and purple). The initial velocity is directed exactly perpendicular to the line joining the initial point to the sun. In the first 6 cases, the resulting trajectory is bounded (and is in fact an ellipse). In the final purple case, the trajectory is unbounded (and is in fact a hyperbola). Notice how most of the ellipses look a lot like circles. This picture was made using RUNplanet12.m. |
This graph shows 5 trajectories for initial conditions, all of which start at the same point, with identical speeds, but different directions. (In all cases, the resulting trajectory is in fact an ellipse.) This picture was made using RUNplanet13.m. |