'This method adds up the loads given to a particular beam object.
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) + 2*SingularityFunction(x, 3, 2)'

def apply_load(self, value, start, order, end=None):

    x = self.variable
    value = sympify(value)
    start = sympify(start)
    order = sympify(order)
    self._load += (value * SingularityFunction(x, start, order))
    if end:
        if (order == 0):
            self._load -= (value * SingularityFunction(x, end, order))
        elif order.is_positive:
            self._load -= ((value * SingularityFunction(x, end, order)) + (value * SingularityFunction(x, end, 0)))
        else:
            raise ValueError('Order    of    the    load    should    be    positive.')
