Add temp_gears.py
This commit is contained in:
parent
8f4adb9f7f
commit
03237830f3
28
temp_gears.py
Normal file
28
temp_gears.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from math import pi, sin, atan, degrees
|
||||
|
||||
# Configurable variables
|
||||
power = 140
|
||||
cadence = 75
|
||||
crankarm_length = 0.1725
|
||||
total_mass = 85
|
||||
slope = 0.2
|
||||
tire_circumference = 2.105
|
||||
|
||||
# Calculated values
|
||||
circumference = crankarm_length * 2 * pi
|
||||
pedal_speed = circumference * (cadence / 60)
|
||||
pedal_force = power / pedal_speed
|
||||
slope_radians = atan(slope)
|
||||
slope_degrees = degrees(slope_radians)
|
||||
gravity_force = total_mass * 9.80665 * sin(slope_radians)
|
||||
pedal_torque = pedal_force * crankarm_length
|
||||
wheel_radius = tire_circumference / (2 * pi)
|
||||
wheel_torque = gravity_force * wheel_radius
|
||||
gear_ratio = pedal_torque / wheel_torque
|
||||
speed = (cadence / 60) * tire_circumference * gear_ratio
|
||||
|
||||
print(f"[{power} W] Desired pedal average force: {pedal_force}N - Desired cadence: {cadence} rpm")
|
||||
print(f"Incline/Slope: {slope} - {slope * 100}% - {slope_degrees} degrees")
|
||||
print(f"Slope force down: {gravity_force}N")
|
||||
print(f"Required gear ratio: {gear_ratio}")
|
||||
print(f"Speed: {speed} m/s - {speed * 3.6} km/h")
|
||||
Loading…
Reference in a new issue