Package: femethods
FEmethodsIntroductionFEmethodsis a python module that uses Finite Element Methods to determine the
reactions, and plot the shear, moment, and deflection along the length of a beam.Using Finite elements has the advantage over using exact solutions because it
can be used as a general analysis, and can analyze beams that are statically
indeterminate. The downside of this numerical approach is it will be less
accurate than the exact approach.The official documentation is onRead the Docs.InstallationFEMethodsis hosted on PyPi, so installation is simple.pip install femethodsGeneral LayoutFEMethodsis made up of several sub-classes to make it easy to define loads
and reaction types.femethods.loadsThere are currently only two different load types that are implemented.PointLoad, a normal force acting with a constant magnitude on a single pointMomentLoad, a rotational moment acting with a constant magnitude acting at a single pointAll loads are defined by alocationalong the element, and amagnitude.
Thelocationmust be positive, and must lie on the length of the beam,
or it will raise aValueErrorFuture goals are to add a library of standard distributed loads
(constant, ramp, etc) as well as functionality that will allow a distributed
load function to be the input.femethods.loads.PointLoadThePointLoadclass describes a standard point load. A normal load acting at
a single point with a constant value. It is defined with a location and a
magnitude.>>>PointLoad(-10,5)PointLoad(magnitude=-10,location=5)Thelocationmust be a positive value, and less than or equal to the length
of the beam, otherwise it raise aValueError.femethods.loads.MomentLoadAMomentLoadclass describes a standard moment load. A moment acting at a
single point with a constant value. It is defined with a location and a value.>>>MomentLoad(2,5)MomentLoad(magnitude=2,location=5)Thelocationmust be a positive value, and less than or equal to the length
of the beam, otherwise it raise aValueError.femethods.reactionsThere are two different reactions that can be used to support an element.FixedReactiondoes not allow vertical or rotational displacementPinnedReactiondoes not allow vertical displacement but does allow rotational displacementAll reactions have two properties, aforceand amoment. They represent
the numerical value for the resistive force or moment acting on the element
to support the load(s). These properties are set toNonewhen the reaction
is instantiated (ie, they are unknown). They are calculated and set when
analyzing a element. Note that themomentproperty of aPinnedReactionwill always beNonebecause it does not resist a moment.Thevalueproperty is a read-only combination of theforceandmomentproperties, and is in the formvalue = (force, moment)All reactions have aninvalidatemethod that will set theforceandmomentback toNone. This is useful when changing parameters and the
calculated reactions are no longer valid.femethods.reactions.FixedReactionTheFixedReactionis a reaction class that prevents both vertical and angular
(rotational displacement). It has boundary conditions ofbc = (0, 0)>>>FixedReaction(3)FixedReaction(location=3)>>>print(FixedReaction(3))FixedReactionLocation:3Force:NoneMoment:NoneThelocationmust be a positive value, and less than or equal to the length
of the beam, otherwise it raise aValueError.femethods.reactions.PinnedReactionThePinnedReactionis a reaction class that prevents vertical displacement,
but allows angular (rotational) displacement. It has boundary conditions ofbc = (0, None)>>>PinnedReaction(7)PinnedReaction(location=7)>>>print(PinnedReaction(7))PinnedReactionLocation:7Force:NoneMoment:NoneThelocationmust be a positive value, and less than or equal to the length
of the beam, otherwise it raise aValueError.femethods.elements.BeamDefines a beam as a finite element. This class will handle the bulk of the
analysis, populating properties (such as meshing and values for the reactions).To create aBeamobject, write the following:b=Beam(length,loads,reactions,E=1,Ixx=1)Where the loads and reactions are a list ofloadsandreactionsrespectively.NoteLoads and reactions must be a list, even when there is only one.TheEandIxxparameters are Young's modulus and the polar moment of
inertia about the bending axis. They both default to1.ExamplesThis section contains several different examples of how to use the beam
element, and their results.For all examples, the following have been imported:fromfemethods.elementsimportBeamfromfemethods.reactionsimportFixedReaction,PinnedReactionfromfemethods.loadsimportPointLoad,MomentLoadExample 1: Cantilevered Beam with Fixed Support and End Loadingbeam_len=10# Note that both the reaction and load are both lists. They must always be# given to Beam as a list,r=[FixedReaction(0)]# define reactions as listp=[PointLoad(magnitude=-2,location=beam_len)]# define loads as listb=Beam(beam_len,loads=p,reactions=r,E=29e6,Ixx=125)# an explicit solve is required to calculate the reaction valuesb.solve()print(b)The output of the program isPARAMETERS
Length (length): 10
Young's Modulus (E): 29000000.0
Area moment of inertia (Ixx): 125
LOADING
Type: point load
    Location: 10
   Magnitude: -2

REACTIONS
Type: fixed
    Location: 0
       Force: 2.0
      Moment: 20.0Example 2: Cantilevered Beam with 3 Pinned Supports and End Loadingbeam_len=10# Note that both the reaction and load are both lists. They must always be# given to Beam as a list,r=[PinnedReaction(0),PinnedReaction(2),PinnedReaction(6)]# define reactionsp=[PointLoad(magnitude=-2,location=beam_len)]# define loadsb=Beam(beam_len,loads=p,reactions=r,E=29e6,Ixx=125)# an explicit solve is required to calculate the reaction valuesb.solve()print(b)The output of the program isPARAMETERS
Length (length): 10
Young's Modulus (E): 29000000.0
Area moment of inertia (Ixx): 125
LOADING
Type: point load
    Location: 10
   Magnitude: -2

REACTIONS
Type: pinned
    Location: 0
       Force: 1.3333333333333346
      Moment: 0.0
Type: pinned
    Location: 2
       Force: -4.000000000000004
      Moment: 0.0
Type: pinned
    Location: 6
       Force: 4.666666666666671
      Moment: 0.0TODOAdd a more thorough documentation for all the features, limitations and FE fundamentals for each sectionAdd additional element types, such as the bar elementAcknowledgementsDerivation of stiffness matrix for a beamby Nasser M. AbbasiAn idiot’s guide to Python documentation with Sphinx and ReadTheDocsbySam Nichollsfor
a very helpful guide on how to get sphinx set up