HNBody Version 1.0.10

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

kepler.h
Go to the documentation of this file.
1 #ifndef HNBODY_KEPLER_H
2 #define HNBODY_KEPLER_H
3
15 #include <mutils/platform.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 namespace HNBODY {
20 #endif
21
22
23 /*
24 Functions concerned with basic orbit/system properties.
25 */
26 DLLSPEC extern double
27 kepler_eccanom_base(double *M0, double M, double e),
28 kepler_eccanom(double M, double e),
29 kepler_hypanom(double M, double e),
30 kepler_paranom(double M),
31 kepler_meanconic(double *C, double r, double rv, double rv2, double GM),
32
33 kepler_conicanom_mean(double M, double e),
34 kepler_conicanom_true(double nu, double e),
35 kepler_trueanom_conic(double C, double e),
36 kepler_trueanom_mean(double M, double e),
37 kepler_meananom_conic(double C, double e),
38 kepler_meananom_true(double nu, double e),
39
40 kepler_L2(const double x[], const double v[]),
41 kepler_ds(double dt, double GM, double r0, double v2,
42 double beta, double eta),
43 kepler_x_nu(double *nu, double M, double e),
44
45 kepler_kinenergy(double v[][3], const double m[], int n),
46 kepler_potenergy(double x[][3], const double m[], double G, int nh, int n),
47 kepler_energy(double x[][3], double v[][3], const double m[], double G,
48 int n);
49
50
51 DLLSPEC extern void
52 kepler_Tmatrix(double T[][3], double i, double om, double psi),
53
54 kepler_xv_gr(double x[], double v[], double M, double dM,
55 double a, double e, double T[][3], double GM),
56 kepler_xv_mean(double x[], double v[], double M, double a, double e,
57 double T[][3], double GM),
58 kepler_xv_true(double x[], double v[], double nu, double a, double e,
59 double T[][3], double GM),
60
61 kepler_invplane(double *i, double *psi, const double L[]),
62 kepler_angmom(double L[], double x[][3], double v[][3], const double m[],
63 int n),
64
65 kepler_cmass(double xcm[], double x[][3], const double m[], int n),
66
67 kepler_inert2bary(double y[][3], double x[][3], const double m[],
68 int ncm, int n),
69 kepler_bary2body(double y[][3], double x[][3], const double m[], int n),
70 kepler_body2bary(double y[][3], double x[][3], const double m[], int n),
71
72 kepler_etas(double eta[], double ieta[], double deta[], const double m[],
73 const int imap[], int n),
74 kepler_body2jac(double y[][3], double x[][3], const double m[],
75 const double ieta[], const int imap[], int n),
76 kepler_jac2body(double y[][3], double dy[][3], double x[][3],
77 const double m[], const double ieta[], const int imap[], int n),
78
79 kepler_inert2body(double y[][3], double x[][3], int n),
80 kepler_inert2jac(double y[][3], double x[][3], const double m[],
81 const double ieta[], const int imap[], int n),
82
83 kepler_dbody2djac(double djac[][3], double dbod[][3], const double m[],
84 const double ieta[], const int imap[], int n),
85 kepler_djac2dbody(double djac[][3], double dbod[][3], const double m[],
86 const double ieta[], const int imap[], int n),
87
88 kepler_canbody2jac(double x[][3], double v[][3], const double m[],
89 const double ieta[], const int imap[], int n),
90 kepler_jac2canbody(double x[][3], double v[][3], const double m[],
91 const double ieta[], const int imap[], int n),
92
93 kepler_ranorb(double *a, double *e, double *i, double amin, double amax,
94 double n, double p, double q);
95
96
97 DLLSPEC extern int
98 kepler_inert2baryPN(double xPN[][3], double vPN[][3], double mPN[],
99 double x[][3], double v[][3], const double m[], int n, double G, double c),
100
101 kepler_orbels(double *M, double *a, double *e, double *i, double *om,
102 double *psi, const double x[], const double v[], double GM);
103
104
105 /*
106 Functions advancing a Kepler orbit in physical or regularized time.
107 */
108 DLLSPEC extern int
109 kepler_tiptoe,
110 kepler_step(double x[], double v[], double GM, double dt),
111 kepler_pnstep(double x[], double v[], double GM, double ic2, double dt),
112 kepler_mmstep(double x[], double v[], double *rmin, double *rmax,
113 double GM, double dt),
114
115 kepler_delstep(double x[], double dx[], double v[], double dv[], double GM,
116 double dt),
117 kepler_delpnstep(double x[], double dx[], double v[], double dv[], double GM,
118 double ic2, double dt),
119 kepler_delmmstep(double x[], double dx[], double v[], double dv[],
120 double *rmin, double *rmax, double GM, double dt),
121
122 kepler_dstep(double x[], double v[], double dx[], double dv[], double GM,
123 double dt),
124
125 kepler_regstep(double x[], double v[], double *dt, double GM, double ds),
126 kepler_Eregstep(double x[], double v[], double *dt, double E, double ds),
127 kepler_dregstep(double x[], double v[], double dx[], double dv[], double *dt,
128 double GM, double ds),
129
130 kepler_lcstep(double x[], double v[], double *rmin, double dt, double domega),
131 kepler_grstep(double x[], double v[], double *rmin, double dt, double domega);
132
133
134 /*
135 Structure to manipulate orbital elements by name,
136 and supporting functions. Only kepler_xv_elems() can make
137 use of the (timeperi, epoch) pair.
138 */
139 typedef struct {
140 double semi, peridist, ecc;
141 double incl;
142 double longasc, longperi, argperi;
143 double meanlong, truelong, meanlati, truelati, meananom, trueanom,
144 timeperi, epoch;
145 } kepler_elems;
146
147 DLLSPEC extern void
148 kepler_blank_elems(kepler_elems *elems),
149 kepler_elems_xv(kepler_elems *elems, const double x[], const double v[],
150 double GM, int phase);
151
152 DLLSPEC extern int
153 kepler_fill_elems(kepler_elems *elems),
154 kepler_xv_elems(double x[], double v[], kepler_elems *elems, double GM);
155
156
157 /*
158 Negative eccentricities are used to denote bound or unbound radial orbits,
159 as e = 1 is always taken to represent a parabolic orbit (radial or not).
160 Symbolically define the meaning of e = -1 and e = -2:
161 */
162 enum kepler_radial_orbit_t { bound_radial=-1, unbound_radial=-2 };
163
164
165 #ifdef __cplusplus
166 } // namespace HNBODY
167 } // extern "C"
168 #endif
169
170 #endif /* HNBODY_KEPLER_H */
platform.h
MathUtils platform identification macros.
kepler_elems
Definition: kepler.h:139