projects/maven/
morbit.pro
Routines
top source morbit
morbit, param, dt=dt, planet=planet, nmax=nmax, oerr=oerr, result=result, norbit=norbit, oplot=oplot, tplot=tplot, orient=orient, flythru=flythru, shock=shock, ps=ps, xyrange=xyrange
PROCEDURE: morbit PURPOSE: Given the orbit size and shape (based on 2 of 5 orbital parameters), calculates the orbital position and velocity of a satellite around a planet as a function of time. This routine is very fast when the orbital eccentricity is less than 0.95, but labors when it is very close to unity. This routine will not work at all for parabolic and hyperbolic orbits. Calculations assume a spherical central body with a spherically symmetric mass distribution. You can also specify an orientation for the orbit and then create a 'fly-through' in cartesian coordinates. USAGE: morbit, param, dt=dt, result=dat INPUTS: PARAM: Orbit parameter structure, which has two of the following tags: period : orbital period (hours) sma : semi-major axis (km) palt : periapsis altitude (km) aalt : apoapsis altitude (km) ecc : eccentricity The two parameters you specify must define the size and shape of the orbit. Any two will work, except for period and sma, which both define the orbit size. The remaining parameters are calculated from the two you specify. KEYWORDS: ORIENT: A structure specifying the orientation of the orbit with three tags: lon : longitude of periapsis (deg) lat : latitude of periapsis (deg) incl : orbital inclination (deg) Lon and lat can be arrays, resulting in a grid of calculations. Incl must be a scalar. Note that abs(lat) <= abs(incl) is required. Default = {lon:0, lat:0, incl:90} Normally, the longitude, latitude, and inclination are specified in planetocentric coordinates (i.e., relative to the planet's spin axis); however, any coordinate system can be assumed, so long as all three parameters are in the SAME coordinate system. FLYTHRU: The name for a text output file containing the cartesian coordinates of the satellite vs. time for the orbit orientation specified in ORIENT. The columns for this table are: 1 -> time (sec after apoapsis) 2 -> X (km) 3 -> Y (km) 4 -> Z (km) 5 -> orbital velocity (km/s) If you don't specify this keyword, then the fly-through is still calculated and saved in RESULT. PLANET: This can be a string to select one of the eight planets. The following are also recognized: Moon, Sun, Pluto, Charon, Eris, and Ceres. It can also be a structure with the following tags: Mass : mass (g) Radius : radius (km) Name : 'name' [optional] Default = 'Mars'. If PLANET is unrecognized, you will be prompted for mass and radius. SHOCK: If PLANET = 'Mars' or 'Earth', then setting this keyword will show the nominal shock location on the orbit plots (see keyword OPLOT). Default = no. DT: Time resolution (sec). Default = PARAM.period/1000. NORBIT: Number of orbits for calculating the solution. Default = 1. NMAX: Maximum number of iterations for the orbit solver. Default = 400. Larger numbers might be needed if the orbital eccentricity is greater than 0.95. OERR: Maximum error in orbit solution, which translates roughly into fractional error in the position. Default = 1.e-6. Increase this only if you want a quicker solution at the expense of accuracy. RESULT: A structure containing the satellite altitude and true anomaly versus time. The true anomaly is the angle in the plane of the orbit about the center of the planet, with zero degrees at periapsis. The orbital velocity, and the orbit size and shape parameters are also given. OPLOT: The number of an IDL window for plotting the orbit with three orthogonal views. Default = none. TPLOT: The number of an IDL window for a time series plot of altitude and orbital velocity. Default = none. PS: Postscript plots are produced for OPLOT and TPLOT. $LastChangedBy: dmitchell $ $LastChangedDate: 2014-10-31 14:21:01 -0700 (Fri, 31 Oct 2014) $ $LastChangedRevision: 16107 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/morbit.pro $ CREATED BY: David L. Mitchell
Parameters
- param
Keywords
- dt
- planet
- nmax
- oerr
- result
- norbit
- oplot
- tplot
- orient
- flythru
- shock
- ps
- xyrange
File attributes
Modification date: | Fri Nov 21 06:43:14 2014 |
Lines: | 542 |