All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
massless_spring_damper.h
1 /* Copyright (C) 2011 Markus Schneider
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  *
19  * Contact:
20  * schneidm@amm.mw.tu-muenchen.de
21  *
22  */
23 
24 #ifndef _MASSLESS_SPRING_DAMPER_
25 #define _MASSLESS_SPRING_DAMPER_
26 
27 #include "mbsimControl/signal_.h"
28 
29 namespace MBSimControl {
30 
35  class MasslessSpringDamper : public Signal {
36 
37  public:
38  MasslessSpringDamper(const std::string& name="");
39  virtual std::string getType() const {return "MasslessSpringDamper"; }
40  void initializeUsingXML(xercesc::DOMElement * element);
41 
42  void calcxSize() {xSize=1; }
43 
44  void init(InitStage stage);
45 
46  void updateSignal() { s = x; upds = false; }
47 
48  void updatedx();
49  void updatexd();
50 
51  void plot();
52 
53  void setSpringStiffness(double c_) {c=c_; }
54  void setBasicSpringForce(double F0_) {F0=F0_; }
55  void setDampingCoefficient(double d_) {dPos=d_; }
56  void setNegativeDampingCoefficient(double d_) {dNeg=d_; }
57  void setFrictionForce(double FFric_) {FFricPos=FFric_; }
58  void setNegativeFrictionForce(double FFric_) {FFricNeg=FFric_; }
59  void setMinimumPositionValue(double xMin_) {xMin=xMin_; }
60  void setMaximumPositionValue(double xMax_) {xMax=xMax_; }
61 
62  void setInputSignal(Signal * inputSignal_) { inputSignal=inputSignal_; }
63  int getSignalSize() const { return inputSignal->getSignalSize(); }
64 
65  private:
66  double c, F0, dPos, dNeg, FFricPos, FFricNeg, xMin, xMax;
67  double xdLocal;
68  Signal * inputSignal;
69  std::string inputSignalString;
70  };
71 }
72 
73 #endif
Signal.
Definition: signal_.h:37
Massless Spring Damper (PT1)
Definition: massless_spring_damper.h:35

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML