Introduction
...
Parameters
v
: (Numbers) final velocity of the car to accelerate to, (m/s)vwind
: (Numbers) velocity of the wind relative to the car, (m/s)v_old
: (Numbers) initial velocity of the car, (m/s)theta
: (Numbers) angle that must be climbed (radians) personally don’t understand why “climb” matters and not just angle of elevationtimestep
: (Numbers) Time between measurements, (s)usually calculated
dist / ((v + old_v)/2)
,dist
being the distance between two points in elevation profile,e_profile
. v
Returns
Fmotor
: (Numbers) Force of motors required to achieve the movement specified by the parameter to accelerate to a certain velocity in a certain time (N)
Calculations
Code Block |
---|
Fa = self.m * (v - v_old) / timestep
Fmotor = Fa + Ffric + Fdrag + Fg |
Note
If
v
orv_old
greater than maximum speed or less than minimum speed, it is caught in the function and whatever is out of bounds is set to maximum speed or minimum speedFfric
,Fdrag
,Fg
,Fa
, and ultimatelyFmotor
to be all calculated inside the function, using parameters and constants
The max_velocity()
function
...
Parameters
v
: (Numbers) final velocity of the car to accelerate to, (m/s)vwind
: (Numbers) velocity of the wind relative to the car, (m/s)v_old
: (Numbers) initial velocity of the car, (m/s)theta
: (Numbers) angle that must be climbed (radians) personally don’t understand why “climb” matters and not just angle of elevationtimestep
: (Numbers) Time between measurements, (s)usually calculated
dist / ((v + old_v)/2)
,dist
being the distance between two points in elevation profile,e_profile
.
Returns
Fmotor
: (Numbers) Force of motors required to accelerate to a certain velocity in a certain time (N)
Note
If
v
orv_old
greater than maximum speed or less than minimum speed, it is caught in the function and whatever is out of bounds is set to maximum speed or minimum speedFfric
,Fdrag
,Fg
,Fa
, and ultimatelyFmotor
to be all calculated inside the function, using parameters and constants
The energy_used()
function
...
Parameters
v
: (Numbers) final velocity of the car to accelerate to, (m/s)vwind
: (Numbers) velocity of the wind relative to the car, (m/s)v_old
: (Numbers) initial velocity of the car, (m/s)theta
: (Numbers) angle that must be climbed (radians) personally don’t understand why “climb” matters and not just angle of elevationtimestep
: (Numbers) Time between measurements, (s)usually calculated
dist / ((v + old_v)/2)
,dist
being the distance between two points in elevation profile,e_profile
.
Returns
Fmotor
: (Numbers) Force of motors required to accelerate to a certain velocity in a certain time (N)
Note
If
v
orv_old
greater than maximum speed or less than minimum speed, it is caught in the function and whatever is out of bounds is set to maximum speed or minimum speedFfric
,Fdrag
,Fg
,Fa
, and ultimatelyFmotor
to be all calculated inside the function, using parameters and constants
Sample code
Code Block |
---|