29 #include "../precompiled.h"
111 double delta, halfDelta;
115 halfDelta = delta * 0.5;
171 double delta, halfDelta, sixthDelta;
175 halfDelta = delta * 0.5;
194 sixthDelta = delta * (1.0/6.0);
196 newState[
i] = state[
i] + sixthDelta * (
d1[
i] + 2.0 * (
d2[
i] +
d3[
i]) +
d4[i]);
256 double delta, halfDelta, fourthDelta, sixthDelta;
262 for ( n = 0; n < 4; n++ ) {
264 halfDelta = delta * 0.5;
265 fourthDelta = delta * 0.25;
285 sixthDelta = halfDelta * (1.0/6.0);
308 sixthDelta = halfDelta * (1.0/6.0);
310 newState[
i] = state[
i] + sixthDelta * (
d1[
i] + 2.0 * (
d2[
i] +
d3[
i]) +
d4[i]);
330 sixthDelta = delta * (1.0/6.0);
345 if ( error <= 1.0
f ) {
348 if ( delta <= 1e-7 ) {
idODE_RK4Adaptive(const int dim, const deriveFunction_t dr, const void *ud)
virtual ~idODE_RK4Adaptive(void)
idODE_Midpoint(const int dim, const deriveFunction_t dr, const void *ud)
idODE_Euler(const int dim, const deriveFunction_t dr, const void *ud)
virtual float Evaluate(const float *state, float *newState, float t0, float t1)
virtual float Evaluate(const float *state, float *newState, float t0, float t1)
void(* deriveFunction_t)(const float t, const void *userData, const float *state, float *derivatives)
static float Fabs(float f)
idODE_RK4(const int dim, const deriveFunction_t dr, const void *ud)
virtual ~idODE_Euler(void)
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void SetMaxError(const float err)
virtual float Evaluate(const float *state, float *newState, float t0, float t1)
virtual ~idODE_Midpoint(void)
virtual float Evaluate(const float *state, float *newState, float t0, float t1)