21 template <
typename Real,
typename TVector>
28 std::function<TVector(Real, TVector
const&)>
const& F);
32 virtual void Update(Real tIn, TVector
const& xIn, Real& tOut,
37 template <
typename Real,
typename TVector>
42 template <
typename Real,
typename TVector>
44 std::function<TVector(Real, TVector
const&)>
const& F)
50 template <
typename Real,
typename TVector>
52 Real& tOut, TVector& xOut)
55 Real halfTDelta = ((Real)0.5) * this->
mTDelta;
56 TVector fTemp1 = this->
mFunction(tIn, xIn);
57 TVector xTemp = xIn + halfTDelta * fTemp1;
60 Real halfT = tIn + halfTDelta;
61 TVector fTemp2 = this->
mFunction(halfT, xTemp);
62 xTemp = xIn + halfTDelta * fTemp2;
65 TVector fTemp3 = this->
mFunction(halfT, xTemp);
66 xTemp = xIn + this->
mTDelta * fTemp3;
69 Real sixthTDelta = this->
mTDelta / (Real)6;
71 TVector fTemp4 = this->
mFunction(tOut, xTemp);
72 xOut = xIn + sixthTDelta * (
73 fTemp1 + ((Real)2)*(fTemp2 + fTemp3) + fTemp4);
std::function< TVector(Real, TVector const &)> mFunction
OdeRungeKutta4(Real tDelta, std::function< TVector(Real, TVector const &)> const &F)
virtual ~OdeRungeKutta4()
virtual void Update(Real tIn, TVector const &xIn, Real &tOut, TVector &xOut)