00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _LSODE_INTEGRATOR_H_
00024 #define _LSODE_INTEGRATOR_H_
00025
00026 #include "integrator.h"
00027
00028 namespace MBSim {
00029
00033 class LSODEIntegrator : public Integrator {
00034
00035 private:
00036
00037 static void fzdot(int* zSize, double* t, double* z_, double* zd_);
00038 static void fsv(int* zSize, double* t, double* z_, int* nsv, double* sv_);
00039
00041 double dtMax;
00043 double dtMin;
00045 fmatvec::Vec aTol;
00047 double rTol;
00049 double dt0;
00051 int maxSteps;
00053 bool stiff;
00054
00055 public:
00056
00057 LSODEIntegrator();
00058 ~LSODEIntegrator() {}
00059
00060 void setMaximalStepSize(double dtMax_) {dtMax = dtMax_;}
00061 void setMinimalStepSize(double dtMin_) {dtMin = dtMin_;}
00062 void setRelativeTolerance(double rTol_) {rTol = rTol_;}
00063 void setAbsoluteTolerance(const fmatvec::Vec &aTol_) {aTol = aTol_;}
00064 void setAbsoluteTolerance(double aTol_) {aTol = fmatvec::Vec(1,fmatvec::INIT,aTol_);}
00065 void setInitialStepSize(double dt0_) {dt0 = dt0_;}
00066 void setmaxSteps(int maxSteps_) {maxSteps = maxSteps_;}
00067 void setStiff(bool flag) {stiff = flag;}
00068
00069 void integrate(DynamicSystemSolver& system);
00070
00071 virtual void initializeUsingXML(xercesc::DOMElement *element);
00072 virtual xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *element);
00073
00074 using Integrator::writeXMLFile;
00075
00076 virtual std::string getType() const { return "LSODEIntegrator"; }
00077 };
00078
00079 }
00080
00081 #endif