Commit 2fb90d36 authored by Jean-Benoist Leger's avatar Jean-Benoist Leger

velocity_base as input parameter in place of power

parent c6a3ad09
......@@ -21,7 +21,7 @@ Available parameters are:
- `mass` (in kg): the total mass (bicycle + human) (default: 90)
- `power` (in W): the reference biking power (default: 140)
- `velocity_base` (in m.s^-1): the base velocity on flat road (default: 6.95)
- `SCx` (in m^2): the equivalent surface for wind (default: .45)
......@@ -58,11 +58,6 @@ Available parameters are:
Help choosing parameters
------------------------
To choose the `power` parameter, let `velocity` (in m.s^-1) the constant speed on
a flat road, `g=9.81 m.s^-2`, `rho=1.204 km.m^-3`:
power = mass * g * Cr * velocity + 1/2 * rho * SCx * velocity^3
To choose the `power_walk` parameter, choosing the same value as `power` is a
good idea.
......
......@@ -46,6 +46,8 @@ parameters_t read_parameters_from_stdin()
std::string line;
double velocity_base = 6.95; // 25 km/h
while(true)
{
std::getline(std::cin, line);
......@@ -56,8 +58,8 @@ parameters_t read_parameters_from_stdin()
if(key == "mass")
parameters.mass = atof(val.c_str());
else if(key == "power")
parameters.power = atof(val.c_str());
else if(key == "velocity_base")
velocity_base = atof(val.c_str());
else if(key == "SCx")
parameters.SCx = atof(val.c_str());
else if(key == "Cr")
......@@ -104,6 +106,11 @@ parameters_t read_parameters_from_stdin()
}
parameters.power =
.5 * RV_RHO_AIR * parameters.SCx * velocity_base * velocity_base * velocity_base
+
parameters.Cr * parameters.mass * RV_G * velocity_base;
return parameters;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment