EnvFunction DragForce(&myDisturbanceFunction);
DragForce.AddParameter(reinterpret_cast<void*>(*CrossArea), 1);
// Force function that will be called each timestep Vector DragForceFunction(const ssfTime* _currentTime, const OrbitState* _currentOrbitState, const AttitudeState* _currentAttitudeState, EnvFuncParamaterType _parameterList) { Vector Forces(3); double BC = *(reinterpret_cast<double*>(_parameterList[1])); double Density = *(reinterpret_cast<double*>(_parameterList[2])); // kg/m^3 Vector Vrel(3); Vrel = _currentOrbitState->GetState()(_(VectorIndexBase+3,VectorIndexBase+5)); double Vrel_mag = norm2(Vrel); Forces = -1/2 * rho / BC * pow(Vrel_mag,2) * Vrel / Vrel_mag; return Forces; }
testPropagation.cpp Example propagation of a combined satellite orbit & attitude.