import math
#Initilization of variables
P=10 #KN #Load
e=0.06 #m #eccentricity
b=0.240 #m #width of column
d=0.150 #m #depth of column
#Calculations
sigma_d=P*(b*d)**-1 #KN/m**2
M=P*e #KN*m #Moment due to eccentricity
Z=(d*(b)**2)*6**-1 #mm**3
sigma_b=M*Z**-1 #KN/m**2
sigma_CD=sigma_d+sigma_b
sigma_AB=sigma_d-sigma_b
#Result
print"Stress at face CD is",round(sigma_CD,2),"KN/m**2"
print"Stress at face AB is",round(sigma_AB,2),"KN/m**2"
import math
#Initilization of variables
d=2 #cm #Diameter of specimen
#Calculations
#Let P be the Load on the section
A=pi*4**-1*d**2 #cm**2 #Area of section
I=pi*64**-1*d**4 #cm**4 #M.I of the section
y=d*2**-1 #cm
Z=I*y**-1 #cm**3 #Section modulus
#M=P.e #Moment
#Stress due to direct load
#sigma_d=(4*P)*(pi*d**2)**-1 #N/cm**2
#stress due to moment
#sigma_b=(32*P*e)*(pi*d**3)**-1 N/cm**2
#Maximum stress
#sigma_r_max=(((4*P)*(pi*d**2)**-1)+((32*P*e)*(pi*d**3)**-1))
#Mean stress
#sigma_r_mean=((4*P)*(pi*d**2)**-1)
#Since the maximum stress is 20% greater than the mean stress
#(((4*P)*(pi*d**2))+((32*P*e)*(pi*d**3)))=1.2*4*P*(pi*d**2)**-1
#After substituing values and simplifyinf we get
e=0.2*d*8**-1 #cm #distance of line of thrust from the axis
#Result
print"The distance of line of thrust from the axis is",round(e,2),"cm"
import math
#Initilization of variables
A=300 #cm**2 #Area of column
e=5 #cm #eccentricity
#Calculations
#sigma_d=P*A**-1 #Direct compressive stress
#M=P*e #Bending Moment
Z=((20**4-10**4)*(6*20)**-1) #cm**3 #Section modulus
#sigma_b=M*Z**-1=P*250**-1
#Now sigma_d+sigma_b=60*10**2
#P*300**-1+P*250**-1=6000
#After simplifying we get
P_1=6000*300*250*550**-1 #N #Load
#sigma_b-sigma_d=300
P_2=300*300*250*50**-1 #N #Load
#Result
print"The maximum load column can carry",round(P_2,2),"N"
import math
#Initilization of variables
D=40 #cm #External diameter of column
d=30 #cm #Internal diameter of column
e=20 #cm #Eccentricity
P=150 #KN #Load
#calculations
A=pi*4**-1*(D**2-d**2) #cm**2 #Area of the column
Z=pi*32**-1*((D**4-d**4)*D**-1) #cm**3 #Section modulus
M=P*10**3*e #N*cm #Moment
sigma_r_max=((P*10**3*A**-1)+(M*Z**-1)) #N/cm**2 #Max stress
sigma_r_min=((P*10**3*A**-1)-(M*Z**-1)) #N/cm**2 #Min stress
#Result
print"Max intensities of stress in the section is",round(sigma_r_max,2),"N/cm**2"
print"Min intensities of stress in the section is",round(sigma_r_min,2),"N/cm**2(tension)"
import math
#Initilization of variables
b=4 #m #width of pier
d=3 #m #depth of pier
e_x=1 #m #distance from y axis
e_y=0.5 #m #distance from x axis
P=80 #KN #Load
#Calculations
A=b*d #m**2 #Area of pier
I_x_x=b*d**3*12**-1 #m**4 #M.I about x-x axis
I_y_y=d*b**3*12**-1 #m**4 #M.I about y-y axis
M_x=P*e_y #KN*m #Moment about x-x axis
M_y=P*e_x #KN*m #Moment about y-y axis
x=2 #m #Distance between y-y axis and corners A and B
y=1.5 #m ##Distance between x-x axis and corners A and D
#Part-1
#Stress developed at each corner
sigma_A=P*A**-1+M_x*y*I_x_x**-1-M_y*x*I_y_y**-1 #KN/m**2 #stress at A
sigma_B=P*A**-1+M_x*y*I_x_x**-1+M_y*x*I_y_y**-1 #KN/m**2 #stress at B
sigma_C=P*A**-1-M_x*y*I_x_x**-1+M_y*x*I_y_y**-1 #KN/m**2 #stress at C
sigma_D=P*A**-1-M_x*y*I_x_x**-1-M_y*x*I_y_y**-1 #KN/m**2 #stress at D
#Part-2
#Let f be the additional load that should be placed at centre
#sigma_c=F*A**-1 #KN/m**2 #compressive stress
#For no tension in pier section, compressive stress is equal to tensile stress
sigma_c=10 #KN/m**2
F=sigma_c*A #KN
#Part-3
sigma=F*A**-1 #KN/m**2 #stress due to additional load of 120 KN
sigma_A_1=sigma_A+10 #stress at A
sigma_B_1=sigma_B+10 #stress at B
sigma_C_1=sigma_C+10 #stress at C
sigma_D_1=sigma_D+10 #stress at D
#Result
print"Stress at each corner are as follows:stress_A",round(sigma_A,2),"KN/m**2"
print" :stress_B",round(sigma_B,2),"KN/m**2"
print" :stress_C",round(sigma_C,2),"KN/m**2"
print" :stress_D",round(sigma_D,2),"KN/m**2(tensile)"
print"Additional load that should be placed at centre is",round(F,2),"KN"
print"Stresses at the corners with the additional load in centre are as follows:Stress_A_1",round(sigma_A_1,2),"KN/m**2"
print" :Stress_B_1",round(sigma_B_1,2),"KN/m**2"
print" :Stress_C_1",round(sigma_C_1,2),"KN/m**2"
print" :Stress_D_1",round(sigma_D_1,2),"KN/m**2"
import math
#Initilization of variables
#d=Diameter of rod
P=500 #KN
e=0.75 #cm #eccentricity
#calculation
#A=pi*d**2*4**-1 #cm**2 #Area of rod
#sigma_d=P*A**-1 #KN/cm**2 #stress due to direct load
#After substituting value and simplifying we get,
#sigma_d=2000*(pi*d**2)**-1 #KN/cm**2
M=P*e #Kn*cm #Moment
#Z=pi*d**3*32**-1 #cm**3 #section modulus
#sigma_b=M*Z**-1 #KN/cm**2 #Stress due to moment
#After substituting value and simplifying we get,
#sigma_b=12000*(pi*d**3)**-1 #KN/cm**2
#Max stress
#sigma=sigma_d+sigma_b
#After substituting value and simplifying we get,
#2000*(pi*d**2)**-1+12000*(pi*d**3)**-1=12.5
#After simplifying we get,
#d**3-53.05*d-318.3=0
#From Synthetic Division we get d**2+4.73*d-42.918
a=1
b=-4.73
c=-42.918
X=b**2-(4*a*c)
d_1=(-b+X**0.5)*(2*a)**-1
d_2=(-b-X**0.5)*(2*a)**-1
#Result
print"The minimum diameter of tie rod is",round(d_1,2),"cm"