pycba.load_cases.LoadCases#
- class LoadCases(beam_model, load_cases=None)[source]#
Bases:
objectCollection of named load cases for one PyCBA beam model.
The collection is list-like for simple scripting, but also provides methods to analyse every case, form response matrices, and combine cases with arbitrary linear factors.
Methods
Add a named load case to the collection.
Append a full-span UDL of intensity
wto every span of a named case.Add and return a named load case.
Append an imposed-curvature load to a named load case.
Append one raw load row to a named load case.
Append a concentrated moment load to a named load case.
Append a point load to a named load case.
Append a partial UDL to a named load case.
Append a UDL covering a global beam segment to a named load case.
Add one full-span UDL case per span.
Append a full-span or partial trapezoidal load to a named load case.
Append a full-span UDL to a named load case.
Analyse one factored load-case combination and return the analysis.
Analyse one factored load-case combination and return the analysis.
Append an existing
LoadCaseor load-case-like object.Return a named load case, optionally creating it when missing.
Return a linear response combination using arbitrary case factors.
Return one load matrix formed from factored named load cases.
Analyse every load case independently and return their envelope.
Append several load cases.
Convert sequence or mapping factors to a numeric vector.
Alias for
combine().Return integer identifiers for load-position tracking.
Analyse all cases and return the common station vector and matrix.
Replace or create a named load case.
Select a linear combination by response sign at a target coordinate.
Return the load matrices keyed by load-case name.
Attributes
- property names: tuple[str, ...]#
Load-case names in collection order.
- load_positions()[source]#
Return integer identifiers for load-position tracking.
Cases generated by segmented-load helpers store a
load_positionin their metadata. Other cases default to one bit per case in collection order.- Return type:
list[int]
- to_LM()[source]#
Return the load matrices keyed by load-case name.
The dictionary preserves the collection order and each load matrix is copied so callers can inspect or mutate it without changing the stored load cases.
- Return type:
dict[str,List[List[Union[int,float]]]]
- case(name, create=True)[source]#
Return a named load case, optionally creating it when missing.
- Return type:
- add_case(name, loads=None, loaded_spans=(), metadata=None)[source]#
Add and return a named load case.
- Return type:
- add(name, loads, loaded_spans=(), metadata=None)[source]#
Add a named load case to the collection.
loadsis a normal PyCBA load matrix. It is copied on entry so later caller-side mutation does not alter the stored case.- Return type:
- set(name, loads, loaded_spans=(), metadata=None)[source]#
Replace or create a named load case.
- Return type:
- add_pudl(load_case, i_span, w, a, c)[source]#
Append a partial UDL to a named load case.
- Return type:
- add_segment_udl(load_case, x0, x1, w)[source]#
Append a UDL covering a global beam segment to a named load case.
The segment is split at span boundaries into full-span UDL and partial UDL rows as required.
- Return type:
- add_all_spans_udl(load_case, w)[source]#
Append a full-span UDL of intensity
wto every span of a named case.The beam is supplied implicitly from this collection (consistent with
add_segment_udl()). The named case is created when it does not yet exist.- Parameters:
load_case (
str) – Name of the load case to add the UDLs to.w (
float) – UDL intensity applied to every span.
- Returns:
The (created or existing) load case with the UDLs appended.
- Return type:
Notes
This adds all spans into the one named case, which is distinct from
add_span_udl()(one separate case per span).
- add_ml(load_case, i_span, m, a)[source]#
Append a concentrated moment load to a named load case.
- Return type:
- add_trap(load_case, i_span, w1, w2, a=None, c=None)[source]#
Append a full-span or partial trapezoidal load to a named load case.
- Return type:
- add_ic(load_case, i_span, kappa)[source]#
Append an imposed-curvature load to a named load case.
- Return type:
- response_matrix(response='M')[source]#
Analyse all cases and return the common station vector and matrix.
- Return type:
tuple[ndarray,ndarray]
- envelope(npts=None)[source]#
Analyse every load case independently and return their envelope.
Each case is analysed on its own (no combination) and the per-station pointwise extremes of moment and shear (plus coincident effects and reaction extremes) are enveloped into a first-class
pycba.results.Envelopes. This gives a one-call path to a full, plottable envelope from helpers such asmake_span_udl_cases()andmake_patterned_udl().- Parameters:
npts (
Optional[int]) – Number of evaluation points along a member. Defaults to the template beam’snptswhen available.- Returns:
The pointwise envelope over the analysed load cases.
- Return type:
Notes
This is the pointwise extreme of each case analysed alone, which is a genuinely different result from
additive_envelope()(a same-station superposition of then_combinegoverning cases).
- factors(factors)[source]#
Convert sequence or mapping factors to a numeric vector.
A sequence must have one value per load case. A mapping can use either load-case names or zero-based integer indices as keys; unspecified cases receive a zero factor.
- target_combination(name, x, sense='min', response='M', selected_factor=1.0, unselected_factor=0.0)[source]#
Select a linear combination by response sign at a target coordinate.
For
sense="min", cases with a negative effect atxreceiveselected_factor. Forsense="max", cases with a positive effect receiveselected_factor. Other cases receiveunselected_factor.- Return type:
- combine(factors, response='M')[source]#
Return a linear response combination using arbitrary case factors.
A 1D factor vector returns one response vector. A 2D factor matrix returns one response row per factor row.
- Return type:
tuple[ndarray,ndarray]
- combined_loads(factors)[source]#
Return one load matrix formed from factored named load cases.
factorsmust define a single combination, either as a 1D sequence with one factor per case, or as a mapping from case names or indices to factors. Cases omitted from a mapping receive a zero factor.- Return type:
List[List[Union[int,float]]]
- analyze_combination(factors, npts=None)[source]#
Analyse one factored load-case combination and return the analysis.
This is useful when a combined case should be treated like an ordinary
BeamAnalysis, for example to useBeamAnalysis.plot_results().- Return type:
- analyse_combination(factors, npts=None)#
Analyse one factored load-case combination and return the analysis.
This is useful when a combined case should be treated like an ordinary
BeamAnalysis, for example to useBeamAnalysis.plot_results().- Return type: