import math
#Initilization of variables
t=1 #cm #thickness of plates
sigma_t=150 #MPa #Working stress
sigma_c=212.5 #MPa #crushing stress
sigma_s=94.5 #MPa #shearing stress
#Calculation (Part-1)
#P_s=pi*4**-1*d**2*sigma_s #N #Shearing strength
#After substituting values and further simplifying we get
#P_s=pi*4**-1*d**2*94.5*10**6 #N
#P_c=d*t*sigma_c #N #crushing strength
#After substituting values and further simplifying we get
#P_c=d*1*10**-2*212.5*10**6 #N
#P_t=(p-d)*t*sigma_t #N #Strength of plate in tearing
#After substituting values and further simplifying we get
#P_t=(p-d)*1*10**-2*150*10**6
#Now comparing strengths
#P_s=P_c
#pi*4**-1*d**2*94.5*10**6=d*1*10**-2*212.5*10**6
d=1*10**-2*212.5*10**6*(pi*4**-1*94.5*10**6)**-1 #m #Diameter of rivet
#Now comparing strengths
#P_t=P_c
#(p-d)*1*10**-2*150*10**6=d*1*10**-2*212.5*10**6
#Afte further simplifying equation we get
#(p-d)=1.4166*d
p=(1.4166*d+d) #m #Pitch length of rivet
P=p*sigma_t*10**6*t*10**-2 #N #Strength of solid plate #Answer for strength of solid plate is incorrect in textbook
rho=(p-d)*p**-1*100 #Efficiency of the joint #Notification has been changed
#Calculation (Part-2)
#P_s=2*pi*4**-1*d**2*sigma_s #N #Shearing strength
#After substituting values and further simplifying we get
#P_s=2*pi*4**-1*d**2*94.5*10**6 #N
#P_c=2*d*t*sigma_c #N #crushing strength
#After substituting values and further simplifying we get
#P_c=2*d*1*10**-2*212.5*10**6 #N
#P_t=(p-d)*t*sigma_t #N #Strength of plate in tearing
#After substituting values and further simplifying we get
#P_t=(p-d)*1*10**-2*150*10**6
#Now comparing strengths
#P_s=P_c
#2*pi*4**-1*d**2*94.5*10**6=2*d*1*10**-2*212.5*10**6
d=1*10**-2*212.5*10**6*(pi*4**-1*94.5*10**6)**-1 #m #Diameter of rivet
#Now comparing strengths
#P_t=P_c
#(p-d)*1*10**-2*150*10**6=2*d*1*10**-2*212.5*10**6
#Afte further simplifying equation we get
#(p-d)=2.833*d
p_1=(2.833*d+d) #m #Pitch length of rivets in shearing strength of plate #Notification for pitch length has been changed
rho_2=(p_1-d)*p_1**-1*100 #Efficiency of the joint #Notification has been changed
#Result
print"The Efficiency of joint in single rivet is",round(rho,2),"%"
print"The Efficiency of joint in double rivet is",round(rho_2,2),"%"
import math
#Initilization of variables
p=7.5 #cm #Pitch of rivets
t=1.5 #cm #Thickness of plate
d=2.5 #cm #diameter of rivets
sigma_t=400 #MPa #Working stress
sigma_c=640 #MPa #crushing stress
sigma_s=320 #MPa #shearing stress
n=2 #No. of rivets
#Calculation
P_t=(p-d)*t*10**-4*sigma_t*10**6*10**-3 #N #Strength of plate in tearing
P_s=n*pi*4**-1*d**2*10**-4*sigma_s*10**6*10**-3 #N #Shearing strength
P_c=n*d*t*10**-4*sigma_c*10**6*10**-3 #N #crushing strength
#Thus Minimum force that will rapture the joint is least of P_t,P_s,P_c i.e P_t
#Result
print"Minimum force that will rapture the joint is",round(P_t,2),"N"
import math
#Initilization of variables
d_1=2 #cm #Diameter of rivets
p_1=6 #cm #Pitch of rivet
d_2=3 #cm #Diameter of rivet
p_2=8 #cm #Pitch of rivet
sigma_t=120 #MPa #Working stress
sigma_c=160 #MPa #crushing stress
sigma_s=90 #MPa #shearing stress
t=1.2 #cm #thickness of plate
n=2 #No. of rivets
#Calculation (part-1)
P_t=(p_1-d_1)*t*10**-4*sigma_t*10**6 #N #Strength of plate in tearing
P_s=n*pi*4**-1*d_1**2*10**-4*sigma_s*10**6 #N #Shearing strength
P_c=n*d_1*t*10**-4*sigma_c*10**6 #N #crushing strength
P=p_1*t*10**-4*sigma_t*10**6 #N #Strength of solid per pitch length
rho_1=P_s*(P)**-1*100 #% #Efficiency of the joint
#Calculation (part-2)
P_t_2=(p_2-d_2)*t*10**-4*sigma_t*10**6 #N #Strength of plate in tearing
P_s_2=n*pi*4**-1*d_2**2*10**-4*sigma_s*10**6 #N #Shearing strength
P_c_2=n*d_2*t*10**-4*sigma_c*10**6 #N #crushing strength
P_2=p_2*t*10**-4*sigma_t*10**6 #N #Strength of solid per pitch length
rho_2=P_t_2*(P_2)**-1*100 #% #Efficiency of the joint
#Result
print"First joint has higher Efficiency i.e",round(rho_1,2),"% than second joint"
import math
#Initilization of variables
t=18 #mm #thickness of plates
sigma_t=100 #MPa #Tensile stress #Notification has been changed
sigma_s=70 #MPa #Shearing stress #Notification has been changed
#Calculations
d=6*t**0.5 #mm #Diameter of rivet #Answer is in correct in textbook
s=pi*4**-1*d**2*10**-6*sigma_s*10**6 #N #Strength of one rivet in single shear #Answer is in correct in textbook
#Consider strip of joint equal to pitch p
#S_1=(p-d)*t*10**-3*sigma_t*10**6 #Strength of plate against tearing along 1-1
#After substituting values and further simplifying we get
#S_1=1800*p-45900 (Equation 1)
#S_2=(p-d)*t*10**-3*sigma_t*10**6+s #Strength of plate against tearing along 1-1
#After substituting values and further simplifying we get
#S_1=1800*p-56050.64 (Equation 2)
#But the value of Equation 2 is smaller than Equation 1
#Strength of rivets in single shear is
S=4*s
#Equating Equation 2 to shearing value
#1800*p-56050.64=S
p=(S+56050.64)*18000**-1 #cm #Pitch of rivet
#Result
print"Diameter of rivets is",round(d,2),"mm"
print"Pitch of rivet is",round(p,2),"cm"
import math
#Initilization of variables
t=12 #mm #Thickness of plate
d=24 #mm #Diameter of rivets
sigma_t=120 #MPa #stress in tension
sigma_s=200 #MPa #stress in double shear
sigma_b=200 #MPa #stress in Bearing
n=1 #No. of rivet
#Calculation
#P_t=(p-d)*t*10**-4*sigma_t*10**6 #N #Strength of plate in tearing
#After further simplifying we get
#P_t=(p-24)*14400 #N
P_s=n*pi*4**-1*d**2*10**-6*sigma_s*10**6 #N #Shearing strength of rivet in double shear
P_b=n*d*10**-3*t*10**-3*sigma_b*10**6 #N #Bearing strength per pitch length
#Now Equating P_t to P_s or P_b whichever is small
#(p-24)*14400=P_b
p=P_b*14400**-1+24*10**-1 #cm #Pitch of rivet
p_min=2.5*d*10**-1 #cm #Minimum pitch
#Now adopting 6.4 cm pitch
rho=(p-d*10**-1)*p**-1*100
#Result
print"Pitch of rivet is",round(p,2),"cm"
print"Efficiency of joint is",round(rho,2),"%"
import math
#Initilization of variables
t=12 #mm #thickness of plate
d=18 #mm #Diameter of rivet
p=8 #cm #pitch of rivet
sigma_t=460 #MPa #Tensile stress
sigma_s=320 #MPa #shearing stress
sigma_b=640 #MPa #bearing stress
n=2 #No. of rivet
#Calculation
P_t=(p-d*10**-1)*t*10**-1*10**-4*sigma_t*10**6 #N #Strength of plate in tearing
P_s=n*2*pi*4**-1*d**2*10**-6*sigma_s*10**6 #N #Shearing strength of rivet pr pitch length
P_b=n*d*10**-3*t*10**-3*sigma_b*10**6 #N #Bearing strength per pitch length
#The joint will fail at a pull of P_b
S=p*t*sigma_t*10**6*10**-5 #N #strength of solid plate
rho=P_b*S**-1*100 #Efficiency of joint
#Result
print"Pull per pitch length at which joint will fail is",round(P_b,2),"N"
import math
#Initilization of variables
W=270 #KN #Load
t=14 #mm #thickness of plate
b=20 #cm #width of plate
d=20 #mm #diameter of rivet
sigma_s=70 #MPa #shear stress
sigma_b=190 #MPa #stress in bearing
sigma_t=110 #MPa #stress in tensile
#Calculation
S_1=1.75*pi*4**-1*b**2*10**-4*sigma_s*10**6 #strength of one rivet in double shear
S_2=20*10**-3*t*10**-3*sigma_b*10**6
n=W*10**3*S_1**-1
#Adopt 7 rivets
#The plates may tear along section 1-1
W_1=(20-4)*10**-2*t*10**-3*sigma_t*10**6 #N #Permissible Load
#The plates may tear along section 2-2,at the same time shearing the 4 rivets along 1-1
W_2=(20-2*2)*10**-2*t*10**-3*sigma_t*10**6+2*S_1 #N #Permissible Load
#The plates may tear along section 3-3,at the same time shearing the rivets along 1-1 and 2-2
W_3=(20-3*2)*10**-2*t*10**-3*sigma_t*10**6+4*S_1 #N #Permissible Load
W_s=7*S_1 #N #Load to shear all the rivets
W_c=7*S_2 #N #Load to crush all the rivets
W_4=b*10**-2*t*10**-3*sigma_t*10**6 #N #Load carried by solid plate
rho=W_1*W_4**-1*100 #% #Efficiency of joint
#Result
print"Efficiency of joint is",round(rho,2),"%"
import math
#Initilization of variables
D=1.5 #cm #Diameter of boiler
rho=75 #% #Efficiency of joint
sigma_t=85 #MPa #stress in tension
sigma_s=70 #MPa #stress in shear
P=1 #MPa #Steam Pressure #Notification has been changed
#Calculation
t=P*10**6*D*(2*sigma_t*10**6*rho*10**-2)**-1*100
#Adopt 12 mm thickness of plate
t_1=12 #mm
d=6*t_1**0.5
#Adopt 21 mm diameter of rivet
d_1=21 #mm
#P_t=(p-d_1*10**-1)*t*10**-1*10**-4*sigma_t*10**6 #N #Strength of plate in tearing
#After substituting values and further simplifying we get
#P_t=(p-2.1)*10200 #N
P_s=1.875*pi*4**-1*d_1**2*10**-6*2*sigma_s*10**6
#(p-d_1*10**-1)*10200=P_s
p=P_s*10200**-1+d_1*10**-1
#Result
print"pitch of plate is",round(p,2),"cm"