Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Into-cps
2020.Summersim.Tutorial
Commits
7c0af5d0
Commit
7c0af5d0
authored
Jul 20, 2020
by
Claudio Gomes
Browse files
Add modelica models.
parent
4600fc21
Changes
3
Hide whitespace changes
Inline
Side-by-side
materials/bike_kinematic_model/BikeModel.mo
0 → 100644
View file @
7c0af5d0
model
BikeModel
//
Taken
from
https
://
ieeexplore
.
ieee
.
org
/
abstract
/
document
/
7225830
//
Parameters
are
taken
from
there
as
well
.
parameter
Real
lf
=
1.105
"distance from the the center of mass to the front (m)"
;
parameter
Real
lr
=
1.738
"distance from the the center of mass to the rear (m)"
;
parameter
Real
x0
=
0
"initial position in x"
;
parameter
Real
y0
=
0
"initial position in y"
;
parameter
Real
psi0
=
0
"initial orientation"
;
parameter
Real
v0
=
0
"initial velocity along psi0"
;
output
Real
x
"x coordinate (m)"
;
output
Real
y
"y coordinate (m)"
;
output
Real
psi
"Inertial orientation of the model (rad)"
;
output
Real
v
"speed along psi (m/s)"
;
output
Real
beta
"is the angle of the current velocity vector of the center of mass with respect to the longitudinal axis of the car (rad)"
;
input
Real
deltaf
"steering angle at the front wheel (rad)"
;
initial
equation
x
=
x0
;
y
=
y0
;
psi
=
psi0
;
equation
der
(
x
)
=
v
*
cos
(
psi
+
beta
);
der
(
y
)
=
v
*
sin
(
psi
+
beta
);
der
(
psi
)
=
(
v
/
lr
)
*
sin
(
beta
);
v
=
v0
;
beta
=
atan
(
(
lr
/(
lf
+
lr
))
*
tan
(
deltaf
)
);
end
BikeModel
;
materials/bike_kinematic_model/BikeModelScenarioDriver.mo
0 → 100644
View file @
7c0af5d0
model
BikeModelScenarioDriver
parameter
Real
speed
=
1
"m/s"
;
BikeModel
bike
(
v0
=
speed
);
Driver
driver
;
equation
bike
.
deltaf
=
driver
.
steering
;
annotation
(
experiment
(
StartTime
=
0
,
StopTime
=
200
,
Tolerance
=
1e-06
,
Interval
=
0.002
));
end
BikeModelScenarioDriver
;
materials/bike_kinematic_model/Driver.mo
0 → 100644
View file @
7c0af5d0
model
Driver
parameter
Real
width
=
2.0
;
parameter
Real
amplitude
=
0.8
;
parameter
Real
risingtime
=
5.0
;
parameter
Real
starttime
=
5.0
;
parameter
Integer
nperiod
=
1
;
parameter
Real
period
=
300
;
output
Real
steering
;
Modelica
.
Blocks
.
Sources
.
Trapezoid
trap
(
nperiod
=
nperiod
,
startTime
=
starttime
,
rising
=
risingtime
,
falling
=
risingtime
,
period
=
period
,
width
=
width
,
amplitude
=
amplitude
);
equation
steering
=
trap
.
y
;
end
Driver
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment