K ipvdZddlmZmZmZmZddlmZddlm Z ddl m Z m Z ddl mZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZmZmZddlm Z ddl!m"Z"ddl#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2Z2ddgiZ3e)dddgiZ4GddZ5Gd d!e5Z6y)"zd This module can be used to solve 2D beam bending problems with singularity functions in mechanics. )SSymboldiffsymbols)Add)Expr) DerivativeFunction)Mul)Eq)sympify)linsolve)dsolve)solve)sstr)SingularityFunction Piecewise factorial) integrate)limit)plotPlotGrid)GeometryEntity) import_module)Interval)lambdify)doctest_depends_on)iterableN)z Beam.drawzBeam.plot_bending_momentzBeam.plot_deflectionzBeam.plot_ild_momentzBeam.plot_ild_shearzBeam.plot_shear_forcezBeam.plot_shear_stresszBeam.plot_slope matplotlibnumpyfromlistarange) import_kwargsceZdZdZededdedfdZdZedZed Z ed Z ed Z ed Z ed Z edZedZedZej"dZedZej"dZedZej"dZedZej"dZedZej"dZedZej"dZedZedZej"dZedZej"d Zed!Zej"d"Zed#Zej"d$ZdMd%ZdMd&Zd'Zd(Zd)Z dNd+Z!dNd,Z"d-Z#ed.Z$ed/Z%d0Z&d1Z'd2Z(d3Z)d4Z*d5Z+d6Z,d7Z-d8Z.d9Z/dNd:Z0dNd;Z1dNd<Z2dNd=Z3dNd>Z4dNd?Z5d@Z6dAZ7dNdBZ8dCZ9dNdDZ:dEZ;dNdFZ<e=dGHdOdIZ>dJZ?dKZ@dLZAy*)PBeamax A Beam is a structural element that is capable of withstanding load primarily by resisting against bending. Beams are characterized by their cross sectional profile(Second moment of area), their length and their material. .. note:: A consistent sign convention must be used while solving a beam bending problem; the results will automatically follow the chosen sign convention. However, the chosen sign convention must respect the rule that, on the positive side of beam's axis (in respect to current section), a loading force giving positive shear yields a negative moment, as below (the curved arrow shows the positive moment and rotation): .. image:: allowed-sign-conventions.png Examples ======== There is a beam of length 4 meters. A constant distributed load of 6 N/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. The deflection of the beam at the end is restricted. Using the sign convention of downwards forces being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols, Piecewise >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(4, E, I) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(6, 2, 0) >>> b.apply_load(R2, 4, -1) >>> b.bc_deflection = [(0, 0), (4, 0)] >>> b.boundary_conditions {'bending_moment': [], 'deflection': [(0, 0), (4, 0)], 'shear_force': [], 'slope': []} >>> b.load R1*SingularityFunction(x, 0, -1) + R2*SingularityFunction(x, 4, -1) + 6*SingularityFunction(x, 2, 0) >>> b.solve_for_reaction_loads(R1, R2) >>> b.load -3*SingularityFunction(x, 0, -1) + 6*SingularityFunction(x, 2, 0) - 9*SingularityFunction(x, 4, -1) >>> b.shear_force() 3*SingularityFunction(x, 0, 0) - 6*SingularityFunction(x, 2, 1) + 9*SingularityFunction(x, 4, 0) >>> b.bending_moment() 3*SingularityFunction(x, 0, 1) - 3*SingularityFunction(x, 2, 2) + 9*SingularityFunction(x, 4, 1) >>> b.slope() (-3*SingularityFunction(x, 0, 2)/2 + SingularityFunction(x, 2, 3) - 9*SingularityFunction(x, 4, 2)/2 + 7)/(E*I) >>> b.deflection() (7*x - SingularityFunction(x, 0, 3)/2 + SingularityFunction(x, 2, 4)/4 - 3*SingularityFunction(x, 4, 3)/2)/(E*I) >>> b.deflection().rewrite(Piecewise) (7*x - Piecewise((x**3, x >= 0), (0, True))/2 - 3*Piecewise(((x - 4)**3, x >= 4), (0, True))/2 + Piecewise(((x - 2)**4, x >= 2), (0, True))/4)/(E*I) Calculate the support reactions for a fully symbolic beam of length L. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. The deflection of the beam at the end is restricted. The beam is loaded with: * a downward point load P1 applied at L/4 * an upward point load P2 applied at L/8 * a counterclockwise moment M1 applied at L/2 * a clockwise moment M2 applied at 3*L/4 * a distributed constant load q1, applied downward, starting from L/2 up to 3*L/4 * a distributed constant load q2, applied upward, starting from 3*L/4 up to L No assumptions are needed for symbolic loads. However, defining a positive length will help the algorithm to compute the solution. >>> E, I = symbols('E, I') >>> L = symbols("L", positive=True) >>> P1, P2, M1, M2, q1, q2 = symbols("P1, P2, M1, M2, q1, q2") >>> R1, R2 = symbols('R1, R2') >>> b = Beam(L, E, I) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, L, -1) >>> b.apply_load(P1, L/4, -1) >>> b.apply_load(-P2, L/8, -1) >>> b.apply_load(M1, L/2, -2) >>> b.apply_load(-M2, 3*L/4, -2) >>> b.apply_load(q1, L/2, 0, 3*L/4) >>> b.apply_load(-q2, 3*L/4, 0, L) >>> b.bc_deflection = [(0, 0), (L, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> print(b.reaction_loads[R1]) (-3*L**2*q1 + L**2*q2 - 24*L*P1 + 28*L*P2 - 32*M1 + 32*M2)/(32*L) >>> print(b.reaction_loads[R2]) (-5*L**2*q1 + 7*L**2*q2 - 8*L*P1 + 4*L*P2 + 32*M1 - 32*M2)/(32*L) AxCac||_||_t|tr||_nd|_||_||_||_||_ggggd|_ d|_ ||_ g|_ g|_ g|_g|_g|_g|_g|_i|_i|_d|_d|_d|_d|_y)aInitializes the class. Parameters ========== length : Sympifyable A Symbol or value representing the Beam's length. elastic_modulus : Sympifyable A SymPy expression representing the Beam's Modulus of Elasticity. It is a measure of the stiffness of the Beam material. It can also be a continuous function of position along the beam. second_moment : Sympifyable or Geometry object Describes the cross-section of the beam via a SymPy expression representing the Beam's second moment of area. It is a geometrical property of an area which reflects how its points are distributed with respect to its neutral axis. It can also be a continuous function of position along the beam. Alternatively ``second_moment`` can be a shape object such as a ``Polygon`` from the geometry module representing the shape of the cross-section of the beam. In such cases, it is assumed that the x-axis of the shape object is aligned with the bending axis of the beam. The second moment of area will be computed from the shape object internally. area : Symbol/float Represents the cross-section area of beam variable : Symbol, optional A Symbol object that will be used as the variable along the beam while representing the load, shear, moment, slope and deflection curve. By default, it is set to ``Symbol('x')``. base_char : String, optional A String that will be used as base character to generate sequential symbols for integration constants in cases where boundary conditions are not sufficient to solve them. ild_variable : Symbol, optional A Symbol object that will be used as the variable specifying the location of the moving load in ILD calculations. By default, it is set to ``Symbol('a')``. N) deflectionslopebending_moment shear_forcerF)lengthelastic_modulus isinstancer cross_section second_momentvariable ild_variable _base_char_boundary_conditions_loadarea_applied_supports_applied_rotation_hinges_applied_sliding_hinges_rotation_hinge_symbols_sliding_hinge_symbols_support_as_loads_applied_loads_reaction_loads_ild_reactions _ild_shear _ild_moment_original_load _joined_beam)selfr/r0r3r9r4 base_charr5s l/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/physics/continuum_mechanics/beam.py__init__z Beam.__init__sX . m^ 4!.D !%D !.D   (#35VXik$l!  !#(*%')$')$&(#!# !  !c|jr |jn |j}djt|jt|j t|}|S)NzBeam({}, {}, {}))_cross_section_second_momentformatr_length_elastic_modulus)rGshape_descriptionstr_sols rI__str__z Beam.__str__sR373F3FD//DL_L_$++D,>TEZEZ@[]abs]turKc|jS)z- Returns the reaction forces in a dictionary.)rArGs rIreaction_loadszBeam.reaction_loadss###rKc|jS)z Returns the value for the rotation jumps in rotation hinges in a dictionary. The rotation jump is the rotation (in radian) in a rotation hinge. This can be seen as a jump in the slope plot. )_rotation_jumpsrVs rIrotation_jumpszBeam.rotation_jumpss###rKc|jS)z Returns the deflection jumps in sliding hinges in a dictionary. The deflection jump is the deflection (in meters) in a sliding hinge. This can be seen as a jump in the deflection plot. )_deflection_jumpsrVs rIdeflection_jumpszBeam.deflection_jumpss%%%rKc|jS)z# Returns the I.L.D. shear equation.)rCrVs rI ild_shearzBeam.ild_shearsrKc|jS)z4 Returns the I.L.D. reaction forces in a dictionary.)rBrVs rI ild_reactionszBeam.ild_reactions"""rKc|jS)z Returns the I.L.D. rotation jumps in rotation hinges in a dictionary. The rotation jump is the rotation (in radian) in a rotation hinge. This can be seen as a jump in the slope plot. )_ild_rotations_jumpsrVs rIild_rotation_jumpszBeam.ild_rotation_jumpss(((rKc|jS)z Returns the I.L.D. deflection jumps in sliding hinges in a dictionary. The deflection jump is the deflection (in meters) in a sliding hinge. This can be seen as a jump in the deflection plot. )_ild_deflection_jumpsrVs rIild_deflection_jumpszBeam.ild_deflection_jumpss)))rKc|jS)z$ Returns the I.L.D. moment equation.)rDrVs rI ild_momentzBeam.ild_moment srKc|jS)zLength of the Beam.)rPrVs rIr/z Beam.lengths||rKc$t||_yN)r rP)rGls rIr/z Beam.lengths qz rKc|jSz"Cross-sectional area of the Beam. _arearVs rIr9z Beam.areazzrKc$t||_yrmr rrrGr)s rIr9z Beam.area QZ rKc|jS)a A symbol that can be used as a variable along the length of the beam while representing load distribution, shear force curve, bending moment, slope curve and the deflection curve. By default, it is set to ``Symbol('x')``, but this property is mutable. Examples ======== >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I, A = symbols('E, I, A') >>> x, y, z = symbols('x, y, z') >>> b = Beam(4, E, I) >>> b.variable x >>> b.variable = y >>> b.variable y >>> b = Beam(4, E, I, A, z) >>> b.variable z ) _variablerVs rIr4z Beam.variable#s2~~rKcHt|tr||_ytd)Nz'The variable should be a Symbol object.)r1rry TypeError)rGvs rIr4z Beam.variable>s a DNIJ JrKc|jSzYoung's Modulus of the Beam. )rQrVs rIr0zBeam.elastic_modulusEs$$$rKc$t||_yrm)r rQrGes rIr0zBeam.elastic_modulusJs ' rKc|jSz#Second moment of area of the Beam. rNrVs rIr3zBeam.second_momentNrbrKchd|_t|tr tdt ||_y)Nz>To update cross-section geometry use `cross_section` attribute)rMr1r ValueErrorr rN)rGis rIr3zBeam.second_momentSs," a (]^ ^")!*D rKc|jS)zCross-section of the beam)rMrVs rIr2zBeam.cross_section[rbrKcF|r|jd|_||_y)Nr)second_moment_of_arearNrM)rGss rIr2zBeam.cross_section`s# "#"9"9";A">D rKc|jS)a, Returns a dictionary of boundary conditions applied on the beam. The dictionary has three keywords namely moment, slope and deflection. The value of each keyword is a list of tuple, where each tuple contains location and value of a boundary condition in the format (location, value). Examples ======== There is a beam of length 4 meters. The bending moment at 0 should be 4 and at 4 it should be 0. The slope of the beam should be 1 at 0. The deflection should be 2 at 0. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(4, E, I) >>> b.bc_deflection = [(0, 2)] >>> b.bc_slope = [(0, 1)] >>> b.boundary_conditions {'bending_moment': [], 'deflection': [(0, 2)], 'shear_force': [], 'slope': [(0, 1)]} Here the deflection of the beam should be ``2`` at ``0``. Similarly, the slope of the beam should be ``1`` at ``0``. r7rVs rIboundary_conditionszBeam.boundary_conditionsfs6(((rKc |jdSNr.rrVs rIbc_shear_forcezBeam.bc_shear_forces((77rKc"||jd<yrr)rGsf_bcss rIrzBeam.bc_shear_forces39!!-0rKc |jdSNr-rrVs rIbc_bending_momentzBeam.bc_bending_moments(()9::rKc"||jd<yrr)rGbm_bcss rIrzBeam.bc_bending_moments6<!!"23rKc |jdSNr,rrVs rIbc_slopez Beam.bc_slopes((11rKc"||jd<yrr)rGs_bcss rIrz Beam.bc_slopes-2!!'*rKc |jdSNr+rrVs rI bc_deflectionzBeam.bc_deflections((66rKc"||jd<yrr)rGd_bcss rIrzBeam.bc_deflections27!!,/rKc|j}|j}|j|jz}|j|jk7r td|j|jk7r5t |j||jkf|j||kf}n |j}|dk(rt ||||}d|_|S|dk(r2t ||||}d|_|j|j|Sy)a This method joins two beams to make a new composite beam system. Passed Beam class instance is attached to the right end of calling object. This method can be used to form beams having Discontinuous values of Elastic modulus or Second moment. Parameters ========== beam : Beam class object The Beam object which would be connected to the right of calling object. via : String States the way two Beam object would get connected - For axially fixed Beams, via="fixed" - For Beams connected via rotation hinge, via="hinge" Examples ======== There is a cantilever beam of length 4 meters. For first 2 meters its moment of inertia is `1.5*I` and `I` for the other end. A pointload of magnitude 4 N is applied from the top at its free end. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b1 = Beam(2, E, 1.5*I) >>> b2 = Beam(2, E, I) >>> b = b1.join(b2, "fixed") >>> b.apply_load(20, 4, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 0, -2) >>> b.bc_slope = [(0, 0)] >>> b.bc_deflection = [(0, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.load 80*SingularityFunction(x, 0, -2) - 20*SingularityFunction(x, 0, -1) + 20*SingularityFunction(x, 4, -1) >>> b.slope() (-((-80*SingularityFunction(x, 0, 1) + 10*SingularityFunction(x, 0, 2) - 10*SingularityFunction(x, 4, 2))/I + 120/I)/E + 80.0/(E*I))*SingularityFunction(x, 2, 0) - 0.666666666666667*(-80*SingularityFunction(x, 0, 1) + 10*SingularityFunction(x, 0, 2) - 10*SingularityFunction(x, 4, 2))*SingularityFunction(x, 0, 0)/(E*I) + 0.666666666666667*(-80*SingularityFunction(x, 0, 1) + 10*SingularityFunction(x, 0, 2) - 10*SingularityFunction(x, 4, 2))*SingularityFunction(x, 2, 0)/(E*I) z@Joining beams with different Elastic modulus is not implemented.fixedThingeN) r4r0r/NotImplementedErrorr3rr%rFapply_rotation_hinge)rGbeamviar'E new_lengthnew_second_momentnew_beams rIjoinz Beam.joinsV MM  [[4;;.   4#7#7 7%&hi i   !3!3 3 )4+=+=q$++~*N%)%7%7J$G!I !% 2 2  '>J+J+>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(20, E, I) >>> p0, m0 = b.apply_support(0, 'fixed') >>> p1 = b.apply_support(20, 'roller') >>> b.apply_load(-8, 10, -1) >>> b.apply_load(100, 20, -2) >>> b.solve_for_reaction_loads(p0, m0, p1) >>> b.reaction_loads {M_0: 20, R_0: -2, R_20: 10} >>> b.reaction_loads[p0] -2 >>> b.load 20*SingularityFunction(x, 0, -2) - 2*SingularityFunction(x, 0, -1) - 8*SingularityFunction(x, 10, -1) + 100*SingularityFunction(x, 20, -2) + 10*SingularityFunction(x, 20, -1) pinrollerR_rM_N) r r:appendrstr apply_loadrrr?rGloctype reaction_loadreaction_moments rI apply_supportzBeam.apply_supports/fcl %%sDk2 $ $"4C=1M OOM3 3    % %sAh /"4C=1M$T#c(]3O OOM3 3 OOOS" 5    % %sAh / MM #q *  " " ) )?CT*J K %%}c2t&DE $ $  /1 1rKc|j}t|ts|Stt |j D]8}||j |dj dks&|j |dcSy)z_ Helper function that returns the Second moment (I) at a location in the beam. rN)r3r1rrangelenargs)rGrIrs rI_get_Iz Beam._get_I/sk   !Y'H3qvv;' (!&&)A,++A..66!9Q<' (rKc\t|}|j}|j|}tdt |z}|j j ||jj ||j||z|z|d|jj |df|S)a This method applies a rotation hinge at a single location on the beam. Parameters ---------- loc : Sympifyable Location of point at which hinge is applied. Returns ======= Symbol The unknown rotation jump multiplied by the elastic modulus and second moment as a symbol. Examples ======== There is a beam of length 15 meters. Pin supports are placed at distances of 0 and 10 meters. There is a fixed support at the end. There are two rotation hinges in the structure, one at 5 meters and one at 10 meters. A pointload of magnitude 10 kN is applied on the hinge at 5 meters. A distributed load of 5 kN works on the structure from 10 meters to the end. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import Symbol >>> E = Symbol('E') >>> I = Symbol('I') >>> b = Beam(15, E, I) >>> r0 = b.apply_support(0, type='pin') >>> r10 = b.apply_support(10, type='pin') >>> r15, m15 = b.apply_support(15, type='fixed') >>> p5 = b.apply_rotation_hinge(5) >>> p12 = b.apply_rotation_hinge(12) >>> b.apply_load(-10, 5, -1) >>> b.apply_load(-5, 10, 0, 15) >>> b.solve_for_reaction_loads(r0, r10, r15, m15) >>> b.reaction_loads {M_15: -75/2, R_0: 0, R_10: 40, R_15: -5} >>> b.rotation_jumps {P_12: -1875/(16*E*I), P_5: 9625/(24*E*I)} >>> b.rotation_jumps[p12] -1875/(16*E*I) >>> b.bending_moment() -9625*SingularityFunction(x, 5, -1)/24 + 10*SingularityFunction(x, 5, 1) - 40*SingularityFunction(x, 10, 1) + 5*SingularityFunction(x, 10, 2)/2 + 1875*SingularityFunction(x, 12, -1)/16 + 75*SingularityFunction(x, 15, 0)/2 + 5*SingularityFunction(x, 15, 1) - 5*SingularityFunction(x, 15, 2)/2 P_r) r r0rrrr;rr=rr)rGrrr rotation_jumps rIrzBeam.apply_rotation_hinge;sdcl   KK tCH}-  %%,,S1 $$++M: A -sB7 %%sAh/rKc\t|}|j}|j|}tdt |z}|j j ||jj ||j||z|z|d|jj |df|S)a[ This method applies a sliding hinge at a single location on the beam. Parameters ---------- loc : Sympifyable Location of point at which hinge is applied. Returns ======= Symbol The unknown deflection jump multiplied by the elastic modulus and second moment as a symbol. Examples ======== There is a beam of length 13 meters. A fixed support is placed at the beginning. There is a pin support at the end. There is a sliding hinge at a location of 8 meters. A pointload of magnitude 10 kN is applied on the hinge at 5 meters. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> b = Beam(13, 20, 20) >>> r0, m0 = b.apply_support(0, type="fixed") >>> s8 = b.apply_sliding_hinge(8) >>> r13 = b.apply_support(13, type="pin") >>> b.apply_load(-10, 5, -1) >>> b.solve_for_reaction_loads(r0, m0, r13) >>> b.reaction_loads {M_0: -50, R_0: 10, R_13: 0} >>> b.deflection_jumps {W_8: 85/24} >>> b.deflection_jumps[s8] 85/24 >>> b.bending_moment() 50*SingularityFunction(x, 0, 0) - 10*SingularityFunction(x, 0, 1) + 10*SingularityFunction(x, 5, 1) - 4250*SingularityFunction(x, 8, -2)/3 >>> b.deflection() -SingularityFunction(x, 0, 2)/16 + SingularityFunction(x, 0, 3)/240 - SingularityFunction(x, 5, 3)/240 + 85*SingularityFunction(x, 8, 0)/24 W_r) r r0rrrr<rr>rr)rGrrrdeflection_jumps rIapply_sliding_hingezBeam.apply_sliding_hingexsVcl   KK  C1 $$++C0 ##**?; A/b9 ""C8,rKNc\|j}t|}t|}t|}|jj||||f|xj|t |||zz c_|xj |t |||zz c_|r|j|||||dyy)a This method adds up the loads given to a particular beam object. Parameters ========== value : Sympifyable The value inserted should have the units [Force/(Distance**(n+1)] where n is the order of applied load. Units for applied loads: - For moments, unit = kN*m - For point loads, unit = kN - For constant distributed load, unit = kN/m - For ramp loads, unit = kN/m/m - For parabolic ramp loads, unit = kN/m/m/m - ... so on. start : Sympifyable The starting point of the applied load. For point moments and point forces this is the location of application. order : Integer The order of the applied load. - For moments, order = -2 - For point loads, order =-1 - For constant distributed load, order = 0 - For ramp loads, order = 1 - For parabolic ramp loads, order = 2 - ... so on. end : Sympifyable, optional An optional argument that can be used if the load has an end point within the length of the beam. Examples ======== There is a beam of length 4 meters. A moment of magnitude 3 Nm is applied in the clockwise direction at the starting point of the beam. A point load of magnitude 4 N is applied from the top of the beam at 2 meters from the starting point and a parabolic ramp load of magnitude 2 N/m is applied below the beam starting from 2 meters to 3 meters away from the starting point of the beam. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(4, E, I) >>> b.apply_load(-3, 0, -2) >>> b.apply_load(4, 2, -1) >>> b.apply_load(-2, 2, 2, end=3) >>> b.load -3*SingularityFunction(x, 0, -2) + 4*SingularityFunction(x, 2, -1) - 2*SingularityFunction(x, 2, 2) + 2*SingularityFunction(x, 3, 0) + 4*SingularityFunction(x, 3, 1) + 2*SingularityFunction(x, 3, 2) applyrN)r4r r@rr8rrE _handle_end)rGvaluestartorderendr's rIrzBeam.apply_loadsn MM ""E5%#=> e/5%@@@  u%8E5%III    QueSw  G rKc|j}t|}t|}t|}||||f|jvrf|xj|t |||zzc_|xj |t |||zzc_|jj ||||fn d}t||r|j|||||dyy)a This method removes a particular load present on the beam object. Returns a ValueError if the load passed as an argument is not present on the beam. Parameters ========== value : Sympifyable The magnitude of an applied load. start : Sympifyable The starting point of the applied load. For point moments and point forces this is the location of application. order : Integer The order of the applied load. - For moments, order= -2 - For point loads, order=-1 - For constant distributed load, order=0 - For ramp loads, order=1 - For parabolic ramp loads, order=2 - ... so on. end : Sympifyable, optional An optional argument that can be used if the load has an end point within the length of the beam. Examples ======== There is a beam of length 4 meters. A moment of magnitude 3 Nm is applied in the clockwise direction at the starting point of the beam. A pointload of magnitude 4 N is applied from the top of the beam at 2 meters from the starting point and a parabolic ramp load of magnitude 2 N/m is applied below the beam starting from 2 meters to 3 meters away from the starting point of the beam. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(4, E, I) >>> b.apply_load(-3, 0, -2) >>> b.apply_load(4, 2, -1) >>> b.apply_load(-2, 2, 2, end=3) >>> b.load -3*SingularityFunction(x, 0, -2) + 4*SingularityFunction(x, 2, -1) - 2*SingularityFunction(x, 2, 2) + 2*SingularityFunction(x, 3, 0) + 4*SingularityFunction(x, 3, 1) + 2*SingularityFunction(x, 3, 2) >>> b.remove_load(-2, 2, 2, end = 3) >>> b.load -3*SingularityFunction(x, 0, -2) + 4*SingularityFunction(x, 2, -1) z4No such load distribution exists on the beam object.removerN) r4r r@r8rrErrr)rGrrrrr'msgs rI remove_loadzBeam.remove_loads^ MM 5% %)<)< < JJ% 3Aue DD DJ   5)|jr d}t||||zz}|dk(rtd|dzD]} |xj|j || j |||z t ||| zt| z zc_|xj|j || j |||z t ||| zt| z zc_y|dk(rtd|dzD]} |xj|j || j |||z t ||| zt| z z c_|xj|j || j |||z t ||| zt| z z c_yy)z This functions handles the optional `end` value in the `apply_load` and `remove_load` functions. When the value of end is not NULL, this function will be executed. zpIf 'end' is provided the 'order' of the load cannot be negative, i.e. 'end' is only valid for distributed loads.rrrrN) is_negativerrr8rsubsrrrE) rGr'rrrrrrfrs rIrzBeam._handle_end2s   CS/ ! !U(N 7?1eai( M qvva|00C%K@ 3AsA > ??H| LM ##q! (9(9!S5[(I 3AsA >)??H|)LM# M X 1eai( M qvva|00C%K@ 3AsA > ??H| LM ##q! (9(9!S5[(I 3AsA >)??H|)LM# MrKc|jS)a Returns a Singularity Function expression which represents the load distribution curve of the Beam object. Examples ======== There is a beam of length 4 meters. A moment of magnitude 3 Nm is applied in the clockwise direction at the starting point of the beam. A point load of magnitude 4 N is applied from the top of the beam at 2 meters from the starting point and a parabolic ramp load of magnitude 2 N/m is applied below the beam starting from 3 meters away from the starting point of the beam. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(4, E, I) >>> b.apply_load(-3, 0, -2) >>> b.apply_load(4, 2, -1) >>> b.apply_load(-2, 3, 2) >>> b.load -3*SingularityFunction(x, 0, -2) + 4*SingularityFunction(x, 2, -1) - 2*SingularityFunction(x, 3, 2) )r8rVs rIloadz Beam.loadRs2zzrKc|jS)a Returns a list of all loads applied on the beam object. Each load in the list is a tuple of form (value, start, order, end). Examples ======== There is a beam of length 4 meters. A moment of magnitude 3 Nm is applied in the clockwise direction at the starting point of the beam. A pointload of magnitude 4 N is applied from the top of the beam at 2 meters from the starting point. Another pointload of magnitude 5 N is applied at same position. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(4, E, I) >>> b.apply_load(-3, 0, -2) >>> b.apply_load(4, 2, -1) >>> b.apply_load(5, 2, -1) >>> b.load -3*SingularityFunction(x, 0, -2) + 9*SingularityFunction(x, 2, -1) >>> b.applied_loads [(-3, 0, -2, None), (4, 2, -1, None), (5, 2, -1, None)] )r@rVs rI applied_loadszBeam.applied_loadsms4"""rKc||j}|j}td}td}t|j}t|j }t |j||}t |j||} g} g} g} g} |jdD]U\}}|jj|||z }td|jD}| j|W|jdD]U\}}|jj|||z }td|jD}| j|Wt|j||z}|jdD]+\}}|j|||z }| j|-t|||z}|jdD]+\}}|j|||z }| j|-tt!|| g| z| z| z| z||f|z|z|zjd }d t#|z}|t#|z}|d |}|||}||d }t%t'|||_t%t'|||_t%t'|||_|j.j|j(|_|j.j|j*|_|j.j|j,|_y ) a Solves for the reaction forces. Examples ======== There is a beam of length 30 meters. A moment of magnitude 120 Nm is applied in the clockwise direction at the end of the beam. A pointload of magnitude 8 N is applied from the top of the beam at the starting point. There are two simple supports below the beam. One at the end and another one at a distance of 10 meters from the start. The deflection is restricted at both the supports. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(30, E, I) >>> b.apply_load(-8, 0, -1) >>> b.apply_load(R1, 10, -1) # Reaction force at x = 10 >>> b.apply_load(R2, 30, -1) # Reaction force at x = 30 >>> b.apply_load(120, 30, -2) >>> b.bc_deflection = [(10, 0), (30, 0)] >>> b.load R1*SingularityFunction(x, 10, -1) + R2*SingularityFunction(x, 30, -1) - 8*SingularityFunction(x, 0, -1) + 120*SingularityFunction(x, 30, -2) >>> b.solve_for_reaction_loads(R1, R2) >>> b.reaction_loads {R1: 6, R2: 2} >>> b.load -8*SingularityFunction(x, 0, -1) + 6*SingularityFunction(x, 10, -1) + 120*SingularityFunction(x, 30, -2) + 2*SingularityFunction(x, 30, -1) C3C4r.c3ZK|]#}td|jDr |%yw)c34K|]}|jywrm is_infinite.0nums rI z:Beam.solve_for_reaction_loads....$b#..rrNrrs rIrz0Beam.solve_for_reaction_loads..rrr,r+rN)r4r/rtupler=r>rr.r-r7rsumrrrlistrrdictziprArYr\r8)rG reactionsr'rnrrrZr] shear_curve moment_curveshear_force_eqsbending_moment_eqs slope_eqsdeflection_eqspositionreqsnew_eqs slope_curvedeflection_curvesolutionreaction_indexrotation_indexreaction_solutionrotation_solutiondeflection_solutions rIsolve_for_reaction_loadszBeam.solve_for_reaction_loadss3J MM KK D\ D\t;;< !CbbbG  " "7 + , $889IJ /OHe%%',,Q9EACbbbG  % %g . /   3 3 5q9B> #88A "OHe""1h/%7C   S ! "%[!4r9#88F 'OHe"''84u)'#n*==$Q~6$^NC&~7#C 3D$EF#C8I$JK!%c*:>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(30, E, I) >>> b.apply_load(-8, 0, -1) >>> b.apply_load(R1, 10, -1) >>> b.apply_load(R2, 30, -1) >>> b.apply_load(120, 30, -2) >>> b.bc_deflection = [(10, 0), (30, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.shear_force() 8*SingularityFunction(x, 0, 0) - 6*SingularityFunction(x, 10, 0) - 120*SingularityFunction(x, 30, -1) - 2*SingularityFunction(x, 30, 0) )r4rrrGr's rIr.zBeam.shear_forces!> MM$))Q'''rKc |j}|j}|j}g}|D]?}t|tr|jd}|j |jdAt t|}|jg}g}t|D])\}} | dk(r ttd|||dz kf|jjt|| kftddf} t| |} g} | D],} | j t|j!|| .| j#||dz | g| tt%||||dz dtt%||| dgz } t'| }|j ||j | | j)|,t t/t|}t'|}||j)|} | |fS#t*$rt%||||dz d}t%||| d}|j!|||dz | zdz ||zdz k(r2||k7r-|j#||g|j#||dz | gn2|j ||j t-||dz | Y"wxYw zJReturns maximum Shear force and its coordinate in the Beam object.rrrnanT+-r)r.r4rr1r rrsetsort enumeraterfloatr8rewriterabsrextendrmaxindexrrmap)rGrr'terms singularityterm intervals shear_valuesrr shear_slopepointsvalpoint max_shear initial_shear final_shear maximum_shears rImax_shear_forcezBeam.max_shear_forces&&( MM    -D$$yy}   tyy| , -3{+,   k* DDAqAv D'uq+ac:J7J(KTZZM_M_`iMjlmnoloLpsxy~sBFsGH {A.#@EJJs;#3#3Au#=>?@ {1Q3/34E+q+ac2BCHI3uU`bcefhkOlKmnnH ##I.   )( D8C\23 L) ,,,];<}%%' D %k1k!A#6F L #KAs; ##A AaC(81(%BC Ds0DH  B6KKcN|j}t|j|S)a. Returns a Singularity Function expression which represents the bending moment curve of the Beam object. Examples ======== There is a beam of length 30 meters. A moment of magnitude 120 Nm is applied in the clockwise direction at the end of the beam. A pointload of magnitude 8 N is applied from the top of the beam at the starting point. There are two simple supports below the beam. One at the end and another one at a distance of 10 meters from the start. The deflection is restricted at both the supports. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(30, E, I) >>> b.apply_load(-8, 0, -1) >>> b.apply_load(R1, 10, -1) >>> b.apply_load(R2, 30, -1) >>> b.apply_load(120, 30, -2) >>> b.bc_deflection = [(10, 0), (30, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.bending_moment() 8*SingularityFunction(x, 0, 1) - 6*SingularityFunction(x, 10, 1) - 120*SingularityFunction(x, 30, 0) - 2*SingularityFunction(x, 30, 1) )r4rr.rs rIr-zBeam.bending_moment4s#> MM))+Q//rKc |j}|j}|j}g}|D]?}t|tr|jd}|j |jdAt t|}|jg}g}t|D]-\}} | dk(r ttd|||dz kf|jjt|| kftddf} t| |} g} | D],} | j t|j!|| .| j#||dz | g| tt%||||dz dtt%||| dgz } t'| }|j ||j | | j)|0t t/t|}t'|}||j)|} | |fS#t*$rt%||||dz d}t%||| d}|j!|||dz | zdz ||zdz k(r2||k7r-|j#||g|j#||dz | gn2|j ||j t-||dz | Y&wxYwr)r-r4rr1r rrrrrrrr.rrrrrrr r!rrr")rG bending_curver'r#r$r%r& moment_valuesrr moment_sloper)r*r+ max_momentinitial_moment final_momentmaximum_moments rI max_bmomentzBeam.max_bmomentVs++- MM""  -D$$yy}   tyy| , -3{+,   k* DDAqAv D(5\1 AE(:#:;%%'// :AEB5\4( * |Q/#BEJJs=#5#5a#?@AB {1Q3/34E-K!4DcJKSQVWdfgijloQpMqrr X $$Z0   *(=!>?! D@Sm45 ]+---n=>~&&' D!&}aQqS9I3!O$]Aq#>  %%a+ac*:Q*>)AB~XdGdfgFgglzKmK!((.,)GH$$k!A#&6%:;!((6$$Xk!A#.>%BC Ds0D HB6K K ctd|jjD}tt d|j dkf||j |j kft ddf} t|jt|j tj}|S#t$r}dt|vr tdd}~wwxYw) a Returns a Set of point(s) with zero bending moment and where bending moment curve of the beam object changes its sign from negative to positive or vice versa. Examples ======== There is is 10 meter long overhanging beam. There are two simple supports below the beam. One at the start and another one at a distance of 6 meters from the start. Point loads of magnitude 10KN and 20KN are applied at 2 meters and 4 meters from start respectively. A Uniformly distribute load of magnitude of magnitude 3KN/m is also applied on top starting from 6 meters away from starting point till end. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> b = Beam(10, E, I) >>> b.apply_load(-4, 0, -1) >>> b.apply_load(-46, 6, -1) >>> b.apply_load(10, 2, -1) >>> b.apply_load(20, 4, -1) >>> b.apply_load(3, 6, 0) >>> b.point_cflexure() [10/3] c3`K|]&}|jdjddkr#|(yw)rrrN)rrs rIrz&Beam.point_cflexure..s1)s#[^[c[cde[f[k[klm[nqr[r#)ss$..rrTdomainz"An expression is already zero whenzXThis method cannot be used when a whole region of the bending moment line is equal to 0.N) rr-rrrr4r/rrrRealsrr)rGnon_singular_bending_momentrr)rs rIpoint_cflexurezBeam.point_cflexures@'*)s9L9L9N9S9S)s&s#!%, q0@!A,dmmDKK.GHut$&  <// :DMM"#''+F # 3s1v=)+STT  s59B00 C9CCc T|j}|j}|j}|jdst |j |St |tr|jr|j}d}d}d}tt|D]}|dk7r||dz djd}tj |z t|j||dz |||fz} |t|dz k7r>||| zt!||dz|| zt!|||djddzz z }n||| zt!||dzz }| j#|||djd}|St%d} ttj||zz |jz| | z} g} |jdD]+\} }| j#|| |z }| j'|-t)t+| | }| j#| |ddi} | S)aD Returns a Singularity Function expression which represents the slope the elastic curve of the Beam object. Examples ======== There is a beam of length 30 meters. A moment of magnitude 120 Nm is applied in the clockwise direction at the end of the beam. A pointload of magnitude 8 N is applied from the top of the beam at the starting point. There are two simple supports below the beam. One at the end and another one at a distance of 10 meters from the start. The deflection is restricted at both the supports. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(30, E, I) >>> b.apply_load(-8, 0, -1) >>> b.apply_load(R1, 10, -1) >>> b.apply_load(R2, 30, -1) >>> b.apply_load(120, 30, -2) >>> b.bc_deflection = [(10, 0), (30, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.slope() (-4*SingularityFunction(x, 0, 2) + 3*SingularityFunction(x, 10, 2) + 120*SingularityFunction(x, 30, 1) + SingularityFunction(x, 30, 2) + 4000/3)/(E*I) r,rrr)r4r0r3r7rr+r1rrFrrrrOnerr-rrrrrr)rGr'rrrr, prev_slopeprev_endr slope_valuerr bc_eqsrrr constantss rIr,z Beam.slopesI@ MM     ((1)1- - a #(9(966DEJH3t9% E6#AaCy|003H uufQhy1D1D1FtAwqz1QTUW_abSc'dd D A %j;68KAxYZ8[[#k13Fq$q'RS*//Z[J\^_3``aaEj;68KAxYZ8[[[E(--aa1CD  EL D\ !T-@-@-B!BAFFK #88A OHe""1h/%7C MM#  &"-. !&&IaLO'<= rKc | |j}|j}|j}|jds|jdst |t rY|j rL|j}d}d}d}d}tt|D]} | dk7r|| dz djd}tj |z t|j|| dz |||fz} || z} t| |||f} | t|dz k7r>||| zt||dz|| zt||| djddzz z }n||| zt||dzz }| j||| djd}| j||| djd}!|S|j } t#| dz}tj||zz tt|j| |z|d|zz|dzS|jds7|j } t#| dz}t|j%||zS|jdsT|jdrDt |t rY|j rL|j}d}d}d}d}tt|D]} | dk7r|| dz djd}tj |z t|j|| dz |||fz} || z} t| |||f} | t|dz k7r>||| zt||dz|| zt||| djddzz z }n||| zt||dzz }| j||| djd}| j||| djd}!|S|j } t#| dz\}}t|j| |z}t|||z}g}|jdD]+\}}|j|||z }|j'|-t)t+|||f}|j||dd||ddi}tj||zz |zSt |t rX|j rK|j}d}d}d}d}tt|D]} | dk7r|| dz djd}tj|z t|j|| dz |||fz} || z} t| |||f} | t|dz k7r>||| zt||dz|| zt||| djddzz z }n||| zt||dzz }| j||| djd}| j||| djd} |St-d}t|j%||z}g}|jdD]+\}}|j|||z }|j'|-t)t+||}|j||ddi}|S)aW Returns a Singularity Function expression which represents the elastic curve or deflection of the Beam object. Examples ======== There is a beam of length 30 meters. A moment of magnitude 120 Nm is applied in the clockwise direction at the end of the beam. A pointload of magnitude 8 N is applied from the top of the beam at the starting point. There are two simple supports below the beam. One at the end and another one at a distance of 10 meters from the start. The deflection is restricted at both the supports. Using the sign convention of upward forces and clockwise moment being positive. >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> E, I = symbols('E, I') >>> R1, R2 = symbols('R1, R2') >>> b = Beam(30, E, I) >>> b.apply_load(-8, 0, -1) >>> b.apply_load(R1, 10, -1) >>> b.apply_load(R2, 30, -1) >>> b.apply_load(120, 30, -2) >>> b.bc_deflection = [(10, 0), (30, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.deflection() (4000*x/3 - 4*SingularityFunction(x, 0, 3)/3 + SingularityFunction(x, 10, 3) + 60*SingularityFunction(x, 30, 2) + SingularityFunction(x, 30, 3)/3 - 12000)/(E*I) r+r,rrz3:54r)r4r0r3r7r1rrFrrrrrCrr-rrr6rr,rrrr)rGr'rrrrDprev_defrEr+rrFrecent_segment_slopedeflection_valuerHrHconstantrrr r rGrrrs rIr+zBeam.deflections~@ MM     ((6t?X?XY`?a!Y'D,=,=vv  s4y) LAAv#'!9Q<#4#4Q#7#$55&(9T5H5H5J4PQ7ST:5UXY[cefWg+h"hK+5 +C('01E8UVGW'X$CIM)"x2B'BDWXY[cefDg&g'*::>CK(a82= F#'#<#<\#J #%&++Ax85@ c" #Xfr2h78I/44b)A,q/2yYZ|\]5_` 55!A#;// / a #(9(966DJHHJ3t9% H6#AaCy|003HeeAgi0C0C0Ed1gaj0PSTV^`aRb&cc '1K'?$#,-AAxQRCS#T D A %8.>#>@STUW_ab@c"c#&668KAtTUwWXz_`Oacd8ee#ffJ8.>#>@STUW_ab@c"ccJ(--aa1CD +00DGAJOOA4FG H  D\$TZZ\15:#88F OHe"''84uO O3sK01 { q +&G;,,W56@ @ Ps%#Dc<|j|jz S)zg Returns an expression representing the Shear Stress curve of the Beam object. r.rrrVs rI shear_stresszBeam.shear_stresss !$**,,rKc|j}|j}|j}|i}|jtD]}||k7s ||vst d|z||vr||}t |j||d|fddddS)a Returns a plot of shear stress present in the beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters and area of cross section 2 square meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6), 2) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.plot_shear_stress() Plot object containing: [0]: cartesian line: 6875*SingularityFunction(x, 0, 0) - 2500*SingularityFunction(x, 2, 0) - 5000*SingularityFunction(x, 4, 1) + 15625*SingularityFunction(x, 8, 0) + 5000*SingularityFunction(x, 8, 1) for x over (0.0, 8.0) zvalue of %s was not passed.rz Shear Stress $\mathrm{x}$z$\tau$rtitlexlabelylabel line_color)rUr4r/atomsrrrr)rGrrUr'r/syms rIplot_shear_stresszBeam.plot_shear_stresssZ((* MM <D%%f- ECaxCtO !>!CDD E T>&\F\&&t,q!Vn_Y rKcP|j}|i}|jtD]$}||jk(r||vst d|z|j |vr||j }n |j }t |j||jd|fddddS)a Returns a plot for Shear force present in the Beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6)) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.plot_shear_force() Plot object containing: [0]: cartesian line: 13750*SingularityFunction(x, 0, 0) - 5000*SingularityFunction(x, 2, 0) - 10000*SingularityFunction(x, 4, 1) + 31250*SingularityFunction(x, 8, 0) + 10000*SingularityFunction(x, 8, 1) for x over (0.0, 8.0) Value of %s was not passed.r Shear ForcerW $\mathrm{V}$grYr.r^rr4rr/rr)rGrr.r_r/s rIplot_shear_forcezBeam.plot_shear_forcesV&&( <D$$V, ECdmm#$ !>!CDD  E ;;$ $++&F[[FK$$T*T]]Av,Fm&3P PrKcP|j}|i}|jtD]$}||jk(r||vst d|z|j |vr||j }n |j }t |j||jd|fddddS)a Returns a plot for Bending moment present in the Beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6)) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.plot_bending_moment() Plot object containing: [0]: cartesian line: 13750*SingularityFunction(x, 0, 1) - 5000*SingularityFunction(x, 2, 1) - 5000*SingularityFunction(x, 4, 2) + 31250*SingularityFunction(x, 8, 1) + 5000*SingularityFunction(x, 8, 2) for x over (0.0, 8.0) rbrBending MomentrW $\mathrm{M}$brYr-r^rr4rr/rr)rGrr-r_r/s rIplot_bending_momentzBeam.plot_bending_momentsV,,. <D!''/ ECdmm#$ !>!CDD  E ;;$ $++&F[[FN''- q&/IQa&3P PrKcP|j}|i}|jtD]$}||jk(r||vst d|z|j |vr||j }n |j }t |j||jd|fddddS)a  Returns a plot for slope of deflection curve of the Beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6)) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.plot_slope() Plot object containing: [0]: cartesian line: -8.59375e-5*SingularityFunction(x, 0, 2) + 3.125e-5*SingularityFunction(x, 2, 2) + 2.08333333333333e-5*SingularityFunction(x, 4, 3) - 0.0001953125*SingularityFunction(x, 8, 2) - 2.08333333333333e-5*SingularityFunction(x, 8, 3) + 0.00138541666666667 for x over (0.0, 8.0) rbrSloperW$\theta$mrYr,r^rr4rr/rr)rGrr,r_r/s rI plot_slopezBeam.plot_slopeRsV  <D;;v& ECdmm#$ !>!CDD  E ;;$ $++&F[[FEJJt$t}}a&@&{sL LrKcP|j}|i}|jtD]$}||jk(r||vst d|z|j |vr||j }n |j }t |j||jd|fddddS)a0 Returns a plot for deflection curve of the Beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6)) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> b.plot_deflection() Plot object containing: [0]: cartesian line: 0.00138541666666667*x - 2.86458333333333e-5*SingularityFunction(x, 0, 3) + 1.04166666666667e-5*SingularityFunction(x, 2, 3) + 5.20833333333333e-6*SingularityFunction(x, 4, 4) - 6.51041666666667e-5*SingularityFunction(x, 8, 3) - 5.20833333333333e-6*SingularityFunction(x, 8, 4) for x over (0.0, 8.0) rbr DeflectionrW$\delta$rXrYr+r^rr4rr/rr)rGrr+r_r/s rIplot_deflectionzBeam.plot_deflectionsX__& <D##F+ ECdmm#$ !>!CDD  E ;;$ $++&F[[FJOOD)DMM1f+E&{"$ $rKc |j}|j}|i}|jjtD]$}||jk(r||vst d|z||vr||}t |jj||d|fddddd}t |jj||d|fd dd d d}t |jj||d|fd dd dd}t |jj||d|fddddd}tdd||||S)a Returns a subplot of Shear Force, Bending Moment, Slope and Deflection of the Beam object. Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 8 meters. A constant distributed load of 10 KN/m is applied from half of the beam till the end. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. A pointload of magnitude 5 KN is also applied from top of the beam, at a distance of 4 meters from the starting point. Take E = 200 GPa and I = 400*(10**-6) meter**4. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> R1, R2 = symbols('R1, R2') >>> b = Beam(8, 200*(10**9), 400*(10**-6)) >>> b.apply_load(5000, 2, -1) >>> b.apply_load(R1, 0, -1) >>> b.apply_load(R2, 8, -1) >>> b.apply_load(10000, 4, 0, end=8) >>> b.bc_deflection = [(0, 0), (8, 0)] >>> b.solve_for_reaction_loads(R1, R2) >>> axes = b.plot_loading_results() rbrrcrWrdreFrZr[r\r]showrirjrkrorprqrurvrXr) r/r4r+r^rrrr.rr-r,r) rGrr/r4r_ax1ax2ax3ax4s rIplot_loading_resultszBeam.plot_loading_resultssiR== <D??$**62 ECdmm#$ !>!CDD  E T>&\F4##%**408Q2G&!/4&&(--d3h65J)//!/4::<$$T*Xq&,A !/4??$))$/(Av1F%ok!/1c3S11rKc|j}|j}|j|t||dzz}t || }t ||}||fS)z Helper function for I.L.D. It takes the unsubstituted copy of the load equation and uses it to calculate shear force and bending moment equations. r)r4r5r8rr)rGrr'r)rr.r-s rI_solve_for_ild_equationszBeam._solve_for_ild_equations s[ MM   zzE$71b$AAA q)) ";2N**rKc f|j|\}}|j}|j}|j}t |j }t |j } td} td} t||||t|ddt||dz zz } t|||||t|ddzt|ddz t||dzzz } g}g}g}g}|jdD]{\}}|jj|||z }td|jD}|t| | dt| ddz z}||z }|j|}|jdD]\}}|j!j|||z }td|jD}||t|ddzt|ddz t||dzz}||z }|j|t#||| z}|jd D]U\}}|j|||z |t| dd|t| ddzzd zzd z z}|j|Wt#||| z}|jd D]U\}}|j|||z |t| dd|t| ddzzd zzd z z}|j|Wt%t'| | g|z|z|z|z| | f|z|z| zjd}d t)|z}|t)|z}|d |}|||} ||d}!t+t-|||_t+t-|| |_t+t-| |!|_y)ar Determines the Influence Line Diagram equations for reaction forces under the effect of a moving load. Parameters ========== value : Integer Magnitude of moving load reactions : The reaction forces applied on the beam. Warning ======= This method creates equations that can give incorrect results when substituting a = 0 or a = l, with l the length of the beam. Examples ======== There is a beam of length 10 meters. There are two simple supports below the beam, one at the starting point and another at the ending point of the beam. Calculate the I.L.D. equations for reaction forces under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_10 = symbols('R_0, R_10') >>> b = Beam(10, E, I) >>> p0 = b.apply_support(0, 'pin') >>> p10 = b.apply_support(10, 'roller') >>> b.solve_for_ild_reactions(1,R_0,R_10) >>> b.ild_reactions {R_0: -SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/10 - SingularityFunction(a, 10, 1)/10, R_10: -SingularityFunction(a, 0, 1)/10 + SingularityFunction(a, 10, 0) + SingularityFunction(a, 10, 1)/10} rrrrr.c3ZK|]#}td|jDr |%yw)c34K|]}|jywrmrrs rIrz9Beam.solve_for_ild_reactions...`DiY\S__DirNrrs rIrz/Beam.solve_for_ild_reactions..`$!j#Di`c`h`hDiAi#!jrr-c3ZK|]#}td|jDr |%yw)c34K|]}|jywrmrrs rIrz9Beam.solve_for_ild_reactions...grrNrrs rIrz/Beam.solve_for_ild_reactions..grrr,rr+N)rr4r/r5rr=r>rrrr7r.rrrrr-rrrrrrrBrdrg)"rGrrr.r-r'rnr)rZr]rrrrrrrrrr*reqs_without_inf shear_sinceqs_with_shear_sinc moment_sinceqs_with_moment_sincr r r r r rrrs" rIsolve_for_ild_reactionszBeam.solve_for_ild_reactionss\'+&C&CE&J# ^ MM KK   t;;< !   " "#6 7  8"667GH UXY>YYC  ! !# & '; "="ORd"dgp"p$2#357Hy4H>4Y\l4lnnrnrtuwxS^+'#n*==$Q~6$^NC&~7"3y2C#DE$(^=N)O$P!%)#.>@S*T%U"rKc l|js td|j}g}|i}|jD]A}|j|jtD]}||k7s ||vstd|zC|j jtD]}||k7s ||vstd|z|jD][}|j t|j|j||d|j j|fd||dd]tt|dg|S) a Plots the Influence Line Diagram of Reaction Forces under the effect of a moving load. This function should be called after calling solve_for_ild_reactions(). Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Warning ======= The values for a = 0 and a = l, with l the length of the beam, in the plot can be incorrect. Examples ======== There is a beam of length 10 meters. A point load of magnitude 5KN is also applied from top of the beam, at a distance of 4 meters from the starting point. There are two simple supports below the beam, located at the starting point and at a distance of 7 meters from the starting point. Plot the I.L.D. equations for reactions at both support points under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_7 = symbols('R_0, R_7') >>> b = Beam(10, E, I) >>> p0 = b.apply_support(0, 'roller') >>> p7 = b.apply_support(7, 'roller') >>> b.apply_load(5,4,-1) >>> b.solve_for_ild_reactions(1,R_0,R_7) >>> b.ild_reactions {R_0: -SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/7 - 3*SingularityFunction(a, 10, 0)/7 - SingularityFunction(a, 10, 1)/7 - 15/7, R_7: -SingularityFunction(a, 0, 1)/7 + 10*SingularityFunction(a, 10, 0)/7 + SingularityFunction(a, 10, 1)/7 - 20/7} >>> b.plot_ild_reactions() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: -SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/7 - 3*SingularityFunction(a, 10, 0)/7 - SingularityFunction(a, 10, 1)/7 - 15/7 for a over (0.0, 10.0) Plot[1]:Plot object containing: [0]: cartesian line: -SingularityFunction(a, 0, 1)/7 + 10*SingularityFunction(a, 10, 0)/7 + SingularityFunction(a, 10, 1)/7 - 20/7 for a over (0.0, 10.0) ztI.L.D. reaction equations not found. Please use solve_for_ild_reactions() to generate the I.L.D. reaction equations.rbrzI.L.D. for ReactionsblueFrzr) rBrr5r^rrPrrrrr)rGrr)ildplotsreactionr_s rIplot_ild_reactionszBeam.plot_ild_reactionss\x""TU U    <D++ IH**84::6B I!84$%BC%GHH I I <<%%f- ECaxCtO !>!CDD E++ GH OOD!4!4X!>!C!CD!I 4<<$$T* +3IX&uF G G H q4844rKc|j}|j}|j}|j|\}}|t |||z } t |||t |||z |z } |D]@} | j | |j | } | j | |j | } B| | | z t||dzz |t| ddzz |t||dzz} | |_y)a Determines the Influence Line Diagram equations for shear at a specified point under the effect of a moving load. Parameters ========== distance : Integer Distance of the point from the start of the beam for which equations are to be determined value : Integer Magnitude of moving load reactions : The reaction forces applied on the beam. Warning ======= This method creates equations that can give incorrect results when substituting a = 0 or a = l, with l the length of the beam. Examples ======== There is a beam of length 12 meters. There are two simple supports below the beam, one at the starting point and another at a distance of 8 meters. Calculate the I.L.D. equations for Shear at a distance of 4 meters under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_8 = symbols('R_0, R_8') >>> b = Beam(12, E, I) >>> p0 = b.apply_support(0, 'roller') >>> p8 = b.apply_support(8, 'roller') >>> b.solve_for_ild_reactions(1, R_0, R_8) >>> b.solve_for_ild_shear(4, 1, R_0, R_8) >>> b.ild_shear -(-SingularityFunction(a, 0, 0) + SingularityFunction(a, 12, 0) + 2)*SingularityFunction(a, 4, 0) - SingularityFunction(-a, 0, 0) - SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/8 + SingularityFunction(a, 12, 0)/2 - SingularityFunction(a, 12, 1)/8 + 1 rN) r4r/r5rrrrBrrC) rGdistancerrr'rnr)r._ shear_curve1 shear_curve2rshear_eqs rIsolve_for_ild_shearzBeam.solve_for_ild_shearsh MM KK   66u= Qu[!X>> k1a05a3RRV[[ ! UH',,Xd6I6I(6STL',,Xd6I6I(6STL U!L<$?CVWXZbdeCf#ff11"a;;<>CFYZ[]^`aFb>bc#rKc |js td|j}|j}|i}|jj t D]}||k7s ||vstd|z|jj t D]}||k7s ||vstd|zt |jj||d|fddddd S) a Plots the Influence Line Diagram for Shear under the effect of a moving load. This function should be called after calling solve_for_ild_shear(). Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Warning ======= The values for a = 0 and a = l, with l the length of the beam, in the plot can be incorrect. Examples ======== There is a beam of length 12 meters. There are two simple supports below the beam, one at the starting point and another at a distance of 8 meters. Plot the I.L.D. for Shear at a distance of 4 meters under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_8 = symbols('R_0, R_8') >>> b = Beam(12, E, I) >>> p0 = b.apply_support(0, 'roller') >>> p8 = b.apply_support(8, 'roller') >>> b.solve_for_ild_reactions(1, R_0, R_8) >>> b.solve_for_ild_shear(4, 1, R_0, R_8) >>> b.ild_shear -(-SingularityFunction(a, 0, 0) + SingularityFunction(a, 12, 0) + 2)*SingularityFunction(a, 4, 0) - SingularityFunction(-a, 0, 0) - SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/8 + SingularityFunction(a, 12, 0)/2 - SingularityFunction(a, 12, 1)/8 + 1 >>> b.plot_ild_shear() Plot object containing: [0]: cartesian line: -(-SingularityFunction(a, 0, 0) + SingularityFunction(a, 12, 0) + 2)*SingularityFunction(a, 4, 0) - SingularityFunction(-a, 0, 0) - SingularityFunction(a, 0, 0) + SingularityFunction(a, 0, 1)/8 + SingularityFunction(a, 12, 0)/2 - SingularityFunction(a, 12, 1)/8 + 1 for a over (0.0, 12.0) ziI.L.D. shear equation not found. Please use solve_for_ild_shear() to generate the I.L.D. shear equations.rbrzI.L.D. for Shear $\mathrm{a}$rdrTrz)rCrrPr5r^rrr)rGrrnr)r_s rIplot_ild_shearzBeam.plot_ild_shearsnIJ J LL    <D??((0 ECaxCtO !>!CDD E<<%%f- ECaxCtO !>!CDD EDOO((.Aq BT%o&VZ\ \rKcH|j}|j}|j}|j|\}}||t |ddzt |ddz t ||dzzt |||z } t |||t |||z ||t |ddzt |ddz t ||dzzz } |D]@} | j | |j| } | j | |j| } B| | | z t ||dzz } | |_y)a Determines the Influence Line Diagram equations for moment at a specified point under the effect of a moving load. Parameters ========== distance : Integer Distance of the point from the start of the beam for which equations are to be determined value : Integer Magnitude of moving load reactions : The reaction forces applied on the beam. Warning ======= This method creates equations that can give incorrect results when substituting a = 0 or a = l, with l the length of the beam. Examples ======== There is a beam of length 12 meters. There are two simple supports below the beam, one at the starting point and another at a distance of 8 meters. Calculate the I.L.D. equations for Moment at a distance of 4 meters under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_8 = symbols('R_0, R_8') >>> b = Beam(12, E, I) >>> p0 = b.apply_support(0, 'roller') >>> p8 = b.apply_support(8, 'roller') >>> b.solve_for_ild_reactions(1, R_0, R_8) >>> b.solve_for_ild_moment(4, 1, R_0, R_8) >>> b.ild_moment -(4*SingularityFunction(a, 0, 0) - SingularityFunction(a, 0, 1) + SingularityFunction(a, 4, 1))*SingularityFunction(a, 4, 0) - SingularityFunction(a, 0, 1)/2 + SingularityFunction(a, 4, 1) - 2*SingularityFunction(a, 12, 0) - SingularityFunction(a, 12, 1)/2 rrN) r4r/r5rrrrrBrD) rGrrrr'rnr)rmoment moment_curve1 moment_curve2r moment_eqs rIsolve_for_ild_momentzBeam.solve_for_ild_momentjsbh MM KK   11%8 6x*=aA*FFI\]^`acdIee!4Q!!D EFHMfVWYaHbc vq!,U61h-GG A(;Aq!(D$DGZ[\^_abGc$c&9!Q&B%CDD " XH)..x9L9LX9VWM)..x9L9LX9VWM X"]]%BFYZ[]eghFi$ii $rKc |js td|j}|i}|jjtD]}||k7s ||vstd|z|j jtD]}||k7s ||vstd|zt |jj||d|j fddddd S) a Plots the Influence Line Diagram for Moment under the effect of a moving load. This function should be called after calling solve_for_ild_moment(). Parameters ========== subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Warning ======= The values for a = 0 and a = l, with l the length of the beam, in the plot can be incorrect. Examples ======== There is a beam of length 12 meters. There are two simple supports below the beam, one at the starting point and another at a distance of 8 meters. Plot the I.L.D. for Moment at a distance of 4 meters under the effect of a moving load of magnitude 1kN. Using the sign convention of downwards forces being positive. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy import symbols >>> from sympy.physics.continuum_mechanics.beam import Beam >>> E, I = symbols('E, I') >>> R_0, R_8 = symbols('R_0, R_8') >>> b = Beam(12, E, I) >>> p0 = b.apply_support(0, 'roller') >>> p8 = b.apply_support(8, 'roller') >>> b.solve_for_ild_reactions(1, R_0, R_8) >>> b.solve_for_ild_moment(4, 1, R_0, R_8) >>> b.ild_moment -(4*SingularityFunction(a, 0, 0) - SingularityFunction(a, 0, 1) + SingularityFunction(a, 4, 1))*SingularityFunction(a, 4, 0) - SingularityFunction(a, 0, 1)/2 + SingularityFunction(a, 4, 1) - 2*SingularityFunction(a, 12, 0) - SingularityFunction(a, 12, 1)/2 >>> b.plot_ild_moment() Plot object containing: [0]: cartesian line: -(4*SingularityFunction(a, 0, 0) - SingularityFunction(a, 0, 1) + SingularityFunction(a, 4, 1))*SingularityFunction(a, 4, 0) - SingularityFunction(a, 0, 1)/2 + SingularityFunction(a, 4, 1) - 2*SingularityFunction(a, 12, 0) - SingularityFunction(a, 12, 1)/2 for a over (0.0, 12.0) zlI.L.D. moment equation not found. Please use solve_for_ild_moment() to generate the I.L.D. moment equations.rbrzI.L.D. for MomentrrjrTrz)rDrr5r^rrPrr)rGrr)r_s rIplot_ild_momentzBeam.plot_ild_momentsnLM M    <D##))&1 ECaxCtO !>!CDD E<<%%f- ECaxCtO !>!CDD ED$$))$/!Q 1EM`%o&W[] ]rK)r )modulescts tdtt|jt|j z }|st d|Dr td|j}t|jtrZt|jjt}tj|d}|jj!|}ni}|j}|dz }g}|j#d||dd|j%|||\}} } } } |j'||\} }||z }| | z } |j(D]1}||jz }t+||z}| |g|dz ggd d d d gz } 3|j,D]1}||jz }t+||z}| |g|dz ggd dd d gz } 3| d|zf}| r{t/t/| dt/d|D}t1t1| dt1d|D}||dks||dkDrt3||z dz}||z ||zf}t5|| z|| z|d|f| ||zf||| |d| dd }|S)a$ Returns a plot object representing the beam diagram of the beam. In particular, the diagram might include: * the beam. * vertical black arrows represent point loads and support reaction forces (the latter if they have been added with the ``apply_load`` method). * circular arrows represent moments. * shaded areas represent distributed loads. * the support, if ``apply_support`` has been executed. * if a composite beam has been created with the ``join`` method and a hinge has been specified, it will be shown with a white disc. The diagram shows positive loads on the upper side of the beam, and negative loads on the lower side. If two or more distributed loads acts along the same direction over the same region, the function will add them up together. .. note:: The user must be careful while entering load values. The draw function assumes a sign convention which is used for plotting loads. Given a right handed coordinate system with XYZ coordinates, the beam's length is assumed to be along the positive X axis. The draw function recognizes positive loads(with n>-2) as loads acting along negative Y direction and positive moments acting along positive Z direction. Parameters ========== pictorial: Boolean (default=True) Setting ``pictorial=True`` would simply create a pictorial (scaled) view of the beam diagram. On the other hand, ``pictorial=False`` would create a beam diagram with the exact dimensions on the plot. Examples ======== .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam >>> from sympy import symbols >>> P1, P2, M = symbols('P1, P2, M') >>> E, I = symbols('E, I') >>> b = Beam(50, 20, 30) >>> b.apply_load(-10, 2, -1) >>> b.apply_load(15, 26, -1) >>> b.apply_load(P1, 10, -1) >>> b.apply_load(-P2, 40, -1) >>> b.apply_load(90, 5, 0, 23) >>> b.apply_load(10, 30, 1, 50) >>> b.apply_load(M, 15, -2) >>> b.apply_load(-M, 30, -2) >>> p50 = b.apply_support(50, "pin") >>> p0, m0 = b.apply_support(0, "fixed") >>> p20 = b.apply_support(20, "roller") >>> p = b.draw() # doctest: +SKIP >>> p # doctest: +ELLIPSIS,+SKIP Plot object containing: [0]: cartesian line: 25*SingularityFunction(x, 5, 0) - 25*SingularityFunction(x, 23, 0) + SingularityFunction(x, 30, 1) - 20*SingularityFunction(x, 50, 0) - SingularityFunction(x, 50, 1) + 5 for x over (0.0, 50.0) [1]: cartesian line: 5 for x over (0.0, 50.0) ... >>> p.show() # doctest: +SKIP z-To use this function numpy module is requiredc3fK|])}t|djdkDxr|ddk\+yw)rrN)r free_symbols)rrns rIrzBeam.draw..I s5"_TUC!(9(9$:Q$>#OQqTQY#O"_s/1zl`pictorial=False` requires numerical distributed loads. Instead, symbolic loads were found. Cannot continue. rrbrown)xywidthheight facecolorrorwhitermarker markersizecolor| g?y2c3,K|] }|ddywrrNrrXs rIrzBeam.draw..r +K1AdGAJ+Ky1c3,K|] }|ddywrrrs rIrzBeam.draw..s rrrrg?F) xlimylim annotationsmarkers rectanglesr]fillaxisr{)r ImportErrorrrrr?rrr4r1r/rr^rrfromkeysrr _draw_load_draw_supportsr;rr<minr rr)rG pictorialloadsr'rnr/rrrrload_eqload_eq1rsupport_markerssupport_rectanglesrratiox_posr_min_maxoffset sing_plots rIdrawz Beam.drawsTMN NS++,s43I3I/JJKs"_Y^"__#$ $ MM dkk4 (T[[&&v./A a$A[[%%a(FA[[F &V]^_7;yRXZ[7\4 Wgh.2.A.A&!.L++(( ?"00 iC$++%E%L6)E %6A:, 7#TU_fgh hG i // kC$++%E%L6)E 5'FQJIyy{!!#///rKc d tt|jt|jz }|dz }|j}g}g}g} d} g} d} t j } t j }d}d}d}|D]}|r|dj|}n|d}|ddk(rs|j|d}||d|dd |dd z }|r&|jd|df||d |zz fd d d dddx|jd||f||d zfd d d ddd|ddk(rw|j|d}||d|dd |dd z }|j|dr|j|g|dz ggddd|j|g|dz ggddd|ddk\s$|\}}}}|j|}||d|d|d|d z }|s|r|dkDrdd|z zn|dz }| |t|||zz } |rn|dk\r|||zzn |dz ||zz}td|dzD]D}| |j||j|||z t|||zt|z z} Ft| tr | j } n| f} t| Dcgc]}|j|c}} -|r|dkDrdd|z zn|dz }| t#|t|||zz } |rw|dk\rt#|||zzn |dz ||zz}td|dzD]D}| |j||j|||z t|||zt|z z} Ft| tr | j } n| f} | Dcgc]}|j|}}t| |z }"t%|dkDrt'j(||zt*j-dt/|d}t1|g|| j3t4z|}t1|g||j3t4z|}t|t*j6s|t*j9|z}t|t*j6s|t*j9|z}|||ddd}||| ||fScc}wcc}w)NrrzPlease, note that this schematic view might not be in agreement with the sign convention used by the Beam class for load-related computations, because it was not possible to determine the sign (hence, the direction) of the following loads: rrrz * Point load z located at  r|g?black)r headlength headwidthr)textrxytext arrowpropsrz * Moment z$\circlearrowright$)rrrz$\circlearrowleft$z* Distributed load z from z to gMbP? darkkhaki)r'rrrzorder)rrrr?r4rZerorrrrrrrr1rrrrwarningswarnr r"rrrrndarray ones_like)rGrr/rnrrr'rr load_args scaled_load load_args1 scaled_load1rrr warning_head warning_bodyrposilnrrrrf2rxxyy1yy2s rIrzBeam._draw_load shS++,s43I3I/JJK MM     &&66!  K 8DAw||A1gAw"},,T!W5; aRVWXRY$ZZL&&raCQWZ[\bZbQbKc|PQ`apwsx(yz&&rf RUW]^_W_Q`y|MN]^mtpu(vwaB,,T!W5; T!WdSTg$VVL))$q'2NNSEF1H:+>J`oq#rsNNSEF1H:+>J_np#qraA+/(ueS,,U3; uV[]`$aaL!27QuW q5),>q#+,N,?3,J-KKTUV<-XYKY"+s3$/$4$4 &1N !y#A!AFF1I#ABG!27QuW q CJ/B1eU/S$SSL49QJSZ50F1HQPUXDU!&q%!)!4YA(RWWQ]-?-?3;-O,?3,J.KKTUV<.XYLY",4%1%6%6 '3_ 3=>aq >H> #X7HWK 8Z | q MM,5 6 \\!U6]E 2@hsFW__Y%??@DAhsFX%5%5i%@@A"E#u}}- 5??2& &C#u}}- 5??2& &Cs#2/GWh<I@M@4##6U=n (D0&d 0D4'l0d@D B,-=@8Pt8Pt8Lt:$zA2F +gVRS5jD#LI\VF%PG]R +A,AH0 t=n3rKr%ceZdZdZedffd ZedZejdZedZ e jdZ edZ e jd Z ed Z ed Z ed Z d Zd.dZd.dZd/dZdZdZdZdZdZdZdZdZdZdZdZdZd0dZd1dZd0dZ d1d Z!d0d!Z"d1d"Z#d0d#Z$d1d$Z%d2d%Z&d0d&Z'd1d'Z(d(Z)d)Z*d*Z+d+Z,e,Z-d,Z.d-Z/xZ0S)3Beam3Da! This class handles loads applied in any direction of a 3D space along with unequal values of Second moment along different axes. .. note:: A consistent sign convention must be used while solving a beam bending problem; the results will automatically follow the chosen sign convention. This class assumes that any kind of distributed load/moment is applied through out the span of a beam. Examples ======== There is a beam of l meters long. A constant distributed load of magnitude q is applied along y-axis from start till the end of beam. A constant distributed moment of magnitude m is also applied along z-axis from start till the end of beam. Beam is fixed at both of its end. So, deflection of the beam at the both ends is restricted. >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols, simplify, collect, factor >>> l, E, G, I, A = symbols('l, E, G, I, A') >>> b = Beam3D(l, E, G, I, A) >>> x, q, m = symbols('x, q, m') >>> b.apply_load(q, 0, 0, dir="y") >>> b.apply_moment_load(m, 0, -1, dir="z") >>> b.shear_force() [0, -q*x, 0] >>> b.bending_moment() [0, 0, -m*x + q*x**2/2] >>> b.bc_slope = [(0, [0, 0, 0]), (l, [0, 0, 0])] >>> b.bc_deflection = [(0, [0, 0, 0]), (l, [0, 0, 0])] >>> b.solve_slope_deflection() >>> factor(b.slope()) [0, 0, x*(-l + x)*(-A*G*l**3*q + 2*A*G*l**2*q*x - 12*E*I*l*q - 72*E*I*m + 24*E*I*q*x)/(12*E*I*(A*G*l**2 + 12*E*I))] >>> dx, dy, dz = b.deflection() >>> dy = collect(simplify(dy), x) >>> dx == dz == 0 True >>> dy == (x*(12*E*I*l*(A*G*l**2*q - 2*A*G*l*m + 12*E*I*q) ... + x*(A*G*l*(3*l*(A*G*l**2*q - 2*A*G*l*m + 12*E*I*q) + x*(-2*A*G*l**2*q + 4*A*G*l*m - 24*E*I*q)) ... + A*G*(A*G*l**2 + 12*E*I)*(-2*l**2*q + 6*l*m - 4*m*x + q*x**2) ... - 12*E*I*q*(A*G*l**2 + 12*E*I)))/(24*A*E*G*I*(A*G*l**2 + 12*E*I))) True References ========== .. [1] https://homes.civil.aau.dk/jc/FemteSemester/Beams3D.pdf r'ct|||||||_||_gd|_gd|_i|_gd|_gd|_gd|_ d|_ y)aInitializes the class. Parameters ========== length : Sympifyable A Symbol or value representing the Beam's length. elastic_modulus : Sympifyable A SymPy expression representing the Beam's Modulus of Elasticity. It is a measure of the stiffness of the Beam material. shear_modulus : Sympifyable A SymPy expression representing the Beam's Modulus of rigidity. It is a measure of rigidity of the Beam material. second_moment : Sympifyable or list A list of two elements having SymPy expression representing the Beam's Second moment of area. First value represent Second moment across y-axis and second across z-axis. Single SymPy expression can be passed if both values are same area : Sympifyable A SymPy expression representing the Beam's cross-sectional area in a plane perpendicular to length of the Beam. variable : Symbol, optional A Symbol object that will be used as the variable along the beam while representing the load, shear, moment, slope and deflection curve. By default, it is set to ``Symbol('x')``. rrrrN) superrJ shear_modulusr9 _load_vector_moment_load_vector_torsion_moment_load_Singularity_slope _deflection_angular_deflection)rGr/r0rr3r9r4 __class__s rIrJzBeam3D.__init__W s^6 -J* %#, !!* $#$ rKc|jSr~)_shear_modulusrVs rIrzBeam3D.shear_modulus} rbrKc$t||_yrm)r rrs rIrzBeam3D.shear_modulus s%ajrKc|jSrrrVs rIr3zBeam3D.second_moment rbrKct|tr |Dcgc] }t|}}||_yt||_ycc}wrm)r1rr rN)rGrr's rIr3zBeam3D.second_moment s< a %&''A'"#D ")!*D (sAc|jSrprqrVs rIr9z Beam3D.area rsrKc$t||_yrmrurvs rIr9z Beam3D.area rwrKc|jS)zL Returns a three element list representing the load vector. )rrVs rI load_vectorzBeam3D.load_vector s    rKc|jS)zQ Returns a three element list representing moment loads on Beam. )rrVs rImoment_load_vectorzBeam3D.moment_load_vector  '''rKc|jS)a2 Returns a dictionary of boundary conditions applied on the beam. The dictionary has two keywords namely slope and deflection. The value of each keyword is a list of tuple, where each tuple contains location and value of a boundary condition in the format (location, value). Further each value is a list corresponding to slope or deflection(s) values along three axes at that location. Examples ======== There is a beam of length 4 meters. The slope at 0 should be 4 along the x-axis and 0 along others. At the other end of beam, deflection along all the three axes should be zero. >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(30, E, G, I, A, x) >>> b.bc_slope = [(0, (4, 0, 0))] >>> b.bc_deflection = [(4, [0, 0, 0])] >>> b.boundary_conditions {'bending_moment': [], 'deflection': [(4, [0, 0, 0])], 'shear_force': [], 'slope': [(0, (4, 0, 0))]} Here the deflection of the beam should be ``0`` along all the three axes at ``4``. Similarly, the slope of the beam should be ``4`` along x-axis and ``0`` along y and z axis at ``0``. rrVs rIrzBeam3D.boundary_conditions s:(((rKctt|jsd|jzSt|jS)a Returns the polar moment of area of the beam about the X axis with respect to the centroid. Examples ======== >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A = symbols('l, E, G, I, A') >>> b = Beam3D(l, E, G, I, A) >>> b.polar_moment() 2*I >>> I1 = [9, 15] >>> b = Beam3D(l, E, G, I1, A) >>> b.polar_moment() 24 r)rr3rrVs rI polar_momentzBeam3D.polar_moment s4&**+T''' '4%%&&rKc |j}t|}t|}t|}|dk(rB|dk(s|jdxx|z cc<|jdxx|t |||zz cc<y|dk(rB|dk(s|jdxx|z cc<|jdxx|t |||zz cc<y|dk(s|jdxx|z cc<|jdxx|t |||zz cc<y)a This method adds up the force load to a particular beam object. Parameters ========== value : Sympifyable The magnitude of an applied load. dir : String Axis along which load is applied. order : Integer The order of the applied load. - For point loads, order=-1 - For constant distributed load, order=0 - For ramp loads, order=1 - For parabolic ramp loads, order=2 - ... so on. r'rryrrN)r4r rrrrGrrrdirr's rIrzBeam3D.apply_load s$ MM #:B;!!!$-$  " "1 %/B1eU/S)S S % CZB;!!!$-$  " "1 %/B1eU/S)S S %B;!!!$-$  " "1 %/B1eU/S)S S %rKc z|j}t|}t|}t|}|dk(r|dk(s|jdxx|z cc<n>|t|jvr|j|xx|z cc<n||j|<|j dxx|t |||zz cc<y|dk(rB|dk(s|jdxx|z cc<|j dxx|t |||zz cc<y|dk(s|jdxx|z cc<|j dxx|t |||zz cc<y)a# This method adds up the moment loads to a particular beam object. Parameters ========== value : Sympifyable The magnitude of an applied moment. dir : String Axis along which moment is applied. order : Integer The order of the applied load. - For point moments, order=-2 - For constant distributed moment, order=-1 - For ramp moments, order=0 - For parabolic ramp moments, order=1 - ... so on. r'rrr.rrN)r4r rrrrrr/s rIapply_moment_loadzBeam3D.apply_moment_load s5$ MM #:B;((+u4+D!5!566((/58/27D((/  " "1 %/B1eU/S)S S % CZB;((+u4+  " "1 %/B1eU/S)S S %B;((+u4+  " "1 %/B1eU/S)S S %rKc|dvrFtdt|z}||j|<|jj |gdfytdt|z}tdt|z}||g|j|<|jj |gdf|j j |gdfy)Nrrrr)rrrArrrrs rIrzBeam3D.apply_support/ s $ $"4C=1M2?D  /    % %sI&6 7"4C=1M$T#c(]3O3@/2RD  /    % %sI&6 7 MM #y!1 2rKc|j}|j}|j}|Dcgc]}t||}}|Dcgc]}t||}}t dD]} |D cgc]-} || j | s|| j | s,| /} } t | dk(rJt|| ||} t|| ||} tt| | g| jd}tt| |}|j}|D] }||vs||||k7std|z|jj|ycc}wcc}wcc} w)a Solves for the reaction forces. Examples ======== There is a beam of length 30 meters. It it supported by rollers at of its end. A constant distributed load of magnitude 8 N is applied from start till its end along y-axis. Another linear load having slope equal to 9 is applied along z-axis. >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(30, E, G, I, A, x) >>> b.apply_load(8, start=0, order=0, dir="y") >>> b.apply_load(9*x, start=0, order=0, dir="z") >>> b.bc_deflection = [(0, [0, 0, 0]), (30, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="y") >>> b.apply_load(R2, start=30, order=-1, dir="y") >>> b.apply_load(R3, start=0, order=-1, dir="z") >>> b.apply_load(R4, start=30, order=-1, dir="z") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.reaction_loads {R1: -120, R2: -120, R3: -1350, R4: -2700} rrz2Ambiguous solution for %s in different directions.N)r4r/rrrhasrrrrrrrrArupdate)rGrr'rnqr shear_curvesshear moment_curvesrrXreactrrsolsol_dictrWkeys rIrzBeam3D.solve_for_reaction_loads; sm6 MM KK  " "789t $*9 9:FG5!,G Gq 2A (`1\!_-@-@-C}UVGWG[G[\]G^Q`E`5zQ QA6K q!11a8L+|!Q-Q$%Y\_%_`` a  ' ' 1 2:G`sEE)-EEc|j}|j}t|d |t|d |t|d |gS)z Returns a list of three expressions which represents the shear force curve of the Beam object along all three axes. rrr)r4rr)rGr'r7s rIr.zBeam3D.shear_forcek sL MM   1Q4%#Y!ua%8)QqTE1:MNNrKc(|jdS)zY Returns expression of Axial shear force present inside the Beam object. r)r.rVs rI axial_forcezBeam3D.axial_forcet s!!$$rKc|jd|jz |jd|jz |jd|jz gS)z Returns a list of three expressions which represents the shear stress curve of the Beam object along all three axes. rrrrTrVs rIrUzBeam3D.shear_stressz s[   "1%djj0$2B2B2DQ2G 2RTXTdTdTfghTijnjtjtTtuurKc<|j|jz S)zT Returns expression of Axial stress present inside the Beam object. )rArrrVs rI axial_stresszBeam3D.axial_stress s!$**,,rKc|j}|j}|j}t|d |t|d |dz|t|d |dz |gS)z Returns a list of three expressions which represents the bending moment curve of the Beam object along all three axes. rrr)r4rr.r)rGr'rqr9s rIr-zBeam3D.bending_moment sq MM  $ $  "1Q4%#Y!uuQx/?%C1Q4%%(*A.1 1rKc(|jdS)zX Returns expression of Torsional moment present inside the Beam object. r)r-rVs rItorsional_momentzBeam3D.torsional_moment s""$Q''rKc >|j}d}t|jD]}||j|z }t|jjt|j}t |||dkfd||dk\f}t t |ddD]E}||j||dz z}|t d|||dz kf||||kfd|||k\fz }Gt|}||j|jzz |_ y)af Solves for the angular deflection due to the torsional effects of moments being applied in the x-direction i.e. out of or into the beam. Here, a positive torque means the direction of the torque is positive i.e. out of the beam along the beam-axis. Likewise, a negative torque signifies a torque into the beam cross-section. Examples ======== >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, E, G, I, A, x) >>> b.apply_moment_load(4, 4, -2, dir='x') >>> b.apply_moment_load(4, 8, -2, dir='x') >>> b.apply_moment_load(4, 8, -2, dir='x') >>> b.solve_for_torsion() >>> b.angular_deflection().subs(x, 3) 18/(G*I) rrN) r4rrrrrrrrr,r)rGr' sum_momentsr+ pointsListtorque_diagramrintegrated_torque_diagrams rIsolve_for_torsionzBeam3D.solve_for_torsion sG. MM $../ 7E 4//6 6K 7 T ! !"'')$../ "KJqM1A#BQ:VW=HXDYZs:'+ yA 4// 1Q3@ @K iAz!A#,>(?+qR\]^R_O_A`cdfgistuivfvbwx xN y%.n$=!$=t?Q?QRVRcRcRe?e$f rKc  |j}|j}|j}|j}|j}t |t r |d|d}}n|x}}|j}|j} |j} td} td} t||zt| ||z|| dz} tt| d| |jd}td}td}t t!|j#|d|j#||g||jd}|j#||d||di}|j%|}||j&d<||j(d<td}t||zt| ||z|t+| d ||zz| dz}tt|djd}t t!|j#|d|j#||g||jd}|j#||d||di}||zt| ||z| d|zz|z ||z|zz }tt|d| |jd}t t!|j#|d|j#||g||jd}|j#||d||di|j&d<|j#||d|j(d<t||zt| ||z|t+| d||z z| dz}tt|djd}t t!|j#|d|j#||g||jd}|j#||d||di}||zt| ||z| d|zz|z ||z|zz}tt|djd}t t!|j#|d|j#||g||jd}|j#||d||di|j&d<|j#||d|j(d<y) NrrdeflthetaC1C2C_ir)r4r/r0rr3r1rrrrrr r rr rrrrrrrr)rGr'rnrGrI_yI_zr&rrrOrPeqdef_xrQrRrHslope_xrSeq1slope_zeq2def_yslope_ydef_zs rIsolve_slope_deflectionzBeam3D.solve_slope_deflection s MM KK         a tQqTCMC# JJ  ))!!JtAw22A 6a @r"ay$q'*//2 D\ D\(EJJq!$4ejjA6F#GRPUUWXYZ  By|R ! =>**Q-#  A Um3z%(A66:iaRS>TWZ>Z[^def^ggC$))!,(GLLA$6 Q8J#KRQSTYY[\]^ ,,9Q<IaLABc:d1gq)*T!WQY6SVY>YZ]cde]ffC$))!,(GLLA$6 Q8J#KRQSTYY[\]^ ,,9Q<IaLABc:d1gq)*T!WQY6!CDD E ;;$ $++&F[[FK(--d3dmmQ5OX]fFGJfJ&/B3/FSXZ ZrKc|j}|dk(r"|jd|}|jS|dk(r"|jd|}|jS|dk(r"|jd|}|jS|jd|}|jd|}|jd|}tdd|||S)a Returns a plot for Shear force along all three directions present in the Beam object. Parameters ========== dir : string (default : "all") Direction along which shear force plot is required. If no direction is specified, all plots are displayed. subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, E, G, I, A, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.plot_shear_force() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: 0 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: -6*x**2 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: -15*x for x over (0.0, 20.0) r'r.rfrr)lowerrjr{rrGr0rPxPyPzs rIrgzBeam3D.plot_shear_force4 shiik #:''T2B779  CZ''T2B779  CZ''T2B779 ''T2B''T2B''T2BAq"b"- -rKc |j}|dk(rd}d}n|dk(rd}d}n |dk(rd}d }|i}|jtD]$}||jk7s||vst d |z|j |vr||j }n |j }t ||j||jd|fd d |zd d|zS)Nr'rrer.rcrfrrqrbFz!Bending Moment along %c directionrgz$\mathrm{M(%c)}$rhrl)rGr0rr-rirr_r/s rI_plot_bending_momentzBeam3D._plot_bending_moment| s ,,. #:GE CZGE CZGE <D!'*008 ECdmm#4 !>!CDD E ;;$ $++&F[[FN7+00668R[`iLMPiP&/B3/FSXZ ZrKc|j}|dk(r"|jd|}|jS|dk(r"|jd|}|jS|dk(r"|jd|}|jS|jd|}|jd|}|jd|}tdd|||S)a  Returns a plot for bending moment along all three directions present in the Beam object. Parameters ========== dir : string (default : "all") Direction along which bending moment plot is required. If no direction is specified, all plots are displayed. subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, E, G, I, A, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.plot_bending_moment() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: 0 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: -15*x**2/2 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: 2*x**3 for x over (0.0, 20.0) r'r.rfrr)rlrsr{rrms rIrmzBeam3D.plot_bending_moment shiik #:**35B779  CZ**35B779  CZ**35B779 **35B**35B**35BAq"b"- -rKc |j}|dk(rd}d}n|dk(rd}d}n |dk(rd}d }|i}|jtD]$}||jk7s||vst d |z|j |vr||j }n |j }t ||j||jd|fd d |zd d|zS)Nr'rrkr.rrqrfrrerbFzSlope along %c directionrgz$\mathrm{\theta(%c)}$rhrr)rGr0rr,rirr_r/s rI _plot_slopezBeam3D._plot_slope s  #:GE CZGE CZGE <D>''/ ECdmm#4 !>!CDD E ;;$ $++&F[[FE'N''- q&/IRW_yz}_}&/G/KX]_ _rKc|j}|dk(r"|jd|}|jS|dk(r"|jd|}|jS|dk(r"|jd|}|jS|jd|}|jd|}|jd|}tdd|||S)aP Returns a plot for Slope along all three directions present in the Beam object. Parameters ========== dir : string (default : "all") Direction along which Slope plot is required. If no direction is specified, all plots are displayed. subs : dictionary Python dictionary containing Symbols as keys and their corresponding values. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, 40, 21, 100, 25, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.solve_slope_deflection() >>> b.plot_slope() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: 0 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: -x**3/1600 + 3*x**2/160 - x/8 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: x**4/8000 - 19*x**2/172 + 52*x/43 for x over (0.0, 20.0) r'r.rfrr)rlrvr{rrms rIrszBeam3D.plot_slope sjiik #:!!#t,B779  CZ!!#t,B779  CZ!!#t,B779 !!#t,B!!#t,B!!#t,BAq"b"- -rKc |j}|dk(rd}d}n|dk(rd}d}n |dk(rd}d }|i}|jtD]$}||jk7s||vst d |z|j |vr||j }n |j }t ||j||jd|fd d |zd d|zS)Nr'rrqr.rrXrfrrrrbFzDeflection along %c directionrgz$\mathrm{\delta(%c)}$rhrw)rGr0rr+rirr_r/s rI_plot_deflectionzBeam3D._plot_deflectionJ s__& #:GE CZGE CZGE <Dg&,,V4 ECdmm#4 !>!CDD E ;;$ $++&F[[FJw',,T2T]]Av4NW\eDEHeH&/G/KX]_ _rKc|j}|dk(r"|jd|}|jS|dk(r"|jd|}|jS|dk(r"|jd|}|jS|jd|}|jd|}|jd|}tdd|||S)a Returns a plot for Deflection along all three directions present in the Beam object. Parameters ========== dir : string (default : "all") Direction along which deflection plot is required. If no direction is specified, all plots are displayed. subs : dictionary Python dictionary containing Symbols as keys and their corresponding values. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, 40, 21, 100, 25, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.solve_slope_deflection() >>> b.plot_deflection() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: 0 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: x**5/40000 - 4013*x**3/90300 + 26*x**2/43 + 1520*x/903 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: x**4/6400 - x**3/160 + 27*x**2/560 + 2*x/7 for x over (0.0, 20.0) r'r.rfrr)rlryr{rrms rIrxzBeam3D.plot_deflectionh sliik #:&&sD1B779  CZ&&sD1B779  CZ&&sD1B779 &&sD1B&&sD1B&&sD1BAq"b"- -rKc|j}|i}|j||}|j||}|j||}|j ||}t dd||||S)aP Returns a subplot of Shear Force, Bending Moment, Slope and Deflection of the Beam object along the direction specified. Parameters ========== dir : string (default : "x") Direction along which plots are required. If no direction is specified, plots along x-axis are displayed. subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, E, G, I, A, x) >>> subs = {E:40, G:21, I:100, A:25} >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.solve_slope_deflection() >>> b.plot_loading_results('y',subs) PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: -6*x**2 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: -15*x**2/2 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: -x**3/1600 + 3*x**2/160 - x/8 for x over (0.0, 20.0) Plot[3]:Plot object containing: [0]: cartesian line: x**5/40000 - 4013*x**3/90300 + 26*x**2/43 + 1520*x/903 for x over (0.0, 20.0) r|r)rlrjrsrvryr)rGr0rr}r~rrs rIrzBeam3D.plot_loading_results swriik <D$$S$/''T2sD)##C.1c3S11rKc |j}|dk(rd}d}n|dk(rd}d}n |dk(rd}d }|i}|jtD]$}||jk7s||vst d |z|j |vr||j }n |j }t ||j||jd|fd d |zd d|zS)Nr'rrXr.rrerfrrkrbFzShear stress along %c directionrgz $\tau(%c)$rh)rUr^rr4rr/rr)rGr0rrUrirr_r/s rI_plot_shear_stresszBeam3D._plot_shear_stress s((* #:GE CZGE CZGE <D(..v6 ECdmm#4 !>!CDD E ;;$ $++&F[[FL)..t4t}}a6PY^gHILgL&}S/@UT TrKc|j}|dk(r"|jd|}|jS|dk(r"|jd|}|jS|dk(r"|jd|}|jS|jd|}|jd|}|jd|}tdd|||S)a. Returns a plot for Shear Stress along all three directions present in the Beam object. Parameters ========== dir : string (default : "all") Direction along which shear stress plot is required. If no direction is specified, all plots are displayed. subs : dictionary Python dictionary containing Symbols as key and their corresponding values. Examples ======== There is a beam of length 20 meters and area of cross section 2 square meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, E, G, I, 2, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.plot_shear_stress() PlotGrid object containing: Plot[0]:Plot object containing: [0]: cartesian line: 0 for x over (0.0, 20.0) Plot[1]:Plot object containing: [0]: cartesian line: -3*x**2 for x over (0.0, 20.0) Plot[2]:Plot object containing: [0]: cartesian line: -15*x/2 for x over (0.0, 20.0) r'r.rfrr)rlr}r{rrms rIr`zBeam3D.plot_shear_stressshiik #:((d3B779  CZ((d3B779  CZ((d3B779 ((d3B((d3B((d3BAq"b"- -rKc|j}|dk(rd}n|dk(rd}n|dk(rd}|jsyttd|jdkf|j ||j|j kftdd f}t|jt|jtj }|jd|j|j |j|}|Dcgc]}|j|j| }}ttt|}t!|}||j#||fScc}w) z8 Helper function for max_shear_force(). r'rr.rrfrrrTr=)rlr.rrr4rr/rrrr?rrrr"rr r!) rGr0ri load_curver)rr'r'r,s rI_max_shear_forcezBeam3D._max_shear_force\sF iik #:G CZG CZG!'*e dmmQ.>?""7+T]]4;;-FGut$& z)))4dmm ww( a dkk"&&(1 DJKq ((:K KC\23  % |)))45yAA Ls#E-cg}|j|jd|j|jd|j|jd|S)a Returns point of max shear force and its corresponding shear value along all directions in a Beam object as a list. solve_for_reaction_loads() must be called before using this function. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, 40, 21, 100, 25, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.max_shear_force() [(0, 0), (20, 2400), (20, 300)] r'r.rf)rr)rGr,s rIr0zBeam3D.max_shear_force~s[F ..s34..s34..s34rKc|j}|dk(rd}n|dk(rd}n|dk(rd}|jsyttd|jdkf|j ||j|j kftdd f}t|jt|jtj }|jd|j|j |j|}|Dcgc]}|j|j| }}ttt|}t!|}||j#||fScc}w) z; Helper function for max_bending_moment(). r'rr.rrfrrrTr=)rlr-rrr4r.r/rrrr?rrrr"rr r!) rGr0rirr)bending_moment_curver'bending_momentsmax_bending_moments rI_max_bending_momentzBeam3D._max_bending_momentsN iik #:G CZG CZG""$W-ut}}a/? @!!#G,dmmDKK.GHut$& {**95t}} ww( a dkk"#224W=PVW1/44T]]AFWWs389 1,,-?@ACUVV X#E1cg}|j|jd|j|jd|j|jd|S)a Returns point of max bending moment and its corresponding bending moment value along all directions in a Beam object as a list. solve_for_reaction_loads() must be called before using this function. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, 40, 21, 100, 25, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.max_bending_moment() [(0, 0), (20, 3000), (20, 16000)] r'r.rf)rr)rGr:s rIrzBeam3D.max_bending_moments[F 433C89433C89433C89rKc|j}|dk(rd}n|dk(rd}n|dk(rd}|jsyttd|jdkf|j ||j|j kftdd f}t|jt|jtj }|jd|j|j|j|}|Dcgc]}|j|j| }}ttt |}t#|}||j%||fScc}w) z6 Helper function for max_Deflection() r'rr.rrfrrrTr=)rlr+rrr4r,r/rrrr?rrPrrr"rr r!) rGr0rir r)r r'rPrQs rI_max_deflectionzBeam3D._max_deflectionsD iik #:G CZG CZG )ut}}a/? @g& dkk(ABut$& {**95t}} ww( a dll#??,W5HNO1',,T]]A>O O3sK01 k"{((12G<< Prcg}|j|jd|j|jd|j|jd|S)a Returns point of max deflection and its corresponding deflection value along all directions in a Beam object as a list. solve_for_reaction_loads() and solve_slope_deflection() must be called before using this function. Examples ======== There is a beam of length 20 meters. It is supported by rollers at both of its ends. A linear load having slope equal to 12 is applied along y-axis. A constant distributed load of magnitude 15 N is applied from start till its end along z-axis. .. plot:: :context: close-figs :format: doctest :include-source: True >>> from sympy.physics.continuum_mechanics.beam import Beam3D >>> from sympy import symbols >>> l, E, G, I, A, x = symbols('l, E, G, I, A, x') >>> b = Beam3D(20, 40, 21, 100, 25, x) >>> b.apply_load(15, start=0, order=0, dir="z") >>> b.apply_load(12*x, start=0, order=0, dir="y") >>> b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])] >>> R1, R2, R3, R4 = symbols('R1, R2, R3, R4') >>> b.apply_load(R1, start=0, order=-1, dir="z") >>> b.apply_load(R2, start=20, order=-1, dir="z") >>> b.apply_load(R3, start=0, order=-1, dir="y") >>> b.apply_load(R4, start=20, order=-1, dir="y") >>> b.solve_for_reaction_loads(R1, R2, R3, R4) >>> b.solve_slope_deflection() >>> b.max_deflection() [(0, 0), (10, 495/14), (-10 + 10*sqrt(10793)/43, (10 - 10*sqrt(10793)/43)**3/160 - 20/7 + (10 - 10*sqrt(10793)/43)**4/6400 + 20*sqrt(10793)/301 + 27*(10 - 10*sqrt(10793)/43)**2/560)] r'r.rf)rr)rGrQs rIrRzBeam3D.max_deflectionsTJt++C01t++C01t++C01rK)r.r rm)allN)r'N)1r r r r rrJrrrr3r9r&r(rr,rr2rrr.rArUrDr-rGrMr`r,r+rdrjrgrsrmrvrsryrxrr}r`rr0rrr:rrR __classcell__)rs@rIrr! s3l!'s $%L##))##-- [[  !! (( ))<'.$TL'TR 3.2`O% v- 1( "gHB9H (ZG.R_rs 0/ 6$&"('EE%)0($-8.'  gj(-DEq'3q'3hO^T^rK