pycba.results.BeamResults#

class BeamResults(beam, d, r, npts=100, rs=None, shear_points=None)[source]#

Bases: object

BeamResults Class for processing and containing the results for each member

Initialize member results from global results

Parameters:
  • beam (Beam) – The pycba.beam.Beam object for which the results are to be stored.

  • d (ndarray) – The vector of nodal displacements (from the stiffness method).

  • r (ndarray) – The vector of reactions at fixed restraints (restraint == -1).

  • npts (int) – The number of points along the member at which to calculate the load effects. The default is 100.

  • rs (ndarray) – The vector of spring forces (k_s * u_i) for spring restraints (restraint > 0).

  • shear_points (Optional[Dict[int, ndarray]]) – Extra “shear point” sections requested per member, as a mapping of 0-based member index to a vector of member-local coordinates. Each section is sampled by a station pair straddling it, so the shear is recovered just-left and just-right of the section. The default (None) leaves the uniform evaluation grid bit-for-bit unchanged.

Return type:

None.

Methods

at

Interpolate the load effects at a global coordinate.

deflection_curve

Return (x, D) for the continuous deflected shape.

to_csv

Write the member load effects (columns x, M, V, R, D) to a CSV file.

to_dataframe

Return the member load effects as a pandas.DataFrame with columns x, M (moment), V (shear), R (rotation) and D (deflection).

at(x, attrs=('M', 'V', 'R', 'D'))[source]#

Interpolate the load effects at a global coordinate.

Parameters:
  • x (float) – Global coordinate measured from the left end of the beam.

  • attrs (Tuple[str, ...]) – Which member-result arrays to evaluate: any of "M" (moment), "V" (shear), "R" (rotation) and "D" (deflection). The default returns all four.

Returns:

Each requested attribute mapped to its interpolated value at x. The station array repeats span-boundary coordinates, so it is de-duplicated first; at a step in the shear (a support or point load) the left-hand value is returned.

Return type:

Dict

deflection_curve()[source]#

Return (x, D) for the continuous deflected shape.

Each member’s result grid duplicates its end stations so the bending-moment and shear diagrams close to the baseline; for the deflected shape those closure points would otherwise draw spurious vertical lines at member ends (e.g. dropping to zero at a cantilever tip). This drops the closure padding, giving the continuous deflection along the beam.

Returns:

The coordinate and deflection arrays (native units, unscaled).

Return type:

(numpy.ndarray, numpy.ndarray)

to_dataframe()[source]#

Return the member load effects as a pandas.DataFrame with columns x, M (moment), V (shear), R (rotation) and D (deflection). Requires pandas.

to_csv(path, **kwargs)[source]#

Write the member load effects (columns x, M, V, R, D) to a CSV file.

Uses numpy.savetxt() so no pandas dependency is needed; any extra keyword arguments are forwarded to it. Returns path.