Skip to content

Commit f39294a

Browse files
authored
Update Kloeser2020.mo
1 parent f291add commit f39294a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Kloeser2020.mo

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ model Kloeser2020 "Bicycle model of a model race car, from Kloeser2020 paper"
1212
parameter Real cr3 = 5.0;
1313

1414
// Constant curvature (circle)
15-
Real k "Road curvature [1/m] (constant)";
15+
Real kappa "Road curvature [1/m] (constant)";
1616

1717
// --- Inputs ---
1818
input Real D_der(min = -20.0, max = 20.0) "Rate of duty cycle";
19-
input Real δ_der(min = -4.0, max = 4.0) "Rate of steering angle";
19+
input Real delta_der(min = -4.0, max = 4.0) "Rate of steering angle";
2020

2121
Real D(min = -1, max = 1, start = 0) "Duty cycle of electric motor";
22-
Real δ(min = -0.8, max = 0.8, start = 0) "Steering angle";
22+
Real delta(min = -0.8, max = 0.8, start = 0) "Steering angle";
2323

2424
// --- Outputs ---
2525
output Real a_n "Normal (lateral) acceleration";
@@ -40,7 +40,7 @@ model Kloeser2020 "Bicycle model of a model race car, from Kloeser2020 paper"
4040
Real v(start=3) "Speed";
4141

4242
// Auxiliaries
43-
Real β;
43+
Real beta;
4444
Real Fx_d;
4545
Real ds, dn, dα, dv;
4646

@@ -72,31 +72,31 @@ model Kloeser2020 "Bicycle model of a model race car, from Kloeser2020 paper"
7272
end clip1;
7373

7474
equation
75-
// β (slip-free approximation, small angle)
76-
β = lr/(lr + lf) * δ;
75+
// beta (slip-free approximation, small angle)
76+
beta = lr/(lr + lf) * delta;
7777

7878
// Longitudinal force
7979
Fx_d = (cm1 - cm2*v)*D - cr2*v*v - cr0*tanh(cr3*v);
8080

8181
k = (-clip1(-clip1(-10*sin(s), 0.1), 0.1) + 1.0)/2.0;
8282

8383
// Dynamics
84-
ds = v*cos(alpha + β)/(1 - n*k);
85-
dn = v*sin(alpha + β);
86-
dalpha = (v/lr)*sin(β) - k*ds;
87-
dv = (Fx_d/m)*cos(β);
84+
ds = v*cos(alpha + beta)/(1 - n*kappa);
85+
dn = v*sin(alpha + beta);
86+
dalpha = (v/lr)*sin(beta) - kappa*ds;
87+
dv = (Fx_d/m)*cos(beta);
8888

8989
der(s) = ds;
9090
der(n) = dn;
9191
der(alpha) = dalpha;
9292
der(v) = dv;
9393

9494
der(D) = D_der;
95-
der(δ) = δ_der;
95+
der(delta) = delta_der;
9696

9797
// Outputs
9898
a_t = Fx_d/m;
99-
a_n = v*v/lr*sin(β) + Fx_d*sin(β)/m;
99+
a_n = v*v/lr*sin(beta) + Fx_d*sin(beta)/m;
100100

101101
// s modulo 4π
102102
s_mod = s; // Note: OpenModelica FMU derivatives choke on s_mod = mod(s, 4*Modelica.Constants.pi);

0 commit comments

Comments
 (0)