34 #ifndef FGRUNGEKUTTA_H 35 #define FGRUNGEKUTTA_H 47 #define ID_RUNGEKUTTA "$Id: FGRungeKutta.h,v 1.1 2010/06/02 04:05:13 jberndt Exp $" 76 virtual double pFunc(
double x,
double y) = 0;
90 enum eStates { eNoError=0, eMathError=1, eFaultyInit=2, eEvolve=4, eUnknown=8} ;
92 int init(
double x_start,
double x_end,
int intervals = 4);
96 double getXEnd() {
return x_end; }
97 double getError() {
return err; }
99 int getStatus() {
return status; }
100 int getIterations() {
return iterations; }
101 void clearStatus() { status = eNoError; }
102 void setTrace(
bool t) { trace_values = t; }
106 FGRungeKutta(): status(eNoError), trace_values(
false), iterations(0) {};
117 virtual double approximate(
double x,
double y) = 0;
119 bool sane_val(
double x);
121 static const double RealLimit;
144 double approximate(
double x,
double y);
169 double getEpsilon() {
return epsilon; }
170 int getShrinkAvail() {
return shrink_avail; }
171 void setEpsilon(
double e) { epsilon = e; }
172 void setShrinkAvail(
int s) { shrink_avail = s; }
176 double approximate(
double x,
double y);
181 static const double A2[], A3[], A4[], A5[], A6[];
182 static const double B[], Bs[], C[];
Runge-Kutta-Fehlberg method.
Minimalistic implementation of some Runge-Kutta methods.