Skip to content

JebronLames32/Lib-mechsolids-abhinav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mechanics of Solids

Downloads

Mechanical Engineering Department, Indian Institute of Technology Kharagpur

parent repository : Repo Link

This is a repository that contains the code to the python package that I have created for the course ME21003 - Mechanics of Solids. The package contains a module called Beam that can be used to create a beam object. The package also contains a class called math_functions that contains functions to solve add loads on the beam and solve for the shear force and bending moment diagrams.

Manual to use the Beam class

Simply install the package using the following command and use the Beam class as shown below:

pip install Lib-mechsolids-abhinav==0.0.1

PyPi link: https://pypi.org/project/Lib-mechsolids-abhinav/

We need to have the following libraries installed before using the beam class. To install them(if not already installed), use the following command:

pip install sympy
pip install numpy
pip install matplotlib
  • Tested with Sympy version 1.11.1
  • Tested with Python version 3.9.13
  • Tested with Matplotlib version 3.5.2
  • Tested with Numpy version 1.21.5

Steps to use the Beam class:

  1. Create a new Python file to solve a problem. Import the Beam and math modules as follows:
    from Lib_mechsolids_abhinav.Beam import *
    from Lib_mechsolids_abhinav.math_functions import *
  2. Create either a Simply Supported Beam or a Cantilever Beam object as follows:
    beam = SimplySupportedBeam(NameOfBeam, LengthOfBeam)
    beam = CantileverBeam(NameOfBeam, LengthOfBeam)
  3. 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.

  4. 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.

  5. 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()

About

Python package for plotting SFD and BMD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages