pycba.bridge.BridgeAnalysis#

class BridgeAnalysis(ba=None, veh=None)[source]#

Bases: object

Performs a bridge crossing analysis for a defined vehicle. The vehicle is moved from the zero global x-coordinate of the beam until it has left the beam at the far end.

Any loads already defined on the BeamAnalysis object are retained and superimposed in each vehicle position analysis.

Can instantiate with nothing and later add or define the objects, or with instantiate with pre-defined bridge and vehicle objects.

Any loads already defined on the BeamAnalysis object are retained in each vehicle position analysis.

Parameters:
Return type:

None.

Methods

add_bridge

Create and add a beam to a bridge analysis

add_vehicle

Create and add the vehicle to the analysis

critical_values

From the envelopes output, returns the extreme values, their locations, and the position of the vehicle for each in a dictionary of dictionaries

envelopes_ratios

Returns the ratios of two sets of envelopes considering zero values and reactions.

plot_envelopes

Plots the envelopes of load effects from a vehicle traverse analysis

plot_ratios

Plots the output of pycba.bridge.BridgeAnalysis.envelopes_ratios().

plot_static

Plots for analysis of static vehicle

run_vehicle

Runs the vehicle over the bridge performing a static analysis at each point

set_bridge

Set the bridge for the bridge analysis.

set_vehicle

Set the vehicle for the bridge analysis.

static_vehicle

Performs a single analysis for the vehicle, static at a given position

add_bridge(L, EI, R, eletype=None)[source]#

Create and add a beam to a bridge analysis

Parameters:
  • L (np.ndarray) – A vector of span lengths.

  • EI (Union[float, np.ndarray]) – A vector of member flexural rigidities.

  • R (np.ndarray) – A vector describing the support conditions at each member end.

  • eletype (Optional[np.ndarray]) – A vector of the member types. Defaults to a fixed-fixed element.

Returns:

ba – A pycba.analysis.BeamAnalysis object.

Return type:

BeamAnalysis

set_bridge(ba)[source]#

Set the bridge for the bridge analysis.

Any loads already defined on the BeamAnalysis object are retained in each vehicle position analysis.

Parameters:

ba (BeamAnalysis) – A pycba.analysis.BeamAnalysis object.

Return type:

None.

add_vehicle(axle_spacings, axle_weights)[source]#

Create and add the vehicle to the analysis

Parameters:
  • axle_spacings (np.ndarray) – A vector of axle spacings of length one fewer than the length of the vector of axle weights

  • axle_weights (np.ndarray) – A vector of axle weights, length one greater than the length of the axle spacings vector.

Returns:

veh – A pycba.bridge.Vehicle object.

Return type:

Vehicle

set_vehicle(veh)[source]#

Set the vehicle for the bridge analysis.

Parameters:

veh (Vehicle) – A pycba.bridge.Vehicle object.

Return type:

None.

static_vehicle(pos, plotflag=False)[source]#

Performs a single analysis for the vehicle, static at a given position

Parameters:
  • pos (float) – The location of the front axle of the vehicle in global beam coordinates.

  • plotflag (bool, optional) – Whether or not to plot the results. The default is False.

Raises:

ValueError – If a static beam analysis does not succeed, usually due to a beam configuration error.

Returns:

ba – The pycba.Beamresults object containing the analysis results.

Return type:

BeamResults

run_vehicle(step, plot_env=False, plot_all=False)[source]#

Runs the vehicle over the bridge performing a static analysis at each point

Parameters:
  • step (float) – The distance increment to move the vehicle.

  • plot_env (bool, optional) – Whether or not to plot the results envelope. The default is False.

  • plot_all (bool, optional) – Whether or not to plot the results for each position as an animation. The default is False.

Raises:

ValueError – If a static beam analysis does not succeed, usually due to a beam configuration error.

Returns:

The load effect envelopes for the traverse; a pycba.Envelopes object.

Return type:

Envelopes

critical_values(env)[source]#

From the envelopes output, returns the extreme values, their locations, and the position of the vehicle for each in a dictionary of dictionaries

Parameters:

env (Envelopes) – An pycba.Envelopes object containing the results of a moving load analysis.

Raises:

ValueError – If the supplied envelope is inconsistent with the current pycba.bridge.BridgeAnalysis object.

Returns:

crit_values – A dictionary of dictionaries containing the critical values (i.e. extremes) of each of the load effects, both maximum and minimum.

Return type:

Dict[str, Dict[str, Union[float, np.ndarray]]]

envelopes_ratios(trial_env, ref_env)[source]#

Returns the ratios of two sets of envelopes considering zero values and reactions. Note that ratios are only meaningful for any one location on the beam, and so reaction envelopes ratios reduce to a scalar value. Ratios are absolute, and zeroed if within 1e-3 absolute tolerance of zero.

Parameters:
  • trial_env (Envelopes) – The numerator pycba.Envelopes object, usually from the vehicle seeking access to the bridge.

  • ref_env (Envelopes) – The denominator pycba.Envelopes object, usually from the reference or benchamrk of acceptable load effects on the bridge. Can be from a single notional vehicle, or a suite of such vehicles.

Raises:

ValueError – The envelopes need to be from the same bridge analysis object.

Returns:

A dictionary of ratios between the two envelopes, considering the maximum and minimum of each load effect.

Return type:

Dict[str,np.ndarray]

plot_static(pos, axs=None)[source]#

Plots for analysis of static vehicle

Parameters:
  • pos (float) – The position of the front axle of the vehicle in global bridge coordinates.

  • axs (Optional[plt.Axes], optional) – The axes on which to plot; if None is supplied, one is created. The default is None.

Return type:

None.

plot_envelopes(env)[source]#

Plots the envelopes of load effects from a vehicle traverse analysis

Parameters:

env (Envelopes) – An pycba.Envelopes object containing the results of a moving load analysis.

Return type:

None

plot_ratios(env_ratios)[source]#

Plots the output of pycba.bridge.BridgeAnalysis.envelopes_ratios().

Parameters:

env_ratios (Dict[str,np.ndarray]) – The dictionary of envelopes ratios.

Raises:

ValueError – Inconsistency in the dictionary entries.

Return type:

None.