9 #ifndef __ORBIT_SOLVER_H 10 #define __ORBIT_SOLVER_H 12 #include "../Core/SharedLibraryExportMacros.h" 13 #include "../Core/AstronomicalConstants.h" 14 #include "../Core/Common.h" 15 #include "../Core/OrbitalExpressions.h" 16 #include "../Core/Common.h" 28 #include <gsl/gsl_odeiv2.h> 29 #include <gsl/gsl_errno.h> 30 #include <gsl/gsl_poly.h> 38 typedef int (*GSL_ODE_TYPE)(double,
const double*,
double*,
void*);
39 typedef int (*GSL_JAC_TYPE)(double,
const double*,
double*,
double*,
void*);
40 typedef bool (*STOP_EVOL_TYPE)(double,
const double*,
void*);
50 const double *parameters,
68 const double *parameters,
98 double y=Core::NaN) : __x(x), __y(y) {}
101 double x()
const {
return __x;}
103 double &
x() {
return __x;}
106 double y()
const {
return __y;}
108 double &
y() {
return __y;}
127 __e_order_downgrade_threshold,
130 __last_e_order_upgrade_age;
150 __discarded_stop_ages;
152 std::list< std::valarray<double> >
154 __orbit_deriv_history,
163 __stop_cond_discarded,
168 __stop_deriv_discarded;
187 void output_history_and_discarded(std::ostream &os);
195 void clear_discarded();
201 void insert_discarded(
double age,
202 const std::valarray<double> ¤t_stop_cond,
203 const std::valarray<double> ¤t_stop_deriv);
206 void add_to_evolution(
221 double go_back(
double max_age,
223 std::valarray<double> &orbit);
227 void clear_history();
239 size_t cond_ind,
size_t max_points)
const;
248 size_t condition_index)
const;
262 double crossing_from_history_no_deriv(
264 size_t condition_index)
const;
270 double crossing_from_history(
272 size_t condition_index)
const;
281 bool at_exact_condition(
double previous_age,
292 bool acceptable_step(
double current_age,
299 int check_expansion_error(
301 const std::valarray<double> &derivatives,
305 const std::valarray<double> &expansion_errors
319 const std::valarray<double> &orbit,
322 const std::valarray<double> &derivatives,
326 const std::valarray<double> &expansion_errors,
339 bool ignore_e_order_decrease=
false 357 std::valarray<double> &orbit,
395 std::valarray<double> &orbit,
427 const std::list<double> &required_ages);
433 void reached_stopping_condition(
443 void adjust_eccentricity_order(
448 const std::valarray<double> &orbit,
454 bool must_increase =
false 467 double required_precision,
471 bool print_progress=
false 482 double max_step=Core::Inf,
485 const std::list<double> &required_ages=std::list<double>(),
495 {
return __tabulated_ages;}
499 {
return __tabulated_evolution_modes;}
503 {
if(__stopping_conditions)
delete __stopping_conditions;}
double __runtime_limit
Max number of seconds current evolution is allowed to run.
double __precision
The precision required of the solution.
const std::list< Core::EvolModeType > & mode_evolution() const
The tabulated evolution modes so far.
std::list< Core::EvolModeType > __tabulated_evolution_modes
The evolution mode corresponding to the matching tabulated age.
Declares the StopHistoryInterval class.
Users can define any stopping condition they wish the evolution to search for in this file...
struct LIB_PUBLIC OrbitSolver
Opaque struct to cast to/from Evolve::OrbitSolver.
StoppingConditionType
The reasons for stopping the evolution currently supported.
Orientations of zones of bodies in a binary system.
time_t __evolution_start_time
When did the currently running evolution start.
std::list< std::valarray< double > > __stop_deriv_history
Past values of the stop condition derivatives.
std::vector< StopInformation > __stop_info
A base class for all stopping conditions.
Defines the BinarySystem class.
bool __print_progress
See print_progress argument of constructor.
EvolModeType
The various evolution modes.
std::valarray< size_t > __skip_history_zerocrossing
The number of points at the start of the history to skip when lookng for a zero crossing for each con...
int stellar_system_jacobian(double age, const double *orbital_parameters, double *param_derivs, double *age_derivs, void *system_mode)
A wrapper tha allows the stellar system jacobian to be passed to the GSL ODE solver.
Solves the system of ODEs describing the evolution of a single planet around a single star...
Declares a class for a stopping condition that combines other stopping conditions.
A class combining the the outputs of multiple stopping conditions.
std::list< double > __stop_history_ages
The ages at which the stop condition history is kept.
std::valarray< double > __skip_history_extremum
The age after which to look for extrema for each condition.
std::list< double > __tabulated_ages
The ages at which solution is tabulated.
Describes a system of two bodies orbiting each other.
A collection of accepted and discarded evolution steps which contain some reason to stop...
StoppingCondition * __stopping_conditions
The current set of stopping conditions.
const std::list< double > & evolution_ages() const
The ages at which evolution has been tabulated so far.
int stellar_system_diff_eq(double age, const double *parameters, double *derivatives, void *system_mode)
A wrapper tha allows the stellar system differential equation to be passed to the GSL ODE solver...