from math import *
# INPUT ALL ANGLES IN DEGREES
# we are metric
deg = pi / 180.
G = 9.81
# THIS INFO IS INPUT AS INCHES AND LBS and coverted to metric
# A =wheelbase
A = 48.75 * .0254
# B = dist from rear axle to cg
B = 16.6 * .0254
# beta1 = head tube angle ;
beta1 = 80.
# H =distace from the gnd to cg "riders belly button" ;
h = 10 / 40.
# mass ;
M = 110. # kg
# s= fork offset normal to headtube;
s = -1. * .0254
# Rh IS HANDLEBAR RADIUs
Rh = 10 * .0254
# Rt is the tire carcass radius
Rt = .6 * .0254
# KX = radius of gyration of the bike and rider about cg X axis
# estimate .12 for supine rider to .6 for upright rider
# more for a fully faired vehicle
KX = .35
# beta = complement of beta1
BETA = (90 - beta1) * pi / 180.
CB = cos(BETA)
# r= radius of front wheel
r = 9.8 * .0245
# CHANGE NO DATA PAST THIS POINT # ' T = trail
T = (r * sin(BETA) - s) / cos(BETA)
print 'TRIAL = ', T, 'm'
FLOP= (M*G*B/A)*T*CB/Rh
print 'FLOP = ', FLOP, 'Nm/s2'
# Tmax = Flop * Rh/(Nf * cos(b))
TMIN = 1.2*B/M*(1/(KX*KX)+1/(h*h))
print "TMIN", TMIN, 'm'
# Maximum FLOP is estimated at 275, this may be high for some riders.
FLmax = 275
TMAX = FLmax/((M*G*B/A)*CB/Rh )
print "TMAX", TMAX, 'm'