Python: module mlob
 
 
mlob
index
c:\users\mwhitten\brgusers\python\remote_repos\moving_loads\ml\mlob.py

The mlob module calculates the maximum effects of a vehicle on a simply
supported span including the pier reaction for two adjacent simply supported
spans of differing lengths.

 
Modules
       
pdb

 
Functions
       
add_trailing_load(axle_spacing, axle_wt, space_to_trailing_load, distributed_load, span1_begin, span2_end, pt_load_spacing=0.5)
Approximates the distributed trailing load as closely spaced point loads.
 
The distributed trailing load is approximated as discretly spaced point
loads. The point load spacing is assumed to be 0.5 unless the user
specifically enters a different spacing. The number of loads to add is
determined by dividing the total span length, span 1 plus span 2, by the
point load spacing. 
 
Args:
    axle_spacing (list of floats): spacing of axles used for analysis
    axle_wt (list of floats): weight of axles used for analysis
    space_to_trailing_load (float): distance from last discrete axle to
                                    beginning of distributed load
    distributed_load (float): uniformly distributed trailing load magnitude
    span1_begin (float): coordinate location of beginning of span 1
    span2_end (float): coordinate location of end of span 2
    point_load_spacing (float, optional): spacing of approximate discretely
                                       spaced point loads, defaults to 0.5
 
Returns:
    axle_spacing (list of floats): user input axle spacing appended with
                                   axle spacing for discretely spaced loads
                                   to approximate the distributed load
    axle_wt (list of floats): user input axle weights appended with axle
                                   weights for discretely spaced loads to
                                   approximate the distributed load
 
Notes:
    Based on testing it can be shown that a reasonable level of accuracy is
    found in the forces and reactions using a discrete point load spacing of
    0.5. This spacing assumes the span lengths are entered in feet.   
 
    If the user does not want to have a distributed load on the entire
    length of the bridge it is suggested that the actual axle spacing and
    axle weights of the trailing load are entered and no distributed load is
    specified.
analyze_vehicle(axle_spacing, axle_wt, span_length1, span_length2, num_user_nodes, space_to_trailing_load, distributed_load, point_load_spacing=0.5)
Calculates the max shear and moment at each analysis node in 1 or 2 spans.
 
This function calculates the maximum shear and moment at each analysis node
in one or two spans of equal or unequal lengths. This is accomplished by
iterating through each analysis node, at each analysis node each axle of
vehicle is placed on the analysis node and the location of all the other
axles is determined, the moment and shear are calculated for this instance of
axle locations. This operation is repeated for each axle of the vehicle and
for each analysis node. The axles are incremented left to right and right to
left to cover all possible axle locations in either direction.
 
Args:
    axle_spacing (list of floats): the spacing between each axle
    axle_wt (list of floats): weight of each axle
    span_length1 (float): length of span 1
    span_length2 (float): length of span 2
    num_user_nodes (int): number of analysis nodes input by the user
    space_to_trailing_load (float): distance from last discrete axle to
                                    beginning of distributed load
    distributed_load (float): uniformly distributed trailing load magnitude
    point_load_spacing (float, optional): spacing of approximate discretely
                                          spaced point loads, 
                                          defaults to 0.5
 
Returns:
    node_loc_ltr (list of floats): coordinate location of analysis nodes in
                                   order ltr
    V_max1 (list of floats): maximum shear at each analysis node in span 1
    M_max1 (list of floats): maximum moment at each analysis node in span 1
    V_max2 (list of floats): maximum moment at each analysis node in span 2
    M_max2 (list of floats): maximum moment at each analysis node in span 2
    Rmax_pier (float): maximum pier reaction, returns None if span length 2
                       is not entered by user
    span1_begin (float): coordinate location of beginning of span 1
    span2_begin (float): coordinate location of beginning of span 2
    
Notes:
    Placing each axle directly at the analysis node ensures that the maximum
    shear and moment is calculated for each axle and corresponding axle
    locations. While the maximum shear and moment will be calculated for that
    specific analysis node location, the overall maximum shear and moment of the
    span may not be calculated if there is not enough discretization of analysis
    nodes, i.e. not enough analysis nodes in the span to accurately describe the
    shear and moment behavior.
