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:
39 LinearRegularizedStribeckFriction() : fmu(nullptr) {}
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 fmatvec::Vec parDer2(const fmatvec::Vec &gd, const double& laN) override;
53 void initializeUsingXML(xercesc::DOMElement *element) override;
54 void init(Element::InitStage stage, const InitConfigSet &config) override {
55 Function<fmatvec::Vec(fmatvec::Vec,double)>::init(stage, config);
56 fmu->init(stage, config);
57 }
58 /***************************************************/
59
60 /* GETTER / SETTER */
61 void setFrictionFunction(Function<double(double)> *fmu_) {
62 fmu=fmu_;
63 fmu->setParent(this);
64 fmu->setName("Friction");
65 }
66 void setMarginalVelocity(double gdLim_) { gdLim=gdLim_; }
67 /***************************************************/
68
69 protected:
73 Function<double(double)> *fmu;
74
78 double gdLim{0.01};
79 };
80
81 }
82
83 #endif
MBSim::LinearRegularizedStribeckFriction
function describing a linear regularized relationship between the input relative velocity and the out...
Definition: linear_regularized_stribeck_friction.h:34
MBSim::Element::init
virtual void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: element.cc:91
MBSim::LinearRegularizedStribeckFriction::fmu
Function< double(double)> * fmu
friction coefficient function
Definition: linear_regularized_stribeck_friction.h:73
MBSim::LinearRegularizedStribeckFriction::LinearRegularizedStribeckFriction
LinearRegularizedStribeckFriction(Function< double(double)> *fmu_, double gdLim_=0.01)
constructor
Definition: linear_regularized_stribeck_friction.h:46
MBSim::LinearRegularizedStribeckFriction::gdLim
double gdLim
border with respect to the relative velocity for the linear regularized increase of the friction forc...
Definition: linear_regularized_stribeck_friction.h:78
MBSim::LinearRegularizedStribeckFriction::LinearRegularizedStribeckFriction
LinearRegularizedStribeckFriction()
constructor
Definition: linear_regularized_stribeck_friction.h:39
MBSim::Element::InitStage
InitStage
The stages of the initialization.
Definition: element.h:62
MBSim::Function
Definition: contact_kinematics.h:32
MBSim::LinearRegularizedStribeckFriction::init
void init(Element::InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: linear_regularized_stribeck_friction.h:54
MBSim::Element::setName
void setName(const std::string &str)
Definition: element.h:115
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30