Research Article

Development of the Object-Oriented Dynamic Simulation Models Using Visual C++ Freeware

Algorithm 1

template<class  T>
inline void  RK4_4eq(T* p, //pointer to an object of the class T
  double  h, //time step of integration (ht in the class Particle)
  double  T::*pX0, // pointer to the independent variable -  time  
  double  T::*pX1, // pointer to the state variable -  velocity  
  double  T::*pX2, // pointer to the state variable -  velocity  
  double  T::*pX3, // pointer to the state variable -  coordinate  
  double  T::*pX4, // pointer to the state variable -  coordinate  
  void  (T::*pPrecompute)(),//pointer to the helper function  
  double  (T::*pF1)(), //pointer to the equation of motion  
  double  (T::*pF2)(), //pointer to the equation of motion  
  double  (T::*pF3)(), //pointer to the equation of motion  
  double  (T::*pF4)() //pointer to the equation of motion  
);