Package: pibeam
Contents:IntroductionAbout ModuleProgram MotivationInstallationDocumentationTable of all classes and argumentsBeamMethods in Beam classLoadPoint LoadUniformly Distributed Load(UDL)Uniformly Varying Load(UVL)ReactionPoint MomentHingeExamplesIntroductionA beam is a structural element that primarily resists loads applied laterally to the beam's axis (an element designed to carry primarily axial load would be a strut or column). Its mode of deflection is primarily by bending. The loads applied to the beam result in reaction forces at the beam's support points. The total effect of all the forces acting on the beam is to produce shear forces and bending moments within the beams, that in turn induce internal stresses, strains and deflections of the beam.Source:WikipediaAbout the moduleModule Version: 0.0.1This module is aimed to solve Statically Determinate, Geometrically Stable two dimensional Beam just by using 3 equations of static equilibrium.
$F_x = 0, F_y = 0 \text{ and } M_{point} = 0$.This version of module supports:determinate 2D beam with Point Loads, Uniformly Distributed Loads, Uniformly Varying Loads, Point MomentsFixed or Hinged or Roller types of support conditionsA Beam with Internal HingeBending Moment Diagram and Shear Force DiagramProgram MotivationI studied about Beams first time in my second semester which had an included course ofApplied Mechanics - I (Statics). About 10-15 marks question were sure from beams and frames in board examination. But, while practicing beam analysis questions, from past question collection, one thing that collection was lacking was solution to those questions. Not even reaction values were given. So, it would cost us 15 minutes for even simple reaction calculation error. So, I thought of making this library from that period. And, I turned this thought into action in my 3rd semester's vacation.InstallationTO be updated after completing uvl and graph portion and uploading to pypiDocumentationVersion:  0.0.1List of all classes and argumentsclassrequired argumentsoptional argumentsBeamlength: floatE: float, I:floatLoadpos: float, load: floatinverted:bool=FalsePointLoadpos: float, load: floatinverted:bool = False, inclination:float=90UDLstart: float, loadpm: float, span: floatinverted:bool = TrueUVLstart: float, startload: float, span: float, endload: floatinverted: bool = TrueReactionpos: float, type: str, pos_sym: strnonePointMomentpos: float, mom: floatccw: bool = TrueHingepos: floatside: str = 'l'Beam:Beamis the main class to represent a beam object and perform various calculations.Argumentslength(float): length of a beamHere are few optional keyword argumentsE(float)= Modulus of Elasticity of beam materialI(float)= 2nd moment of area of the cross section of beamMethodsS.NMethodArgumentsDescription1.fast_solveloads_listPass list (or tuple) of all load, moment, reaction and hinge elements present in beam. $\$ This method will: $\$ 1. Calculate Reactions $\$ 2. Generate Shear and Bending Moment Equation2.generate_graphwhich:str = 'both'By default this generate will both Bending Moment Diagram(BMD) and Shear Force Diagram (SFD) stacked vertically. $\$ To obtain seperate graphs change default valuewhich = 'both'to'sfd'or'bmd'3.add_loadsload_listPass list of force generating objects. This will add the net loads in x and y direction.$\$ Possible loads are(PointLoad, Reaction, UDL, UVL)4.add_momentsmomgen_list$\$optional:about=0Pass in list of moment generating objects like(PointLoad,Reaction, UDL, UVL, PointMoment)$\$ By default this function takes moment about origin. $\$If you want to take moment about any other point, use Optional argumentaboutand pass any x-coordinate value.5.add_hingehinge, mom_gensThis method must be used iff there is hinge object in beam. A hinge object and list(or tuple) of moment generating objects are expected arguments6.calculate_reactionsreaction_listPass in list(or tuple) of unknown reactions object to solve and assign reaction values7.generate_shear_equationloadsPass in list(or tuple) of load generators to generate shear equation8.generate_moment_equationloadsPass in list(or tuple) of load generators to generate moment equationNoteJust first and second methods are sufficient to solve beam and generate graph. But, to keep track of ongoing process use other methods.Remember not to usefast_solveand other methods(excluding method no. 2). Doing this will re-add all those loads you've passed again.Example# to create a beam of length 5m:
b = Beam(5)LoadArguments:pos(float): position of that netload with respect to beam coordinates's originload(float): net load of that load type(for point load that is point load value,
but it will be different
for other loads like uvl and udl)inverted(bool)=False: Default direction of positive net load is in positive direction of y-axesby default:inverted = False(Positive Load)useinverted=True(indicates negative Load)PointLoadDescriptionSubclass of classLoadArgumentspos, load, inverted: inherit from super classLoadinclination(float)=90:unit=degreerepresents angle made by direction of net load with positive direction of beam's x axisinclination will be positive for counter clockwise directionput negative inclination if you want to take angle in clockwise directionAttributesload_x: component of net load value in positive direciton of beam's x-axisload_y: component of net load value in positive y-direciton(upward direction)UDLUDL(Uniformly Distributed Load) is type of load that is combinaiton of infinite points load over certain length acting transverse to beamArguments:start(float):Start position of UDLloadpm(float): Load Per meter of udlspan(float): Total length of udlinverted(bool) = True: UDL facing downwards on beamuseinverted=Falsefor upside udlAttributesnetload(float): total effective load of udlpos(float): position of effective load from - beam originUVLIt is that load whose magnitude varies along the loading length with a constant rate.
Uniformly varying load is further divided into two types:1. Triangular Load
2. Trapezoidal LoadArgumentsstart:float= Start position of uvl from beam's origin along x-axis of beam coordinate systemstartload:float=unit: kN/m= Starting load/m value of uvlspan:float= Total length of uvl objectendload:float= Ending load/m value of uvl objectinverted:bool= True: Default=TrueInverts the uvl objectAttributesend= End coordinate of uvl objecttload= Net load value of upper triangular part of trapezoidal or triangular loadrload= Net load value of lower rectangular part of trapezoidal load itselfnetload= Net load of whole uvl object itself.netload = tload + rloadnetpos= Net position(coordinates) where net load of uvl actsReactionReactions are given by supports. 3 types of supports are defined for now:hinge,rollerandfixedsupport.Argumentspos(float): position of reactiontype(str): any one of('roller','hinge','fixed')or('r','h','f')Representing support condition at that point.pos_sym(str): Symbolic variable to represent support location nameAttributesrx_val, ry_val, mom_val: variables to store numerical values for reaction loads and momentsrx_var, ry_var, mom_var: symbolic variables to store symbolic values for reactionsPointMomentPure moment that act at pointArgumentspos: location of that point moment from beam's originmom: value of that point momentccw(bool) = False: counterclockwise direciton is positive value of moment,by defalut:ccw = Falseand given moment is positiveHingeInternal hinges are provided in a structure to reduce statical indeterminacy of the structure.
Bending moment at internal hinge is always zero.
Internal hinge makes structure more flexible.
It allows structure to move which reduces the reactive stresses.Argumentspos:float= Position of that internal hinge from origin of beam coordinate systemside:str = 'l': Accepted Values =('r', 'right', 'l', 'left')Default Value ='l'This side specifies which side of loads to take in order to take moment of that loads about hinge.ExamplesExample-1: Solving Simplest BeamThe simplest possible code to solve simply supported beam with pointload at middle of span.# create a beam of length 5m
b = Beam(5)

# create reaction and pointload objects
ra = Reaction(0, 'r', 'A')
rb = Reaction(b.length, 'h', 'B')
p = PointLoad(b.length/2, 10, inverted=True)

b.fast_solve((ra, rb, p))
b.generate_graph()Graph:Example-2: Cantilever beam with udl# create a beam of length 5m
b = Beam(5)

# create reaction and udl object
ra = Reaction(0, 'f', 'A')
udl = UDL(0, 5, 5)

b.fast_solve((ra, udl))
b.generate_graph()Graph: