This is a repository of some useful files for the subject "Mechanics of Solids" in the Mechanical Engineering Department of IIT Kharagpur. This subject is a mandatory one for the second year undergraduate students of Mechanical Engineering.
The latest version of the course home page is maintained at: http://www.facweb.iitkgp.ac.in/~jeevanjyoti/teaching/mechsolids/2021/
pip install sympy
- Tested with Sympy version 1.11.1
- Tested with Python version 3.9.13
- Create a new Python file to solve a problem. Import the Beam and math modules as follows:
from Beam import * from math_functions import *
- Create either a *Simply Supported Beam* or a *Cantilever Beam* object as follows:
beam = SimplySupportedBeam(NameOfBeam, LengthOfBeam) beam = CantileverBeam(NameOfBeam, LengthOfBeam)
- If the beam is a *Simply Supported Beam*, then add the supports as follows:
beam.add_supports(Support(PositionOfSupport1, PositionOfSupport2))
where position is the distance of the support from the left end of the beam.
- Create loads using the load class as follows:
load1 = PointLoad(ValueOfLoad, PositionOfLoad) load2 = DistributedLoad(StartPosition, EndPosition, LoadAtStart, LoadAtEnd) load3 = EquationLoad(EquationString, StartPosition, EndPosition, startLoad(=0), endLoad(optional)) # add these loads on the beam beam.add_load(load1) beam.add_load(load2) beam.add_load(load3)
where position is the distance of the load from the left end of the beam.
- To generate the shear force and bending moment diagrams, use the following functions:
beam.plot_sfd_and_bmd() # if you want to plot just the shear force diagram or bending moment diagram, use the following functions: beam.plot_sfd() beam.plot_bmd()