mbsim  4.0.0
MBSim Kernel
linear_regularized_stribeck_friction.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
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  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _LINEAR_REGULARIZED_STRIBECK_FRICTION_H_
21 #define _LINEAR_REGULARIZED_STRIBECK_FRICTION_H_
22 
23 #include "mbsim/functions/function.h"
24 
25 namespace MBSim {
26 
34  class LinearRegularizedStribeckFriction : public Function<fmatvec::Vec(fmatvec::Vec,double)> {
35  public:
40 
46  LinearRegularizedStribeckFriction(Function<double(double)> *fmu_, double gdLim_=0.01) : fmu(fmu_), gdLim(gdLim_) {
47  fmu->setParent(this);
48  }
49 
50  /* INHERITED INTERFACE OF FUNCTION2 */
51  fmatvec::Vec operator()(const fmatvec::Vec &gd, const double& laN) override;
52  void initializeUsingXML(xercesc::DOMElement *element) override;
53  void init(Element::InitStage stage, const InitConfigSet &config) override {
54  Function<fmatvec::Vec(fmatvec::Vec,double)>::init(stage, config);
55  fmu->init(stage, config);
56  }
57  /***************************************************/
58 
59  /* GETTER / SETTER */
60  void setFrictionFunction(Function<double(double)> *fmu_) {
61  fmu=fmu_;
62  fmu->setParent(this);
63  fmu->setName("Friction");
64  }
65  void setMarginalVelocity(double gdLim_) { gdLim=gdLim_; }
66  /***************************************************/
67 
68  protected:
72  Function<double(double)> *fmu;
73 
77  double gdLim{0.01};
78  };
79 
80 }
81 
82 #endif
function describing a linear regularized relationship between the input relative velocity and the out...
Definition: linear_regularized_stribeck_friction.h:34
virtual void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: element.cc:84
Function< double(double)> * fmu
friction coefficient function
Definition: linear_regularized_stribeck_friction.h:72
LinearRegularizedStribeckFriction(Function< double(double)> *fmu_, double gdLim_=0.01)
constructor
Definition: linear_regularized_stribeck_friction.h:46
double gdLim
border with respect to the relative velocity for the linear regularized increase of the friction forc...
Definition: linear_regularized_stribeck_friction.h:77
LinearRegularizedStribeckFriction()
constructor
Definition: linear_regularized_stribeck_friction.h:39
InitStage
The stages of the initialization.
Definition: element.h:62
Definition: contact_kinematics.h:32
void init(Element::InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: linear_regularized_stribeck_friction.h:53
void setName(const std::string &str)
Definition: element.h:115
namespace MBSim
Definition: eigenanalyzer.cc:47