% lagrange.m
% simple script to make the Lagrange points (L1, L4, etc) extremely obvious.
% Plots the acceleration of small objects
% at the instant they are released "at rest" in a rotating reference frame
% attached to the center of mass of the Earth-Moon system.
% usage:
% » lagrange
% change log:
% 1998-09-02:DAV: started by David Cary
% I think going to 3D and using 'quiver3' could be interesting.
% All distance units are in Megameters ( 1 Mm = 10^6 meters).
% all mass units are in Gigagrams (1 Gg = 10^9 grams = 10^6 Kg)
% Make eps smaller for more accurate calculation.
% (halving eps makes calculations take at *least* 4 times as long).
' calculating ...'
% overall view
eps = 3; % 1.5; % Mm
% Tweak xsize, ysize, Gy, Gx to pan and zoom around the final image.
xsize = 500.1; % Mm
ysize = 300.1; % Mm
% Set up x,y coordinates; tweak slightly to pan and zoom.
Gy = (-ysize:eps:ysize) + ysize - 95;
Gx = (-xsize:eps:xsize) + 60;
% Call lagrange_physics to do all the messy stuff.
[loga, ax, ay, a_theta_x, a_theta_y, a_radial_x, a_radial_y] = lagrange_physics(Gy, Gx, -9);
% graph all the data
lagrange_graphs(loga, ax, ay, a_theta_x, a_theta_y, a_radial_x, a_radial_y, Gx, Gy)
% end overall view
% zoomed in on L4
eps = 1.0;
Gy = 300.05:eps:340.05;
Gx = 170.05:eps:210.05;
% Call lagrange_physics to do all the messy stuff.
[loga, ax, ay, a_theta_x, a_theta_y, a_radial_x, a_radial_y] = lagrange_physics(Gy, Gx, -9);
% graph all the data
lagrange_graphs(loga, ax, ay, a_theta_x, a_theta_y, a_radial_x, a_radial_y, Gx, Gy)
% end zoomed in on L4
% end lagrange.m