Application 4.3B Comets and Spacecaft The investigations outlined hee ae intended as applications of the moe sophisticated numeical DE solves that ae "built into" computing systems such as Maple, Mathematica, and MATLAB (as opposed to the ad hoc Runge-Kutta methods of the pevious poject.) We illustate these high-pecision vaiable step size solves by applying them to analyze the elliptical obit of a satellite a comet, planet, o spacecaft aound a pimay (planet o sun) of mass M. If the attacting pimay is located at the oigin in xyz-space, then the satellite's position functions xt ( ), yt ( ), and zt ( ) satisfy Newton's invese-squae law diffeential equations 2 2 2 d x µ x d y µ y d z µ z =, =, = (1) 2 3 2 3 2 3 dt dt dt whee µ = GM (G being the gavitational constant) and 2 2 2 = x + y + z. Investigation A Conside a satellite in elliptical obit aound a planet, and suppose that physical units ae so chosen that µ = 1. If the obit lies in the xy-plane so zt ( ) 0, the Eqs. (1) educe to 2 2 d x x d y y, 2 3 2 3 = =. (2) dt dt Let T denote the peiod of evolution of the satellite in its obit. Keple's thid law says that the squae of T is popotional to the cube of the majo semiaxis a of its elliptical obit. In paticula, if µ = 1, then T = 4π a. (3) 2 2 3 (See Section 12.6 of Edwads and Penney, Calculus, 6th ed. (Pentice Hall, 2002).) If the satellite's x- and y-components of velocity, x2 = x = x 1 and y2 = y = y 1, ae intoduced, then the system in (2) tanslates into the system µ x1 x 1 = x2, x 2 = 3 µ y y = y, y = 1 1 2 2 3 (4) 2 of fou fist-ode equations with = x + y 1 2 1. Application 4.3B 107
(i) Solve Eqs. (2) o (4) numeically with the initial conditions x (0) = 1, y (0) = 0, x (0) = 0, y (0) = 1 that coespond theoetically to a cicula obit of adius a = 1, in which case Eq. (3) gives T = 2π. Ae you numeical esults consistent with this fact? (ii) Now solve the system numeically with the initial conditions 1 x (0) = 1, y (0) = 0, x (0) = 0, y (0) = 2 6 that coespond theoetically to an elliptical obit with majo semiaxis a = 2, so Eq. (3) gives T = 4π 2. Do you numeical esults agee with this? (iii) Investigate what happens when both the x-component and the y-component of the initial velocity ae nonzeo. Investigation B (Halley's Comet) Halley's comet last eached peihelion (its point of closest appoach to the sun at the oigin) on Febuay 9, 1986. Its position and velocity components at this time wee p 0 = (0.325514, -0.459460, 0.166229) v 0 = (-9.096111, -6.916686, -1.305721) and (espectively) with position in AU (Astonomical Units, the unit of distance being equal to the majo semiaxis of the eath's obit about the sun) and time in yeas. In this unit system, its 3-dimensional equations of motion ae as in (1) with µ = 4π 2. Then solve Eqs. (1) numeically to veify the appeaance of the yz-pojection of the obit of Halley's comet shown in Fig. 4.3.13 in the text. Plot the xy- and xz-pojections also. Figue 4.3.14 in the text shows the gaph of the distance (t) of Halley's comet fom the sun. Inspection of this gaph indicates that Halley's comet eaches a maximum distance (at aphelion) of about 35 AU in a bit less than 40 yeas, and etuns to peihelion afte about thee-quates of a centuy. The close look in Fig. 4.3.15 indicates that the peiod of evolution of Halley's comet is about 76 yeas. Use you numeical solution to efine these obsevations. What is you best estimate of the calenda date of the comet's next peihelion passage? Investigation C (You Own Comet) Lucky you! The night befoe you bithday in 1997 you set up you telescope on neaby mountaintop. It was a clea night, and at 12:30 am you spotted a new comet. Afte epeating the obsevation on successive nights, you wee able to calculate its sola system coodinates p 0 = (x 0, y 0, z 0 ) and its velocity vecto v 0 = (vx 0, vy 0, vz 0 ) on that fist night. Using this infomation, detemine this comet's 108 Chapte 4
peihelion (point neaest sun) and aphelion (fathest fom sun), its velocity at peihelion and at aphelion, its peiod of evolution about the sun, and its next two dates of peihelion passage. Using length-time units of AU and eath yeas, the comet's equations of motion ae given in (1) with µ = 4π 2. Fo you pesonal comet, stat with andom initial position and velocity vectos with the same ode of magnitude as those of Halley's comet. Repeat the andom selection of initial position and velocity vectos, if necessay, until you get a nicelooking eccentic obit that goes well outside the eath's obit (like eal comets do). Using Maple Let's conside a comet obiting the sun with initial position and velocity vectos p0 := {x(0)=0.2, y(0)=0.4, z(0)=0.2}; v0 := {D(x)(0)=5, D(y)(0)=-7, D(z)(0)=9}; at peihelion. Fo convenience, we combine these initial conditions in the single set inits := p0 union v0; of equations. The comet's equations of motion in (1) with µ = 4π 2 ae enteed as := t->sqt(x(t)^2 + y(t)^2 + z(t)^2); de1 := diff(x(t),t$2) = -4*Pi^2*x(t)/(t)^3: de2 := diff(y(t),t$2) = -4*Pi^2*y(t)/(t)^3: de3 := diff(z(t),t$2) = -4*Pi^2*z(t)/(t)^3: deqs := {de1,de2,de3}: The comet's x-, y-, and z-position functions then satisfy the combined set eqs := deqs union inits: of thee second-ode diffeential equations and six initial conditions, which we poceed to solve numeically. soln := dsolve(eqs, {x(t),y(t),z(t)}, type=numeic); soln := poc(kf45_x)... end We use the esulting numeical pocedue soln to plot the yz-pojection of the comet's obit fo the fist 20 yeas: Application 4.3B 109
with(plots): odeplot(soln, [y(t),z(t)], 0..20, numpoints=1000); This obit cetainly looks like an ellipse. To investigate the comet's motion on its obit, we plot its distance fom the sun as a function of t. odeplot(soln, [t,(t)], 0..20, numpoints=1000); The comet appeas to each aphelion afte about 8 yeas, and to etun to peihelion afte about 16 yeas. Zooming in on the aphelion, odeplot(soln,[t,(t)], 8.0..8.2); 110 Chapte 4
we see that the comet eaches a maximal distance fom the sun of about 12.31 AU afte about 8.09 yeas. Zooming in on the peihelion, odeplot(soln, [t,(t)], 16.1..16.3); we see that the comet appeas to etun to a minimal distance of about 0.49 AU fom the sun afte about 16.18 yeas. Using Mathematica Let's conside a comet obiting the sun with initial position and velocity vectos p0 = {x[0]==0.2, y[0]==0.4, z[0]==0.2} v0 = {x'[0]==5, y'[0]==-7, z'[0]==9} at peihelion. Fo convenience, we combine these initial conditions in the single set inits = Union[p0,v0] of equations. The comet's equations of motion in (1) with µ = 4π 2 ae enteed as [t_] = Sqt[x[t]^2 + y[t]^2 + z[t]^2] de1 = de2 = de3 = x''[t] == -4 Pi^2 x[t]/[t]^3; y''[t] == -4 Pi^2 y[t]/[t]^3; z''[t] == -4 Pi^2 z[t]/[t]^3; deqs = {de1,de2,de3} The comet's x-, y-, and z-position functions then satisfy the combined set eqs = Union[deqs, inits] of thee second-ode diffeential equations and six initial conditions, which we poceed to solve numeically. Application 4.3B 111
soln = NDSolve[eqs, {x, y, z}, {t, 0, 20}] {{x -> IntepolatingFunction[{{0.,20.}}, <>], y -> IntepolatingFunction[{{0.,20.}}, <>], z -> IntepolatingFunction[{{0.,20.}}, <>]}} The esult soln is a list of thee numeical "intepolating functions" x = Fist[x /. soln]; y = Fist[y /. soln]; z = Fist[z /. soln]; that we can use to plot the yz-pojection of the comet's obit fo the fist 20 yeas: PaameticPlot[Evaluate[{y[t],z[t]}], {t,0,20}] z -10-8 -6-4 -2-1 -2-3 -4-5 y This cetainly looks like an ellipse. To investigate the comet's motion on this obit, we plot its distance fom the sun as a function of t. Plot[Evaluate[[t]], {t, 0, 20}] 12 10 8 6 4 2 5 10 15 20 t 112 Chapte 4
The comet appeas to each aphelion afte about 8 yeas, and to etun to peihelion afte about 16 yeas. Zooming in on the aphelion, Plot[Evaluate[[t]], {t, 8.05, 8.15}, PlotRange -> {12.3062, 12.3068}] 12.3068 12.3067 12.3066 12.3065 12.3064 12.3063 8.06 8.08 8.12 8.14 t we see that the comet eaches a maximal distance fom the sun of about 12.31 AU afte about 8.09 yeas. Zooming in on the peihelion, Plot[Evaluate[[t]], {t, 16.15, 16.25}, PlotRange -> {0.45, 0.55}, 0.54 0.52 16.16 16.18 16.22 16.24 t 0.48 0.46 we see that the comet appeas to etun to a minimal distance of about 0.49 AU fom the sun afte about 16.18 yeas. Using MATLAB Let's conside a comet obiting the sun with initial position and velocity column vectos 0 = [0.2; 0.4; 0.2]; v0 = [5; -7; 9]; Application 4.3B 113
at peihelion. We combine these initial values into the single 6-component vecto inits = [p0; v0]; The following MATLAB function saved as ypcomet.m seves to define the comet's equations of motion in (1) with µ = 4π 2. function yp = ypcomet(t,y) yp = y; vx = y(4); vy = y(5); vz = y(6);% velocity comps x = y(1); z = y(3); y = y(2);% coodinates = sqt( x*x + y*y + z*z ); % adius 3 = **; % -cubed k = 4*pi^2; % fo AU-y units yp(1) = vx; yp(2) = vy; yp(3) = vz; yp(4) = -k*x/3; yp(5) = -k*y/3; yp(6) = -k*z/3; We poceed to solve these diffeential equations numeically with the given initial conditions. options = odeset('eltol',1e-6); % eo toleance tspan = 0 : 0.01 : 20; % fom t=0 to t=20 with dt=0.01 [t,y] = ode45('ypcomet',0:0.01:20, inits, options); Hee t is the vecto of times and y is a matix whose fist 3 column vectos give the coesponding position coodinates of the comet. We need only plot the second and thid of these vectos against each othe to see the yz-pojection of the comet's obit fo the fist 20 yeas. plot(y(:,2),y(:,3)), axis([-12 2-12 2]), axis squae The esulting obit (at the top of the next page) cetainly looks like an ellipse. 114 Chapte 4
2 0-2 -4 z -6-8 -10-12 -12-10 -8-6 -4-2 0 2 y To investigate the comet's motion on this obit, we plot its distance fom the sun as a function of t. = sqt(y(:,1).^2 + y(:,2).^2 + y(:,3).^2); plot(t, ) 14 12 10 8 6 4 2 0 0 2 4 6 8 10 12 14 16 18 20 t Application 4.3B 115
The comet appeas to each aphelion afte about 8 yeas, and to etun to peihelion afte about 16 yeas. We can zoom in on the aphelion with the command axis([8.05 8.15 12.3065 12.3075]), gid on and see (in the figue below) that the comet eaches a maximal distance fom the sun of about 12.31 AU afte about 8.09 yeas. We zoom in on the peihelion with the command axis([16.1 16.3 0.4 0.8]), gid on and see (in the figue at the top of the next page) that it appeas to etun to a minimal distance of about 0.49 AU fom the sun afte about 16.18 yeas. 12.3075 12.3074 12.3073 12.3072 12.3071 12.307 12.3069 12.3068 12.3067 12.3066 12.3065 8.05 8.06 8.07 8.08 8.09 8.1 8.11 8.12 8.13 8.14 8.15 t Zooming in on the comet's aphelion 116 Chapte 4
0.8 0.75 0.7 0.65 0.6 0.55 0.5 0.45 0.4 16.1 16.12 16.14 16.16 16.18 16.2 16.22 16.24 16.26 16.28 16.3 t Zooming in on the comet's peihelion Eath-Moon Satellite Obits We conside finally an Apollo satellite in obit about the Eath E and the Moon M. Figue 4.3.8 in the text shows an x 1 x 2 -coodinate system whose oigin lies at the cente of mass of the Eath and the Moon, and which otates at the ate of one evolution pe "moon month" of appoximately τ = 27.32 days, so the Eath and Moon emain fixed in thei positions on the x 1 -axis. If we take as unit distance the distance between the Eath and Moon centes, then thei coodinates ae E( µ, 0) and M(1 µ, 0), whee µ = mm ( me + mm) in tems of the Eath mass m E and the Moon mass m M. If we take the total mass me + mm as the unit of mass and τ / 2 π 4.348 days as the unit of time, then the gavitational constant has value G = 1, and the equations of motion of the satellite position S(x 1, x 2 ) ae (1 µ )( x + µ ) µ ( x 1 + µ ) x = x + 2x (1a) 1 1 1 1 2 3 3 E M and (1 µ ) x µ x x = x 2x (1b) 2 2 2 2 1 3 3 E M Application 4.3B 117
2 2 2 2 whee E = ( x1 + µ ) + x2 and M = ( x1 + µ 1) + x2 denote the satellite's distance to the Eath and Moon, espectively. The initial two tems on the ight-hand side of each equation in (1) esult fom the otation of the coodinate system. In the system of units descibed hee, the luna mass is appoximately µ = m M = 0.012277471. The secondode system in (1) can be conveted to a fist-ode system by substituting x 1 = x3, x 2 = x4 so 3 1 x = x, x 4 = x 2. (2) This system is defined in the MATLAB function function yp = ypmoon(t,y) m1 = 0.012277471; m2 = 0.987722529; % mass of moon % mass of eath 1 = nom([y(1)+m1, y(2)]); % Distance to the eath 2 = nom([y(1)-m2, y(2)]); % Distance to the moon yp = [ y(3); y(4); 0; 0 ]; % Column 4-vecto yp(3) = y(1)+2*y(4)-m2*(y(1)+m1)/1^3-m1*(y(1)-m2)/2^3; yp(4) = y(2)-2*y(3) - m2*y(2)/1^3 - m1*y(2)/2^3; Suppose that the satellite initially is in a clockwise cicula obit of adius about 1500 miles about the Moon. At its fathest point fom the Eath (x 1 = 0.994) it is "launched" into Eath-Moon obit with initial velocity v 0. We then want to solve the system in (2) with the ight-hand functions in (1) substituted fo x 1 and x 2 with the initial conditions x 1 (0) = 0.994, x 2 (0) = 0, x 3 (0) = 0, x 4 (0) = v 0. (3) In the system of units used hee, the unit of velocity is appoximately 2289 miles pe hou. Some initial conditions and final times of paticula inteest ae defined by the function function [tf,y0] = mooninit(k) % Initial conditions fo k-looped Apollo obit 118 Chapte 4
if k == 2, tf = 5.436795439260; y0 = [ 0.994 0 0-2.113898796695 ]'; elseif k == 3, tf = 11.124340337266; y0 = [ 0.994 0 0-2.031732629557 ]'; elseif k == 4, tf = 17.065216560158; y0 = [ 0.994 0 0-2.001585106379 ]'; end The fist two components of y0 ae the coodinates of the initial position, and the last two components ae the components of the initial velocity; tf is then the time equied to complete one obit. The cases k = 3 and k = 4 yield Figues 4.3.9 and 4.3.10 (espectively) in the text. The following commands (with k = 2) yield the figue shown on the next page, and illustate how such figues ae plotted. [tf,y0] = mooninit(2); options = odeset('reltol',1e-9,'abstol',1e-12); [t,y] = ode45('ypmoon', [0,tf], y0, options); plot(y(:,1), y(:,2)); axis([-1.5 1.3-1.4 1.4]), axis squae The small elative and absolute eo toleances ae needed to insue that the obit closes smoothly when the satellite etuns to its initial position. You might like to ty the values k = 3 and k = 4 to geneate the analogous 3- and 4-looped obits. A moe substantial poject would be to seach empiically fo initial velocities yielding peiodic obits with moe than 4 loops. Futhe Investigations See the Application 4.3C page at the web site www.penhall.com/edwads fo additional investigations of comets, satellites, and tajectoies of baseballs with ai esistance (as in Example 4 of Section 4.3 in the text). Application 4.3B 119
1 The cases k = 3 and k = 3 yield Figues 4.3.9 and 4.3.10 (espectively) in the 0.5 0 Eath Moon -0.5-1 -1.5-1 -0.5 0 0.5 1 120 Chapte 4