from math import * z = 12 sigma = 58000 d = 1.25 S = pi*d**3/32 F = sigma/z*S print("Round: S=%.3f, F=%.3f" % (S,F)) b = 3/8 h = 4 S = b*h**2/6 F = sigma/z*S print("Bar: S=%.3f, F=%.3f" % (S,F)) b = 0.25 h = 3.0 d = 1.25 A_circle = pi/4*d**2 A_bar = b*h I_circle = pi/64 * d**4 I_bar = b*h**3/12 y = b*h*(d/2+h/2)/(pi/4*d**2+b*h) y_bar = (h+d)/2-y y_circle = y I_total = I_circle + A_circle*y_circle**2 + I_bar + A_bar*y_bar**2 c = d/2+h-y S = I_total/c F = sigma/z*S print("Comp: S=%.3f, F=%.3f" % (S,F))