import math
#initialisation
E = 29000 # Modulus of elasticity in ksi
spl = 42 # Proportional limit in ksi
L = 25 # Total length of coloum in ft
n = 2.5 # factor of safety
I1 = 98 # Moment of inertia on horizontal axis
I2 = 21.7 # Moment of inertia on vertical axis
A = 8.25 # Area of the cross section
#calculation
Pcr2 = (4*math.pi**2*E*I2)/((L*12)**2) # Criticle load if column buckles in the plane of paper
Pcr1 = (math.pi**2*E*I1)/((L*12)**2) # Criticle load if column buckles in the plane of paper
Pcr = min(Pcr1,Pcr2) # Minimum pressure would govern the design
scr = Pcr/A # Criticle stress
Pa = Pcr/n # Allowable load in k
print "The allowable load is ", round(Pa), "k"
import math
#initialisation
L = 3.25 # Length of alluminium pipe in m
d = 0.1 # Outer diameter of alluminium pipe
P = 100000 # Allowable compressive load in N
n =3 # Safety factor for eular buckling
E = 72e09 # Modulus of elasticity in Pa
l = 480e06 # Proportional limit
#calculation
Pcr = n*P # Critice load
t = (0.1-(55.6e-06)**(1.0/4.0) )/2.0 # Required thickness
tmin = t
print "The minimum required thickness of the coloumn is", round(tmin*1000,2), "mm"
from sympy import *
#initialisation
P = 1500 # Load in lb
e = 0.45 # ecentricity in inch
h = 1.2 # Height of cross section in inch
b = 0.6 # Width of cross section in inch
E = 16e06 # Modulus of elasticity
my_del = 0.12 # Allowable deflection in inch
#calculation
L = mpmath.asec(1.2667)/0.06588 # Maximum allowable length possible
#Result
print "The longest permissible length of the bar is", round(L), "inch"
from sympy import *
import math
#initialisation
L = 25 # Length of coloum in ft
P1 = 320 # Load in K
P2 = 40 # Load in K
E = 30000 # Modulus of elasticity of steel in Ksi
P = 360 # Euivalent load
e = 1.5 # Ecentricity of compressive load
A = 24.1 # Area of the Cross section
r = 6.05 # in inch
c = 7.155 # in inch
sy = 42 # Yeild stress of steel in Ksi
#calculation
smax = (P/A)*(1+(((e*c)/r**2)*mpmath.sec((L/(2*r))*math.sqrt(P/(E*A))))) # Maximum compressive stress
print "The Maximum compressive stress in the column ", round(smax,2), "ksi"
# Bisection method method to solve for yeilding
def stress(a,b,f):
N = 100
eps = 1e-5
if((f(a)*f(b))>0):
print 'no root possible f(a)*f(b)>0'
sys.exit()
if(abs(f(a))<eps):
print 'solution at a'
sys.exit()
if(abs(f(b))<eps):
print 'solution at b'
while(N>0):
c = (a+b)/2.0
if(abs(f(c))<eps):
x = c
return x
if((f(a)*f(c))<0 ):
b = c
else:
a = c
N = N-1
print 'no convergence'
sys.exit()
def p(x):
return x + (0.2939*x*sec(0.02916*sqrt(x))) - 1012
x = stress(710,750,p)
Py = x # Yeilding load in K
n = Py/P # Factor of safety against yeilding
print "The factor of safety against yeilding is", round(n)
import math
import numpy
#initialisation
E = 29000 # Modulus of elasticity in ksi
sy = 36 # Yeilding stress in ksi
L = 20 # Length of coloumn in ft
r = 2.57 # radius of gyration of coloumn
K = 1 # Effetive Length factor
#calculation
s = math.sqrt((2*math.pi**2*E)/sy) # Criticle slenderness ratio (K*L)/r
s_ = (L*12)/r # Slenderness ratio
# Part(a)
n1 = (5.0/3.0)+((3.0/8.0)*(s_/s))-((1.0/8.0)*((s_**3)/(s**3))) # Factor of safety
sallow = (sy/n1)*(1-((1.0/2.0)*((s_**2)/(s**2)))) # Allowable axial load
A = 17.6 # Cross sectional area from table E1
Pallow = sallow*A # Allowable axial load
print "Allowable axial load is", round(Pallow,2), "k"
# Part (b)
Pe = 200 # Permissible load in K
L_ = 25 # Assumed length in ft
s__ = (L_*12)/r # Slenderness ratio
n1_ = (5.0/3.0)+((3.0/8.0)*(s__/s))-((1.0/8.0)*((s__**3)/(s**3))) # Factor of safety
sallow_ = (sy/n1_)*(1-((1.0/2.0)*((s__**2)/(s**2)))) # Allowable axial load
A = 17.6 # Area of the cross section in**2
Pallow = sallow_*A # Allowable load
L1 = [24, 24.4, 25]
P1 = [201, 194, 190]
L_max = numpy.interp(200.0, P1, L1)
print "The maximum permissible length is", L_max, "ft"
import math
import numpy
#initialisation
L = 3.6 # Length of steel pipe coloumn
d = 0.16 # Outer diameter in m
P = 240e03 # Load in N
E = 200e09 # Modulus of elasticity in Pa
sy = 259e06 # yeilding stress in Pa
K = 2.0
Le = K*L # As it in fixed-free condition
#calculation
sc = math.sqrt((2*math.pi**2*E)/sy) # Critical slenderness ratio
# First trial
t = 0.007 # Assumed thick ness in m
I = (math.pi/64)*(d**4-(d-2*t)**4) # Moment of inertia
A = (math.pi/4)*(d**2-(d-2*t)**2) # Area of cross section
r = math.sqrt(I/A) # Radius of gyration
sc_ = round((K*L)/r) # Slender ness ratio
n2 = 1.92 # From equation 11.80
sa = (sy/(2*n2))*(sc**2/sc_**2) # Allowable stress
Pa = round((sa*A)/1000) # Allowable axial load in N
# Interpolation
t = [7, 8, 9]
Pa = [196, 220, 243]
t_min = numpy.interp(240.0, Pa, t)
print "The minimum required thickness of the steel pipe is", round(t_min,1), "mm"
import math
#initialisation
L = 16 # Effective length in inch
P = 5 # axial load in K
#calculation
# Bisection method for solvong the quaderatic
def stress(a,b,f):
N = 100
eps = 1e-5
if((f(a)*f(b))>0):
print 'no root possible f(a)*f(b)>0'
sys.exit()
if(abs(f(a))<eps):
print 'solution at a'
sys.exit()
if(abs(f(b))<eps):
print 'solution at b'
while(N>0):
c = (a+b)/2.0
if(abs(f(c))<eps):
x = c
return x
if((f(a)*f(c))<0 ):
b = c
else:
a = c
N = N-1
print 'no convergence'
sys.exit()
def p(x):
return 30.7*x**2 - 11.49*x -17.69
x = stress(0.9,1.1,p)
d = x # Diameter in inch
sl = 49.97/d # Slenderness ration L/r
dmin = d # Minimum diameter
print "The minimum required outer diameter of the tube is", round(dmin,2), "inch"
import math
#initialisation
Fc = 11e06 # Compressive demath.sing stress in Pa
E = 13e09 # Modulus of elasticity in Pa
#calculation
# Part (a)
Kce = 0.3
c = 0.8
A = 0.12*0.16 # Area of cross section
Sl = 1.8/0.12 # Slenderness ratio
fi = (Kce*E)/(Fc*Sl**2) # ratio of stresses
Cp = ((1+fi)/(2*c)) - math.sqrt(((1+fi)/(2*c))**2-(fi/c)) # Coloumn stability factor
Pa = Fc*Cp*A
print "The allowable axial load is", Pa, "N"
# Part (b)
P = 100000 # Allowable Axial load
Cp_ = P/(Fc*A) # Coloumn stability factor
# Bisection method method to solve for fi
def stress(a,b,f):
N = 100
eps = 1e-5
if((f(a)*f(b))>0):
print 'no root possible f(a)*f(b)>0'
sys.exit()
if(abs(f(a))<eps):
print 'solution at a'
sys.exit()
if(abs(f(b))<eps):
print 'solution at b'
while(N>0):
c = (a+b)/2.0
if(abs(f(c))<eps):
x = c
return x
if((f(a)*f(c))<0 ):
b = c
else:
a = c
N = N-1
print 'no convergence'
sys.exit()
def p(x):
return ((1+x)/(2.0*c)) - math.sqrt(((1+x)/(2.0*c))**2-(x/c)) - Cp_
x = stress(0.1,1.0,p)
fi_ = x
d_ = 0.12 # Diameter in m
L_max = d_*math.sqrt((Kce*E)/(fi_*Fc)) # Maximum length in m
print "The minimum allowable length is", round(L_max,2), "m"