calc_load_and_loc(cur_axle_loc, axle_wt, x, begin_span, end_span, num_axles)
Calculate the load and its location on the span.
 
Calculates the total load and its location on the span, and the load and
its location to the left and right of the node (critical section).
 
Args:
    cur_axle_loc (list of floats): current x-coordinate of all axles on span
    axle_wt (list of floats): weight of each axle
    x (float): x-coordinate of node location
    begin_span (float): x-coordinate of the beginning of the span
    end_span (float): x-coordinate of the end of the span
    num_axles (int): number of program defined axles (includes axles for
                     approximate distributed load)
 
Returns:
    Pt (float): total load on the span due to the axles on the span
    xt (float): the x-coordinate of the equivalent total load on the span
    Pl (float): the load on the span to the left of the node 
    xl (float): the x-coordinate of the equivalent load to the left of the
                node
    Pr (float): the load on the span to the right of the node
    xr (float): the x-coordinate of the equivalent load to the right of the
                node
calc_moment(x, xl, xr, span_begin, span_end, Rb, Pl, Pr, direction)
Calculate moment at node.
 
Moving left to right:
    el = x - xl
    eb = x - span_begin
    M = Rb*eb - Pl*el
Moving right to left:
    er = xr - x
    eb = span_end - x
    M = Rb*eb - Pr*er
 
Args:
    x (float): x-coordinate of node location
    xl (float): the x-coordinate of the equivalent load to the left of the
                node
    xr (float): the x-coordinate of the equivalent load to the right of the
                node
    span_begin (float): coordinate location of beginning of span
    span_end (float): coordinate location of end of span
    Rb (float): reaction at the beginning of the span
    Pl (float): the load on the span to the left of the node 
    Pr (float): the load on the span to the right of the node
    direction (str): flag to determine which direction is being calculated,
                        either 'ltr' or 'rtl'
 
Returns:
    M (float): moment at the analysis node for the given span length and
               axle location
calc_pier_reaction(cur_axle_loc, mod_axle_wt, span1_begin, span1_end, span2_begin, span2_end, num_axles)
Calculate the interior pier (floorbeam) reaction.
 
Args:
    cur_axle_loc (list of floats): current x-coordinate of all axles on span
    axle_wt (list of floats): weight of each axle
    begin_span (float): x-coordinate of the beginning of the span
    end_span (float): x-coordinate of the end of the span
    num_axles (int): number of program defined axles (includes axles for
                     approximate distributed load)
 
Returns:
    Rpier (float): reaction at the pier (floorbeam)
 
Notes:
    This function is very similar to the calc_load_and_loc function. The
    main reason this function is required is the loads that act directly
    over the support at the beginning of span 1 and at the end of span 2 do
    not contribute to the reaction at the pier. However, they do contribute
    to the reactions of each span and in determining the correct moment and
    shear in each span.
calc_reactions(Pt, xt, span_begin, span_end, direction)
Calculate span reactions.
 
Calculates the reactions at the end of each span. The pier reaction is not
calculated in this function.
 
Moving left to right:
    Rb = Pt*(span_end - xt)/span_length
    Re = Pt*(xt - span_begin)/span_length
Moving right to left:
    Rb = Pt*(xt - span_begin)/span_length
    Re = Pt*(span_end - xt)/span_length
 
Args:
    Pt (float): total load on the span
    xt (float): location of the total load on the span
    span_begin (float): span begin coordinate
    span_end (float): span end coordinate
    direction (str): flag to determine which direction is being calculated,
                        either 'ltr' or 'rtl'
 
Returns:
    Rb (float): reaction at the beginning of the span
    Re (float): reaction at the end of the span
 
Notes:
    For the vehicle moving ltr, Rb is the left span reaction and Re is the
    right span reaction.
    For the vehicle moving rtl, Rb is the right span reaction and Re is the
    left span reaction.
