0% found this document useful (0 votes)
33 views1 page

Deflection Program Sahil Mahto

This Python code allows a user to input parameters to calculate beam deflection based on beam properties, load type, and cross-section shape. The user inputs the beam length, modulus of elasticity, and selects between a rectangular or circular cross-section. Based on the selection, the user then provides width/depth or diameter to calculate the second moment of area. The user also selects the load type from options like point load or distributed load. The code then calculates and prints the deflection in millimeters.

Uploaded by

Sahil Mahto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Deflection Program Sahil Mahto

This Python code allows a user to input parameters to calculate beam deflection based on beam properties, load type, and cross-section shape. The user inputs the beam length, modulus of elasticity, and selects between a rectangular or circular cross-section. Based on the selection, the user then provides width/depth or diameter to calculate the second moment of area. The user also selects the load type from options like point load or distributed load. The code then calculates and prints the deflection in millimeters.

Uploaded by

Sahil Mahto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

l=int(input("Enter the length of the Beam in meters:"))

e=int(input("Enter the modulus of Elasticity in Newton per meter square:"))


print("Enter The choice for cross section")
m=int(input("Enter 1 for Rectangular Cross section and 2 for circular cross
section:"))
if m==1:
b=int(input("Enter the width in mm:"))
de=int(input("Enter the depth in mm:"))
i= (b*de*de*de)/12
elif m==2:
d=int(input("Enter the diameter in mm:"))
i=(3.14*d*d*d*d)/64

print("Enter 1 for cantilever beam carrying point load at its end")


print("Enter 2 for cantilever beam carrying uniformly distributed length over its
entire length")
print("Enter 3 for simpy supported beam carrying point load at the middle")
print("Enter 4 for simply supported beam carrying uniformly distributed load over
its entire length")
a=int(input("Enter the choice for type of beam:"))
if a==1:
w=int(input("Enter load in Newton:"))
y=(w*l*l*l)/(3*e*i*pow(10,-12))
elif a==2:
w=int(input("Enter the load in Newton per meter:"))
y=-(w*l*l*l*l)/(8*e*i*pow(10,-12))
elif a==3:
w=int(input("Enter the load in Newton:"))
y=-(w*l*l*l)/(48*e*i*pow(10,-12))
elif a==4:
w=int(input("Enter the load in Newton per meter:"))
y=-(5*w*l*l*l*l)/(382*e*i*pow(10,-12))

print("The deflection in the beam is :",round(y,3)*pow(10,3),"in mm")

You might also like