All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
lsode_integrator.h
1 /* Copyright (C) 2004-2006 Martin Förg
2 
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17  *
18  * Contact:
19  * martin.o.foerg@googlemail.com
20  *
21  */
22 
23 #ifndef _LSODE_INTEGRATOR_H_
24 #define _LSODE_INTEGRATOR_H_
25 
26 #include "integrator.h"
27 
28 namespace MBSimIntegrator {
29 
33  class LSODEIntegrator : public Integrator {
34 
35  private:
36 
37  static void fzdot(int* zSize, double* t, double* z_, double* zd_);
38 
40  double dtMax;
42  double dtMin;
46  double rTol;
48  double dt0;
50  int maxSteps;
52  bool stiff;
53 
54  public:
55 
57  ~LSODEIntegrator() {}
58 
59  void setMaximalStepSize(double dtMax_) {dtMax = dtMax_;}
60  void setMinimalStepSize(double dtMin_) {dtMin = dtMin_;}
61  void setRelativeTolerance(double rTol_) {rTol = rTol_;}
62  void setAbsoluteTolerance(const fmatvec::Vec &aTol_) {aTol = aTol_;}
63  void setAbsoluteTolerance(double aTol_) {aTol = fmatvec::Vec(1,fmatvec::INIT,aTol_);}
64  void setInitialStepSize(double dt0_) {dt0 = dt0_;}
65  void setmaxSteps(int maxSteps_) {maxSteps = maxSteps_;}
66  void setStiff(bool flag) {stiff = flag;}
67 
69 
70  virtual void initializeUsingXML(xercesc::DOMElement *element);
71 
72  virtual std::string getType() const { return "LSODEIntegrator"; }
73  };
74 
75 }
76 
77 #endif
Vector< Ref, double > Vec
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:48
double rTol
Definition: lsode_integrator.h:46
void integrate(MBSim::DynamicSystemSolver &system)
start the integration
Definition: lsode_integrator.cc:56
fmatvec::Vec aTol
Definition: lsode_integrator.h:44
bool stiff
Definition: lsode_integrator.h:52
double dtMax
Definition: lsode_integrator.h:40
virtual std::string getType() const
Definition: lsode_integrator.h:72
double dtMin
Definition: lsode_integrator.h:42
virtual void initializeUsingXML(xercesc::DOMElement *element)
initialize integrator
Definition: lsode_integrator.cc:147
ODE-Integrator LSODE Integrator with root finding for ODEs. This integrator uses LSODE from http://ww...
Definition: lsode_integrator.h:33
double dt0
Definition: lsode_integrator.h:48
integrator-interface for dynamic systems
Definition: integrator.h:40
int maxSteps
Definition: lsode_integrator.h:50
static DynamicSystemSolver * system
dynamic system
Definition: solver.h:65

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML