mbsim 4.0.0 MBSim Kernel

magic_formula_sharp.h
1 /* Copyright (C) 2004-2022 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 _MAGIC_FORMULA_SHARP_H_
21 #define _MAGIC_FORMULA_SHARP_H_
22
23 #include <mbsim/constitutive_laws/tyre_model.h>
24
25 namespace MBSim {
26
27 class MagicFormulaSharp : public TyreModel {
28 public:
29 MagicFormulaSharp() = default;
30 ~MagicFormulaSharp() override = default;
31
32 void setcz(double cz_) { cz = cz_; }
33 void setdz(double dz_) { dz = dz_; }
34 void setFz0(double Fz0_) { Fz0 = Fz0_; }
35 void setR0(double R0_) { R0 = R0_; }
36 void setpKy1(double pKy1_) { pKy1 = pKy1_; }
37 void setpKy2(double pKy2_) { pKy2 = pKy2_; }
38 void setpKy3(double pKy3_) { pKy3 = pKy3_; }
39 void setpKy4(double pKy4_) { pKy4 = pKy4_; }
40 void setpKy5(double pKy5_) { pKy5 = pKy5_; }
41 void setpKy6(double pKy6_) { pKy6 = pKy6_; }
42 void setpKy7(double pKy7_) { pKy7 = pKy7_; }
43 void setpDx1(double pDx1_) { pDx1 = pDx1_; }
44 void setpDx2(double pDx2_) { pDx2 = pDx2_; }
45 void setpEx1(double pEx1_) { pEx1 = pEx1_; }
46 void setpEx2(double pEx2_) { pEx2 = pEx2_; }
47 void setpEx3(double pEx3_) { pEx3 = pEx3_; }
48 void setpEx4(double pEx4_) { pEx4 = pEx4_; }
49 void setpKx1(double pKx1_) { pKx1 = pKx1_; }
50 void setpKx2(double pKx2_) { pKx2 = pKx2_; }
51 void setpKx3(double pKx3_) { pKx3 = pKx3_; }
52 void setCx(double Cx_) { Cx = Cx_; }
53 void setCy(double Cy_) { Cy = Cy_; }
54 void setrBx1(double rBx1_) { rBx1 = rBx1_; }
55 void setrBx2(double rBx2_) { rBx2 = rBx2_; }
56 void setCxal(double Cxal_) { Cxal = Cxal_; }
57 void setpDy1(double pDy1_) { pDy1 = pDy1_; }
58 void setpDy2(double pDy2_) { pDy2 = pDy2_; }
59 void setpDy3(double pDy3_) { pDy3 = pDy3_; }
60 void setpEy1(double pEy1_) { pEy1 = pEy1_; }
61 void setpEy2(double pEy2_) { pEy2 = pEy2_; }
62 void setpEy4(double pEy4_) { pEy4 = pEy4_; }
63 void setCga(double Cga_) { Cga = Cga_; }
64 void setEga(double Ega_) { Ega = Ega_; }
65 void setrBy1(double rBy1_) { rBy1 = rBy1_; }
66 void setrBy2(double rBy2_) { rBy2 = rBy2_; }
67 void setrBy3(double rBy3_) { rBy3 = rBy3_; }
68 void setCyka(double Cyka_) { Cyka = Cyka_; }
69 void setqHz3(double qHz3_) { qHz3 = qHz3_; }
70 void setqHz4(double qHz4_) { qHz4 = qHz4_; }
71 void setqBz1(double qBz1_) { qBz1 = qBz1_; }
72 void setqBz2(double qBz2_) { qBz2 = qBz2_; }
73 void setqBz5(double qBz5_) { qBz5 = qBz5_; }
74 void setqBz6(double qBz6_) { qBz6 = qBz6_; }
75 void setqBz9(double qBz9_) { qBz9 = qBz9_; }
76 void setqBz10(double qBz10_) { qBz10 = qBz10_; }
77 void setqDz1(double qDz1_) { qDz1 = qDz1_; }
78 void setqDz2(double qDz2_) { qDz2 = qDz2_; }
79 void setqDz3(double qDz3_) { qDz3 = qDz3_; }
80 void setqDz4(double qDz4_) { qDz4 = qDz4_; }
81 void setqDz8(double qDz8_) { qDz8 = qDz8_; }
82 void setqDz9(double qDz9_) { qDz9 = qDz9_; }
83 void setqDz10(double qDz10_) { qDz10 = qDz10_; }
84 void setqDz11(double qDz11_) { qDz11 = qDz11_; }
85 void setqEz1(double qEz1_) { qEz1 = qEz1_; }
86 void setqEz2(double qEz2_) { qEz2 = qEz2_; }
87 void setqEz5(double qEz5_) { qEz5 = qEz5_; }
88 void setCt(double Ct_) { Ct = Ct_; }
89 void setc1Rel(double c1Rel_) { c1Rel = c1Rel_; }
90 void setc2Rel(double c2Rel_) { c2Rel = c2Rel_; }
91 void setc3Rel(double c3Rel_) { c3Rel = c3Rel_; }
92 void setScaleFactorForCamberStiffness(double sfKyga_) { sfKyga = sfKyga_; }
93 void setScaleFactorForLongitudinalForce(double sfFx_) { sfFx = sfFx_; }
94 void setScaleFactorForLateralForce(double sfFy_) { sfFy = sfFy_; }
95 void setScaleFactorForAligningMoment(double sfMz_) { sfMz = sfMz_; }
96
97 void initPlot(std::vector<std::string> &plotColumns) override;
98 void plot(std::vector<double> &plotVector) override;
99 void initializeUsingXML(xercesc::DOMElement *element) override;
100
101 int getxSize() const override { return 1; }
102 void updatexd() override;
103
104 fmatvec::VecV getContourParameters() const override;
105 double evalFreeRadius() override;
106
107 void updateGeneralizedForces() override;
108
109 int getDataSize() const override { return 8; }
110 fmatvec::VecV getData() const override;
111
112 bool motorcycleKinematics() const override { return true; }
113
114 private:
115 double cz{0};
116 double dz{0};
117 double Fz0{0};
118 double R0{0};
119 double pKy1{0};
120 double pKy2{0};
121 double pKy3{0};
122 double pKy4{0};
123 double pKy5{0};
124 double pKy6{0};
125 double pKy7{0};
126 double pDx1{0};
127 double pDx2{0};
128 double pEx1{0};
129 double pEx2{0};
130 double pEx3{0};
131 double pEx4{0};
132 double pKx1{0};
133 double pKx2{0};
134 double pKx3{0};
135 double Cx{0};
136 double Cy{0};
137 double rBx1{0};
138 double rBx2{0};
139 double Cxal{0};
140 double pDy1{0};
141 double pDy2{0};
142 double pDy3{0};
143 double pEy1{0};
144 double pEy2{0};
145 double pEy4{0};
146 double Cga{0};
147 double Ega{0};
148 double rBy1{0};
149 double rBy2{0};
150 double rBy3{0};
151 double Cyka{0};
152 double qHz3{0};
153 double qHz4{0};
154 double qBz1{0};
155 double qBz2{0};
156 double qBz5{0};
157 double qBz6{0};
158 double qBz9{0};
159 double qBz10{0};
160 double qDz1{0};
161 double qDz2{0};
162 double qDz3{0};
163 double qDz4{0};
164 double qDz8{0};
165 double qDz9{0};
166 double qDz10{0};
167 double qDz11{0};
168 double qEz1{0};
169 double qEz2{0};
170 double qEz5{0};
171 double Ct{0};
172 double c1Rel{0};
173 double c2Rel{0};
174 double c3Rel{0};
175 double sfKyga{1};
176 double sfFx{1};
177 double sfFy{1};
178 double sfMz{1};
179
180 double vsx, vsy, vx, ka, ga, Kyal, si, be, Rs;
181 };
182
183 }
184
185 #endif
MBSim::Element::plot
virtual void plot()
plots time dependent data
Definition: element.cc:80
MBSim::Element::plotColumns
std::vector< std::string > plotColumns
columns of time series
Definition: element.h:292
MBSim::Element::plotVector
std::vector< double > plotVector
one entry of time series
Definition: element.h:287
MBSim::TyreModel
Definition: tyre_model.h:27
MBSim::MagicFormulaSharp
Definition: magic_formula_sharp.h:27
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30