- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# hnbody/kepler.h

Go to the documentation of this file.

    00001 #ifndef HNBODY_KEPLER_H
    00002 #define HNBODY_KEPLER_H
    00003
    00015 #include <mutils/platform.h>
    00016
    00017 #ifdef __cplusplus
    00018 extern "C" {
    00019 namespace HNBODY {
    00020 #endif
    00021
    00022
    00023 /*
    00024    Functions concerned with basic orbit/system properties.
    00025 */
    00026 DLLSPEC extern double
    00027   kepler_eccanom_base(double *M0, double M, double e),
    00028   kepler_eccanom(double M, double e),
    00029   kepler_hypanom(double M, double e),
    00030   kepler_paranom(double M),
    00031   kepler_meanconic(double *C, double r, double rv, double rv2, double GM),
    00032
    00033   kepler_conicanom_mean(double M, double e),
    00034   kepler_conicanom_true(double nu, double e),
    00035   kepler_trueanom_conic(double C, double e),
    00036   kepler_trueanom_mean(double M, double e),
    00037   kepler_meananom_conic(double C, double e),
    00038   kepler_meananom_true(double nu, double e),
    00039
    00040   kepler_L2(const double x[], const double v[]),
    00041   kepler_ds(double dt, double GM, double r0,  double v2,
    00042     double beta, double eta),
    00043   kepler_x_nu(double *nu, double M, double e),
    00044
    00045   kepler_kinenergy(double v[][3], const double m[], int n),
    00046   kepler_potenergy(double x[][3], const double m[], double G, int nh, int n),
    00047   kepler_energy(double x[][3], double v[][3], const double m[], double G,
    00048                 int n);
    00049
    00050
    00051 DLLSPEC extern void
    00052   kepler_Tmatrix(double T[][3], double i, double om, double psi),
    00053
    00054   kepler_xv_gr(double x[], double v[], double M, double dM,
    00055     double a, double e, double T[][3], double GM),
    00056   kepler_xv_mean(double x[], double v[], double M, double a, double e,
    00057     double T[][3], double GM),
    00058   kepler_xv_true(double x[], double v[], double nu, double a, double e,
    00059     double T[][3], double GM),
    00060
    00061   kepler_invplane(double *i, double *psi, const double L[]),
    00062   kepler_angmom(double L[], double x[][3], double v[][3], const double m[],
    00063                 int n),
    00064
    00065   kepler_cmass(double xcm[], double x[][3], const double m[], int n),
    00066
    00067   kepler_inert2bary(double y[][3], double x[][3], const double m[],
    00068     int ncm, int n),
    00069   kepler_bary2body(double y[][3], double x[][3], const double m[], int n),
    00070   kepler_body2bary(double y[][3], double x[][3], const double m[], int n),
    00071
    00072   kepler_etas(double eta[], double ieta[], double deta[], const double m[],
    00073     const int imap[], int n),
    00074   kepler_body2jac(double y[][3], double x[][3], const double m[],
    00075     const double ieta[], const int imap[], int n),
    00076   kepler_jac2body(double y[][3], double dy[][3], double x[][3],
    00077     const double m[], const double ieta[], const int imap[], int n),
    00078
    00079   kepler_dbody2djac(double djac[][3], double dbod[][3], const double m[],
    00080     const double ieta[], const int imap[], int n),
    00081   kepler_djac2dbody(double djac[][3], double dbod[][3], const double m[],
    00082     const double ieta[], const int imap[], int n),
    00083
    00084   kepler_canbody2jac(double x[][3], double v[][3], const double m[],
    00085     const double ieta[], const int imap[], int n),
    00086   kepler_jac2canbody(double x[][3], double v[][3], const double m[],
    00087     const double ieta[], const int imap[], int n),
    00088
    00089   kepler_ranorb(double *a, double *e, double *i, double amin, double amax,
    00090     double n, double p, double q);
    00091
    00092
    00093 DLLSPEC extern int
    00094   kepler_inert2baryPN(double xPN[][3], double vPN[][3], double mPN[],
    00095     double x[][3], double v[][3], const double m[], int n, double G, double c),
    00096
    00097   kepler_orbels(double *M, double *a, double *e, double *i, double *om,
    00098     double *psi, const double x[], const double v[], double GM);
    00099
    00100
    00101 /*
    00102    Functions advancing a Kepler orbit in physical or regularized time.
    00103 */
    00104 DLLSPEC extern int
    00105   kepler_tiptoe,
    00106   kepler_step(double x[], double v[], double GM, double dt),
    00107   kepler_pnstep(double x[], double v[], double GM, double ic2, double dt),
    00108   kepler_mmstep(double x[], double v[], double *rmin, double *rmax,
    00109     double GM, double dt),
    00110
    00111   kepler_delstep(double x[], double dx[], double v[], double dv[], double GM,
    00112     double dt),
    00113   kepler_delpnstep(double x[], double dx[], double v[], double dv[], double GM,
    00114     double ic2, double dt),
    00115   kepler_delmmstep(double x[], double dx[], double v[], double dv[],
    00116     double *rmin, double *rmax, double GM, double dt),
    00117
    00118   kepler_dstep(double x[], double v[], double dx[], double dv[], double GM,
    00119     double dt),
    00120
    00121   kepler_regstep(double x[], double v[], double *dt, double GM, double ds),
    00122   kepler_Eregstep(double x[], double v[], double *dt, double E, double ds),
    00123   kepler_dregstep(double x[], double v[], double dx[], double dv[], double *dt,
    00124     double GM, double ds),
    00125
    00126   kepler_lcstep(double x[], double v[], double *rmin, double dt, double domega),
    00127   kepler_grstep(double x[], double v[], double *rmin, double dt, double domega);
    00128
    00129
    00130 /*
    00131    Structure to manipulate orbital elements by name,
    00132    and supporting functions. Only kepler_xv_elems() can make
    00133    use of the (timeperi, epoch) pair.
    00134 */
    00135 typedef struct {
    00136   double semi, peridist, ecc;
    00137   double incl;
    00138   double longasc, longperi, argperi;
    00139   double meanlong, truelong, meanlati, truelati, meananom, trueanom,
    00140          timeperi, epoch;
    00141 } kepler_elems;
    00142
    00143 DLLSPEC extern void
    00144   kepler_blank_elems(kepler_elems *elems),
    00145   kepler_elems_xv(kepler_elems *elems, const double x[], const double v[],
    00146     double GM, int phase);
    00147
    00148 DLLSPEC extern int
    00149   kepler_fill_elems(kepler_elems *elems),
    00150   kepler_xv_elems(double x[], double v[], kepler_elems *elems, double GM);
    00151
    00152
    00153 /*
    00154    Negative eccentricities are used to denote bound or unbound radial orbits,
    00155    as e = 1 is always taken to represent a parabolic orbit (radial or not).
    00156    Symbolically define the meaning of e = -1 and e = -2:
    00157 */
    00158 enum kepler_radial_orbit_t { bound_radial=-1, unbound_radial=-2 };
    00159
    00160
    00161 #ifdef __cplusplus
    00162 }  // namespace HNBODY
    00163 }  // extern "C"
    00164 #endif
    00165
    00166 #endif  /* HNBODY_KEPLER_H */