HNBody Version 1.2.1

- 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_normalize(double x[], double dx[]),
53
54 kepler_Tmatrix(double T[][3], double i, double om, double psi),
55
56 kepler_xv_gr(double x[], double v[], double M, double dM,
57 double a, double e, double T[][3], double GM),
58 kepler_xv_mean(double x[], double v[], double M, double a, double e,
59 double T[][3], double GM),
60 kepler_xv_true(double x[], double v[], double nu, double a, double e,
61 double T[][3], double GM),
62
63 kepler_invplane(double *i, double *psi, const double L[]),
64 kepler_angmom(double L[], double x[][3], double v[][3], const double m[],
65 int n),
66
67 kepler_cmass(double xcm[], double x[][3], const double m[], int n),
68
69 kepler_inert2bary(double y[][3], double x[][3], const double m[],
70 int ncm, int n),
71 kepler_bary2body(double y[][3], double x[][3], const double m[], int n),
72 kepler_body2bary(double y[][3], double x[][3], const double m[], int n),
73
74 kepler_etas(double eta[], double ieta[], double deta[], const double m[],
75 const int imap[], int n),
76 kepler_body2jac(double y[][3], double x[][3], const double m[],
77 const double ieta[], const int imap[], int n),
78 kepler_jac2body(double y[][3], double dy[][3], double x[][3],
79 const double m[], const double ieta[], const int imap[], int n),
80
81 kepler_inert2body(double y[][3], double x[][3], int n),
82 kepler_inert2jac(double y[][3], double x[][3], const double m[],
83 const double ieta[], const int imap[], int n),
84
85 kepler_dbody2djac(double djac[][3], double dbod[][3], const double m[],
86 const double ieta[], const int imap[], int n),
87 kepler_djac2dbody(double djac[][3], double dbod[][3], const double m[],
88 const double ieta[], const int imap[], int n),
89
90 kepler_canbody2jac(double x[][3], double v[][3], const double m[],
91 const double ieta[], const int imap[], int n),
92 kepler_jac2canbody(double x[][3], double v[][3], const double m[],
93 const double ieta[], const int imap[], int n),
94
95 kepler_ranorb(double *a, double *e, double *i, double amin, double amax,
96 double n, double p, double q);
97
98
99 DLLSPEC extern int
100 kepler_inert2baryPN(double xPN[][3], double vPN[][3], double mPN[],
101 double x[][3], double v[][3], const double m[], int n, double G, double c),
102
103 kepler_orbels(double *M, double *a, double *e, double *i, double *om,
104 double *psi, const double x[], const double v[], double GM);
105
106
107 /*
108 Functions advancing a Kepler orbit in physical or regularized time.
109 */
110 DLLSPEC extern int
111 kepler_tiptoe,
112 kepler_step(double x[], double v[], double GM, double dt),
113 kepler_pnstep(double x[], double v[], double GM, double ic2, double dt),
114 kepler_mmstep(double x[], double v[], double *rmin, double *rmax,
115 double GM, double dt),
116
117 kepler_delstep(double x[], double dx[], double v[], double dv[], double GM,
118 double dt),
119 kepler_delpnstep(double x[], double dx[], double v[], double dv[], double GM,
120 double ic2, double dt),
121 kepler_delmmstep(double x[], double dx[], double v[], double dv[],
122 double *rmin, double *rmax, double GM, double dt),
123
124 kepler_dstep(double x[], double v[], double dx[], double dv[], double GM,
125 double dt),
126
127 kepler_regstep(double x[], double v[], double *dt, double GM, double ds),
128 kepler_Eregstep(double x[], double v[], double *dt, double E, double ds),
129 kepler_dregstep(double x[], double v[], double dx[], double dv[], double *dt,
130 double GM, double ds),
131
132 kepler_lcstep(double x[], double v[], double *rmin, double dt, double domega),
133 kepler_grstep(double x[], double v[], double *rmin, double dt, double domega);
134
135
136 /*
137 Structure to manipulate orbital elements by name,
138 and supporting functions. Only kepler_xv_elems() can make
139 use of the (timeperi, epoch) pair.
140 */
141 typedef struct {
142 double semi, peridist, ecc;
143 double incl;
144 double longasc, longperi, argperi;
145 double meanlong, truelong, meanlati, truelati, meananom, trueanom,
146 timeperi, epoch;
147 } kepler_elems;
148
149 DLLSPEC extern void
150 kepler_blank_elems(kepler_elems *elems),
151 kepler_elems_xv(kepler_elems *elems, const double x[], const double v[],
152 double GM, int phase);
153
154 DLLSPEC extern int
155 kepler_fill_elems(kepler_elems *elems),
156 kepler_xv_elems(double x[], double v[], kepler_elems *elems, double GM);
157
158
159 /*
160 Negative eccentricities are used to denote bound or unbound radial orbits,
161 as e = 1 is always taken to represent a parabolic orbit (radial or not).
162 Symbolically define the meaning of e = -1 and e = -2:
163 */
164 enum kepler_radial_orbit_t { bound_radial=-1, unbound_radial=-2 };
165
166
167 #ifdef __cplusplus
168 } // namespace HNBODY
169 } // extern "C"
170 #endif
171
172 #endif /* HNBODY_KEPLER_H */
platform.h
MathUtils platform identification macros.
kepler_elems
Definition: kepler.h:141