import math
#Variable declaration
J=12 #journey per hour
Load=5500 #[Load] Kg
t_up=1.5 #[time] min
W_cage=500 #[Weight of cage] Kg
t_down=1.25 #[time] min
h=50 #[height] m
Wb=3000 #Kg(Balance weight)
Eff_hoist=0.8 #Effeciency of hoist
Eff_motor=0.85 #Efficiency of motor
g=9.81 #gravity constant
#Calculation
E_upward=(Load+W_cage-Wb)*g*h #J
E_downward=(Wb-W_cage)*g*h #J
Edj=E_upward+E_downward #J(Energy used in double journey)
Ein=Edj/Eff_hoist/Eff_motor #J or W-s
Ein=Ein/1000/3600 #KWh
Ein_hour=Ein*J #KWh
Rating=E_upward/Eff_hoist/t_up/60 #W
#Result
print"\n\n(a).Electrical energy used in upward journey :",E_upward,"J"
print" Electrical energy used in downward journey :",E_downward,"J"
print" Electrical energy used in each double journey :",Edj,"J"
print" Energy input in each double journey=",round(Ein,3),"kWh\n"
print"(b).Electrical energy consumption in one hour : ",round(Ein_hour,3),"kWh\n"
print"(c) kW Rating of motor: ",Rating/1000,"kW"