mbsim  4.0.0
MBSim Kernel
linear_tyre_model.h
1/* Copyright (C) 2004-2024 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: martin.o.foerg@googlemail.com
18 */
19
20#ifndef _LINEAR_TYRE_MODEL_H_
21#define _LINEAR_TYRE_MODEL_H_
22
23#include <mbsim/constitutive_laws/tyre_model.h>
24
25namespace MBSim {
26
27 class LinearTyreModel : public TyreModel {
28 public:
29 LinearTyreModel() = default;
30 ~LinearTyreModel() override = default;
31
32 void setcz(double cz_) { cz = cz_; }
33 void setdz(double dz_) { dz = dz_; }
34 void setcka(double cka_) { cka = cka_; }
35 void setcal(double cal_) { cal = cal_; }
36 void setcga(double cga_) { cga = cga_; }
37 void setcMzga(double cMzga_) { cMzga = cMzga_; }
38 void sett(double t_) { t = t_; }
39 void setScaleFactorForLongitudinalForce(double sfFx_) { sfFx = sfFx_; }
40 void setScaleFactorForLateralForce(double sfFy_) { sfFy = sfFy_; }
41 void setScaleFactorForAligningMoment(double sfMz_) { sfMz = sfMz_; }
42
43 void initPlot(std::vector<std::string> &plotColumns) override;
44 void plot(std::vector<double> &plotVector) override;
45 void initializeUsingXML(xercesc::DOMElement *element) override;
46
47 fmatvec::VecV getContourParameters() const override;
48 double evalFreeRadius() override;
49
50 void updateGeneralizedForces() override;
51
52 fmatvec::VecV getData() const override;
53
54 bool motorcycleKinematics() const override { return true; }
55
56 private:
57 double cz{0};
58 double dz{0};
59 double cka{0};
60 double cal{0};
61 double cga{0};
62 double cMzga{0};
63 double t{0};
64 double sfFx{1};
65 double sfFy{1};
66 double sfMz{1};
67
68 double vcx, vcy, vsx, ka, ga, al, rhoz, Re, Rs;
69 };
70
71}
72
73#endif
std::vector< double > plotVector
one entry of time series
Definition: element.h:287
std::vector< std::string > plotColumns
columns of time series
Definition: element.h:292
Definition: linear_tyre_model.h:27
Definition: tyre_model.h:29
virtual void plot()
plots time dependent data
Definition: element.cc:74
namespace MBSim
Definition: bilateral_constraint.cc:30