Module: svIntegratorRungeKutta¶
- 
template<size_t numberStages>
 struct RKCoefficients¶
- #include <svIntegratorRungeKutta.h>Stores the coefficients necessary to use the Runge-Kutta methods. The Butcher table looks like: Subclassed by RKAdaptiveCoefficients< numberStages > Public Types - 
using StageSizedArray = std::array<double, numberStages>¶
- Array with size = numberStages 
 - 
using StageSizedMatrix = std::array<StageSizedArray, numberStages>¶
- Square matrix with size = numberStages 
 Public Members - 
StageSizedMatrix aMatrix = {}¶
- “a” coefficient matrix of the RK method 
 - 
StageSizedArray bArray = {}¶
- “b” coefficient array of the RK method 
 - 
StageSizedArray cArray = {}¶
- “c” coefficient array of the RK method 
 
- 
using StageSizedArray = std::array<double, numberStages>¶
- 
template<size_t numberStages>
 class svIntegratorRungeKutta : public StateVecIntegrator¶
- #include <svIntegratorRungeKutta.h>The svIntegratorRungeKutta class implements a state integrator based on the family of explicit Runge-Kutta numerical integrators. A Runge-Kutta method is defined by its stage number and its coefficients. The stage number drives the computational cost of the method: an RK method of stage 4 requires 4 dynamics evaluations (FSAL optimizations are not done). Note that the order of the integrator is lower or equal to the stage number. A RK method of order 5, for example, requires 7 stages. Subclassed by svIntegratorAdaptiveRungeKutta< numberStages > Public Functions - 
svIntegratorRungeKutta(DynamicObject *dynIn, const RKCoefficients<numberStages> &coefficients)¶
- Creates an explicit RK integrator for the given DynamicObject using the passed coefficients. 
 - 
virtual void integrate(double currentTime, double timeStep) override¶
- Performs the integration of the associated dynamic objects up to time currentTime+timeStep 
 Protected Types - 
using KCoefficientsValues = std::array<ExtendedStateVector, numberStages>¶
- For an s-stage RK method, s number of “k” coefficients are needed, where each “k” coefficient has the same size as the state. This type allows us to store these “k” coefficients. 
 Protected Functions - 
svIntegratorRungeKutta(DynamicObject *dynIn, std::unique_ptr<RKCoefficients<numberStages>> &&coefficients)¶
- Can be used by subclasses to support passing coefficients that are subclasses of RKCoefficients 
 - 
ExtendedStateVector computeDerivatives(double time, double timeStep, const ExtendedStateVector &states)¶
- Computes the derivatives of every state given a time and current states. - Internally, this sets the states on the dynamic objects and calls the equationsOfMotion methods. 
 - 
KCoefficientsValues computeKCoefficients(double currentTime, double timeStep, const ExtendedStateVector ¤tStates)¶
- Computes the “k” coefficients of the Runge-Kutta method for a time and state. 
 - 
ExtendedStateVector computeNextState(double timeStep, const ExtendedStateVector ¤tStates, const KCoefficientsValues &kVectors)¶
- Adds the “k” coefficients, weighted by the “c” coefficients to find the state after the time step. 
 Protected Attributes - 
const std::unique_ptr<RKCoefficients<numberStages>> coefficients¶
- Coefficients to be used in the method 
 
- 
svIntegratorRungeKutta(DynamicObject *dynIn, const RKCoefficients<numberStages> &coefficients)¶