CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // This is a class the creates an N-Dimensional Phase Space // 00002 00003 // It is for use in computing the time development of classical // 00004 // Hamiltonian Systems. // 00005 00006 // Joe Boudreau October 2011 // 00007 00008 //--------------------------------------------------------------// 00009 00010 #ifndef _RKClassicalSolver_h__ 00011 #define _RKClassicalSolver_h__ 00012 #include "CLHEP/GenericFunctions/PhaseSpace.hh" 00013 #include "CLHEP/GenericFunctions/ClassicalSolver.hh" 00014 #include "CLHEP/GenericFunctions/Variable.hh" 00015 #include "CLHEP/GenericFunctions/Parameter.hh" 00016 #include <vector> 00017 00018 namespace Classical { 00019 00020 class RungeKuttaSolver : public Solver { 00021 00022 public: 00023 // 00024 // Constructor--takes a hamiltonian and a point in p-space: 00025 // 00026 RungeKuttaSolver(Genfun::GENFUNCTION H, const PhaseSpace & phaseSpace); 00027 // 00028 // Destructor: 00029 // 00030 ~RungeKuttaSolver(); 00031 // 00032 // Returns the time evolution for a variable (q_i or p_i) 00033 // 00034 virtual Genfun::GENFUNCTION equationOf(const Genfun::Variable & v) const; 00035 // 00036 // Returns the phase space 00037 // 00038 virtual const PhaseSpace & phaseSpace() const; 00039 // 00040 // Returns the Hamiltonian (function of the 2N phase space variables). 00041 // 00042 virtual Genfun::GENFUNCTION hamiltonian() const; 00043 // 00044 // Returns the energy (function of time). 00045 // 00046 virtual Genfun::GENFUNCTION energy() const; 00047 // 00048 // This is in the rare case that the user needs to edit starting values. 00049 // or parameterize the Hamiltonian. Most users: can ignore. 00050 virtual Genfun::Parameter *takeQ0(unsigned int index); 00051 virtual Genfun::Parameter *takeP0(unsigned int index); 00052 virtual Genfun::Parameter *createControlParameter(const std::string & variableName="anon", 00053 double defStartingValue=0.0, 00054 double startingValueMin=0.0, 00055 double startingValueMax=0.0) const; 00056 00057 00058 00059 private: 00060 00061 // Illegal Operations: 00062 RungeKuttaSolver (const RungeKuttaSolver &); 00063 RungeKuttaSolver & operator=(const RungeKuttaSolver &); 00064 00065 // Clockwork 00066 class Clockwork; 00067 Clockwork *c; 00068 }; 00069 00070 } 00071 00072 #endif