from __future__ import division
import math
h=400 #height of structure (mm)
l1=300 #length of small section (mm)
L=1200 #length of whole structure (mm)
E=70000 #youngs modulus (N/mm^2)
A_f=350 #area of flange (mm^2)
A_s=300 # area of stiffeners (mm^2)
t=2 #thickness (mm)
I=2000 #second moment of area (mm^4)
w=5
#eqn 9.29 tan(a)^4=(1+td/2A_F)/(1+td/2A_S)
alpha=math.atan(((1+t*h/2/A_f)/(1+t*l1/A_s))**0.25)
#eqn 9.19
F_T=w*L/h+w/2/math.tan((alpha))
#eqn 9.25 M_max=w*b^2*tan(a)/12/d
M_max=w*10**3*l1**2*math.tan(alpha)/12/h
print "maximum value of bending moment = %1.1e N.mm \n"%(M_max)
#eqn 9.23 P=w*b*tan(a)/d
P=w*l1*math.tan(alpha)/h
print "compressive load in stiffener = %1.1f kN \n"%(P)
#eqn 9.24 le=d/(4-2b/d)^0.5
le=h/(4-2*l1/h)**0.5
print "equivalent length of stiffener = %3.1f mm\n"%(le)
#eqn 8.7 Pcr=pi^2*E*I/le^2
P_CR=math.pi**2*E*I/le**2
print "buckling load of a stiffener = %2.1f kN \n"%(P_CR) #approx. value in book