calc_shear(Rb, Pr, Pl, direction)
Calculate shear on one side of the node.
 
Moving left to right:
    Ve = Pl - Rb
Moving right to left
    Ve = abs(Pr - Rb)
 
Args:
    Rb (float): reaction at beginning of span
    Pr (float): the load on the span to the right of the node
    Pl (float): the load on the span to the left of the node 
    direction (str): flag to determine which direction is being calculated,
                        either 'ltr' or 'rtl'
 
Returns:
    Ve (float): shear at the analysis node
 
Notes:
    Calculate shear on the opposite side of the section.
    If the load is moving left to right, calculate the shear to the right of
    the analysis node.
    If the load is moving right to left, calculate the shear to the left of
    the analysis node.
envelope_moment(M, M_max, index_id)
Envelope maximum positive moment at each node.
 
Args:
    M (float): moment at analysis node
    M_max (list): maximum moment at each node
    index_id (int): analysis node number 
 
Returns:
    None
 
Notes:
    If M is greater than the current maxmimum moment at the current
    analysis node the maximum moment is updated as M.
envelope_pier_reaction(Rmax_pier, Rpier)
Envelope the maximum interior pier (floorbeam) reaction.
 
On each iteration compare the maximum pier reaction to the calculated pier
reaction. If the calculate pier reaction is greater than the maximum,
replace the maximum.
envelope_shear(Ve, V_max, index_id)
Envelope the maximum and minimum shear at each node.
 
Args:
    Ve (float): shear at analysis node
    V_max (list): maximum shear at each node
    index_id (int): analysis node number 
 
Returns:
    None
 
Notes:
    If Ve is greater than the current maxmimum shear at the current
    analysis node the maximum shear is updated as Ve.
get_abs_axle_location(axle_spacing, start_pt, direction)
Calculates the absolute location of the axles wrt the start point.
move_axle_loc(axle_spacing, axle_id, prev_axle_loc, num_axles, direction)
Calculates the current loaction of all the axles on or off the span.
 
Steps each axle from its previous location to the current location which
is determined from the spacing associated with the axle_id axle. 
 
Args:
    axle_spacing (list of floats): the spacing between each axle
    axle_id (int): index of axle to placed over the node
    prev_axle_loc (list of floats): x-coordinate of the previous location of
                                    each axle
    num_axles (int): number of program defined axles (includes axles for
                     approximate distributed load)
    direction (str): flag to determine which direction is being calculated,
                        either 'ltr' or 'rtl'
 
Returns:
    cur_axle_loc (list of floats): the location of each axle on or off the
                                   span with the axle_id axle located over
                                   the current node
node_location(span1_begin, span1_end, span2_begin, span2_end, num_nodes)
Calculate the coordinate location of the analysis nodes.
 
Args:
    span1_begin (float): coordinate location of beginning of span 1
    span1_end (float): coordinate location of end of span 1
    span2_begin (float): coordinate location of beginning of span 2
    span2_end (float): coordinate location of end of span 2
    num_nodes (int): number of analysis nodes input by the user
 
Returns:
    node_loc (list of floats): list of the coordinate locations of the
                                analysis nodes along the beam
 
Notes:
    The node values are rounded to three (3) decimal places. Otherwise the
    computer rounding messes up the functionality of later functions. For
    example if a node location is supposed to be directly over a pier
    support but it is 0.000000001 off the program will run as if that load
    is acting on span 1 and span 2 won't have that load applied even though
    it should be.
number_axles(num_axles)
Numbers the axles starting with 1.
span_begin_end_coords(span_length1, span_length2=0.0)
Calculate the span beginning and end coordinates for spans 1 and 2.
 
Args:
    span_length1 (float): length of span 1
    span_length2 (float, optional): length of span 2
 
Returns:
    span1_begin (float): coordinate location of beginning of span 1
    span1_end (float): coordinate location of end of span 1
    span2_begin (float): coordinate location of beginning of span 2
    span2_end (float): coordinate location of end of span 2
 
    Parameters are returned as a tuple in the following order:
    (span1_begin, span1_end, span2_begin, span2_end)