All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
lsodar_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 _LSODAR_INTEGRATOR_H_
24 #define _LSODAR_INTEGRATOR_H_
25 
26 #include "integrator.h"
27 
28 namespace MBSimIntegrator {
29 
33  class LSODARIntegrator : public Integrator {
34  private:
35 
36  static void fzdot(int* zSize, double* t, double* z_, double* zd_);
37  static void fsv(int* zSize, double* t, double* z_, int* nsv, double* sv_);
38 
40  double dtMax;
42  double dtMin;
46  double rTol;
48  double dt0;
49 
50  bool plotOnRoot;
51 
53  double gMax;
55  double gdMax;
56 
57  int zSize, iTol, istate, nsv, lrWork, liWork, integrationSteps;
58  double t, tPlot, s0, time;
59  fmatvec::Vec rWork;
60  fmatvec::VecInt iWork;
61  std::ofstream integPlot;
62  public:
63 
65  ~LSODARIntegrator() {}
66 
67  void setMaximalStepSize(double dtMax_) {dtMax = dtMax_;}
68  void setMinimalStepSize(double dtMin_) {dtMin = dtMin_;}
69  void setAbsoluteTolerance(const fmatvec::Vec &aTol_) {aTol = aTol_;}
70  void setAbsoluteTolerance(double aTol_) {aTol = fmatvec::Vec(1,fmatvec::INIT,aTol_);}
71  void setRelativeTolerance(double rTol_) {rTol = rTol_;}
72  void setInitialStepSize(double dt0_) {dt0 = dt0_;}
73 
74  void setPlotOnRoot(bool b) {plotOnRoot = b;}
75 
76  void setToleranceForPositionConstraints(double gMax_) {gMax = gMax_;}
77  void setToleranceForVelocityConstraints(double gdMax_) {gdMax = gdMax_;}
78 
80  void preIntegrate(MBSim::DynamicSystemSolver& system);
81  void subIntegrate(MBSim::DynamicSystemSolver& system, double tStop);
82  void postIntegrate(MBSim::DynamicSystemSolver& system);
83 
84  virtual void initializeUsingXML(xercesc::DOMElement *element);
85 
86  virtual std::string getType() const { return "LSODARIntegrator"; }
87  };
88 
89 }
90 
91 #endif
double dtMin
Definition: lsodar_integrator.h:42
double gMax
Definition: lsodar_integrator.h:53
Vector< Ref, double > Vec
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:48
double dtMax
Definition: lsodar_integrator.h:40
double dt0
Definition: lsodar_integrator.h:48
void integrate(MBSim::DynamicSystemSolver &system)
start the integration
Definition: lsodar_integrator.cc:84
double gdMax
Definition: lsodar_integrator.h:55
virtual void initializeUsingXML(xercesc::DOMElement *element)
initialize integrator
Definition: lsodar_integrator.cc:61
ODE-Integrator LSODAR Integrator with root finding for ODEs. This integrator uses LSODAR from http://...
Definition: lsodar_integrator.h:33
fmatvec::Vec aTol
Definition: lsodar_integrator.h:44
virtual std::string getType() const
Definition: lsodar_integrator.h:86
integrator-interface for dynamic systems
Definition: integrator.h:40
static DynamicSystemSolver * system
dynamic system
Definition: solver.h:65
double rTol
Definition: lsodar_integrator.h:46

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML