import math
from sympy import symbols
#Variable declaration
L=2 # Length(m)
E=13*(pow(10,9)) # Modulus of elasticity(GPa)
Sall=12 # Stress(MPa)
FS=2.5 # Factor of safety(2.5)
Ld1=100 # Load force(kN)
Ld2=200 # Load force(kN)
#Calculation
#(a) For the 100-kN Load
Pcr=FS*Ld1*(1000.0) # Pressure(kN)
I=(Pcr*(L**2))/(((math.pi)**2)*E) # Moment of inertia(m**4)
a1=round((I*12)**(1/4.0),1) # Side of square(mm)
S=(100)/((0.1)**2) # Normal stress in column(MPa)
#(b) For the 200-kN Load
Pcr=FS*(Ld2)*(1000.0) # Pressure(kN)
I=(Pcr*(L**2))/(((math.pi)**2)*E) # Moment of inertia(m**4)
a=((I)*12)**(1/4.0) # Side of square(mm)
S=(200/(0.11695)**2) # Normal stress(MPa)
A=(200/12.0)*(pow(10,-3)) # Area of cross section(m**2)
a2=(A)**(1/2.0)*(1000) # Side of square(mm)
#Result
print('Case(a): Size of cross section if the column is to safetly support 100 kN = %lf psi '%a1)
print('Case(b): Size of cross section if the column is to safetly support 200 kN = %.lf psi '%a2)
import math
from sympy import symbols
#Variable declaration
L=20 # Length of aluminium column(in)
E=10.1*(pow(10,6)) # Modulus of elasticity(psi)
P=5 # Stress(kips)
L=symbols('L') # Variable declaration
Le=symbols('Le') # Variable declaration
Le=0.7*L # Effective length of column
a=symbols('a') # Variable declaration
b=symbols('b') # Variable declaration
Scr=symbols('Scr') # Variable declaration
ry=(b)/(math.sqrt(12)) # Radius of gyration
FS=2.5 # Factor of safety
#Calculation
#Buckling in xy Plane
Ix=(1/12.0)*(a**3)*b # Moment of inertia
A=a*b # Area of cross section
rz=(((1/12.0)*b*(a**3))/(a*b))**(1/2.0) # Radius of gyration
ESRxy=(Le)/(rz) # Effective slenderness ratio
#Buckling in xz Plane
ESRxz=(Le)/(ry) # Effective slenderness ratio
# Case(a) Most Efficient Design
Ans=((0.7*L)*(math.sqrt(12.0)))/((2.0*L)*(math.sqrt(12.0))) # Most efficient design
# Case(b) Design for Given Data.
Pcr=(FS)*(P) # Pressure(kips)
a=0.35*b # Distance
A=a*b # Area
Scr=(Pcr/A) # Stress
b=(((12500)*((138.6)**2))/(0.35*10.1*(pow(10.0,6))*((math.pi)**2.0)))**(1/4.0) # Distance(in)
#Result
print('Case(a): Ratio for most efficient design = %lf '%Ans)
print('Case(b): Design for given data breadth = %lf in '%b)
print('Case(b): Design for given data length = %lf in '%(0.35*b))
import math
from sympy import symbols
#Variable declaration
E=(29*(pow(10,6))) # Modulus of elasticity(psi)
FS=2 # Factor of safety
A=3.54 # Area of cross section(in**2)
I=8.00 # Moment of inertia(in**4)
r=1.50 # Radius(in)
c=2.00 # Distance(in)
Lab=8
#Calculation
# Effective Length
Le=2*(Lab) # Effective length(in)
# Critical Load
Pcr=((((math.pi)**2)*E*(8.0))/(192.0)**2)/(1000.0) # Critical load(kips)
#Case(a) Allowable Load and Stress
Pall=Pcr/FS # Allowable load(kips)
S=Pall/A # Allowable Stress(ksi)
#Case(b) Eccentric Load
ym=(0.75)*(2.252-1) # Distance(in)
Sm=(31.1/3.54)*(1+(0.667)*(2.252)) # Distance(in)
#Result
print('Case(a): Allowable load = %lf kips'%Pall)
print('Case(a): Allowable stress = %lf ksi '%S)
print('Case(b): The horizontal deflection of the top of the column = %lf in '%ym)
print('Case(b): Maximum normal stress in the column = %lf ksi '%Sm)
import math
from sympy import symbols
#Variable declaration
A=1460*(pow(10,-6)) # Area of cross section(m**2)
rx=41.7 # Radius of gyration(mm)
ry=14.6 # Radius of gyration(mm)
P=60*(pow(10,3)) # Force(N)
E=200*(pow(10,9)) # Modulus of elasticity(GPa)
L=symbols('L') # Variable Declaration
r=symbols('r') # Variable Declaration
Scr=symbols('Scr')
#Calculation
Sall=(P/A) # Stress of all(Pa)
Scr=0.8778*((((math.pi)**2)*(E))/(L/r)**2) # Critical stress
Sall=Scr/1.67 # Stress of all(Pa)
R1=((1.037*(pow(10,12)))/(1.41*(pow(10,6))))**(1/2) # Slenderness ratio
R1l=(4.71)*((200*(pow(10,9)))/(250*(pow(10,6))))**(1/2) # Slenderness ratio
L=158.8*(14.6*(pow(10,-3))) # Choosing the smaller of the two radii of gyration
#Result
print('The longest unsupported length L = %lf m'%L)
import math
from sympy import symbols
#Variable declaration
Sy=36 # Stress(ksi)
E=(29*(pow(10,6))) # Modulus of elasticity(psi)
A=11.5 # Area(in**2)
FS=2 # Factor of safety
#Calculation
ratio=(4.71)*(E/(36*(pow(10,3)))) # Value of the slenderness ratio
#Case(a) Effective Length
Sr=(24*12)/(1.98) # Value of the slenderness ratio
Scr=((0.877)*((math.pi)**2)*(29*(pow(10,3))))/(145.5)**2 # Value of the slenderness ratio
Sall=(Scr/1.67) # Allowable stress(ksi)
Pall1=Sall*A # Pressure(kips)
#Case(b) Bracing at Midpoint C
#xz Plane
Elxz=(144)/(1.98) # Slenderness ratio
#yz Plane
Elyz=(288)/(4.27) # Slenderness ratio
Se=(((math.pi)**2)*(E))/(72.7)**2 # Stress(ksi)
Scr=(0.658)**(36/54.1)*(36) # Stress(ksi)
Sall=(Scr)/(1.67) # Allowable load(ksi)
Pall2=Sall*A # Force(ksi)
#Result
print('Effective centric load P if the effective length of the column is 24 = %lf kips'%Pall1)
print('Effective centric load P if bracing is provided to prevent the movement of the midpoint C in the xz plane = %lf ksi'%Pall2)
import math
from sympy import symbols
#Variable declaration
P=60 # Centric load(kN)
c=symbols('c') # Variable declaration
I=((math.pi)/4.0)*(c**4) # Moment of inertia
A=(math.pi)*(c**2) # Area of cross section
#Calculation
r=(I/A)**(1/2.0) # Radius
#Case(a) Length of 750 mm
c=((60*(pow(10,3))*((0.75)**2)*4)/((math.pi)*(382.0)*(pow(10.0,9))))**(1/4.0)
Sr=(750)/(18.31/2.0)
d1=2*c
#Case(b) Length of 300 mm
c=11.95 # Radius(mm)
Sr=((300)*(2))/(11.95) # Slenderness ratio
d2=(2*c)/(1000.0) # Required diamter(mm)
#Result
print('The smallest diameter rod that can be used to support the centric load P=60 kN if L=750 mm = %lf '%d1)
print('The smallest diameter rod that can be used to support the centric load P=60 kN if L=300 mm = %lf '%d2)
import math
from sympy import symbols,solve
#Variable declaration
L=28 # Effective length(in)
P=symbols('P')
#Calculation
A=2**2 # Area of cross ection(in**2)
I=(1/12.0)*(2**4) # Moment of inertia(in**4)
r=(I/A)**(1/2.0) # Radius(in)
R1=(28/0.5774) # Ratio
Sall=(30.9-(0.229*48.5)) # Stress for the aluminum column(ksi)
P=solve((P/4.0)+((P*0.8*1)/(1.333))-19.79,P) # Maximum load that can be safely applied(kips)
#Result
print('The maximum load that can be safely applied is = %lf kips'%P[0])
import math
from sympy import symbols,solve
#Variable declaration
Sallcentric=19.79 # Stress all centric(ksi)
Sallbending=24 # Stress all bending(ksi)
P=symbols('P')
#Calculation
P=solve((P/4.0)/(19.79) + ((P*0.8*1)/(1.333*24))-1,P)
#Result
print('The maximum load that can be safely applied is = %lf kips'%P[0])
import math
from sympy import symbols,solve
#Variable declaration
E=200 # Modulus of elasticity(GPa)
Sy=250 # Stress(MPa)
P=symbols('P') # Variable declaration
#Calculation
Sall=162.2/1.67 # Allowable stress(MPa)
P=solve(P*((1/(9.42*(pow(10,-3))))+(0.200/(1.050*(pow(10,-3)))))-97.1,P) # Largest load P(kN)
#Result
print('The largest allowable load P is thus = %lf kN'%(P[0]*1000))
import math
from sympy import symbols,solve
#Variable declaration
E=200 # Modulus of elasticity(GPa)
Sy=150 # Stress(MPa)
P=symbols('P') # Variable declaration
#Calculation
P=solve(P*((1/(97.1*9.42*(pow(10,3))))+(0.200/(150*1.050*(pow(10,3)))))-1,P) # Largest allowable load(kN)
#Result
print('The largest allowable load P is thus = %lf kN'%(P[0]/1000))
import math
from sympy import symbols,solve
#Variable declaration
A=symbols('A') # Variable declaration
E=29*(pow(10,6)) # Modulus of elasticity(psi)
Sy=36 # Stress(ksi)
SR=133.7 # Slenderness ratio
Scr=22.5 # Slenderness ratio
#Calculation
A=solve(22-(85/A)-((425*4)/(A*(pow(3.5,2)))),A) # Area of cross section(in**2)
#Trial 1: W8*35
#Allowable Bending Stress
Sall=22 # Allowable bending stress(ksi)
#Allowable Concentric Stress
Ratio1=(8.25/13.46)+(13.62/22.0) # Allowable concentric stress(ksi)
#Since 1.232 > 1.000, the requirement expressed by the interaction formula is not satisfied; we must select a larger trial shape.
#Trial 2: W8*48
Ratio2=(6.03/13.76)+(9.82/22.0) # Allowable concentric stress(ksi)
#The W8*48 shape is satisfactory but may be unnecessarily large
#Trial 3: W8*40
#Following again the same procedure, we find that the interaction formula is not satisfied.
print ('Selection of Shape. The shape to be used is W8*48')