pycba.beam.Beam#

class Beam(L=None, EI=None, R=None, LM=None, eletype=None)[source]#

Bases: object

Class definition

Constructs a beam object

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

  • EI (np.ndarray) – A vector of member flexural rigidities.

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

  • LM (Optional[list[list[Union[int, float]]]]) – The load matrix: a list of loads on the beam; each load with several parameters.

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

Return type:

None.

Methods

add_load

Adds a new load to the beam's load matrix

add_span

Add a span to the continuous beam

get_local_span_coords

Returns the span index and position in span for a position given in global coordinates on the beam

get_ref

Returns Released End Forces for the member; that is, the Consistent Nodal Loads modified for the element type (i.e.

get_span_k

Returns the stiffness matrix for the ith span

k_FF

Stiffness matrix for a fixed-fixed element

k_FP

Stiffness matrix for a fixed-pinned element

k_PF

Stiffness matrix for a pinned-fixed element

k_PP

Stiffness matrix for a pinned-pinned element

Attributes

length

returns: length -- The total length of the beam :rtype: float

loads

Returns the load matrix for the beam

no_fixed_restraints

Returns the number of fixed restraints of the beam (fully-supported DOFs)

no_restraints

Returns the number of restraints of the beam

no_spans

Returns the no.

restraints

Returns the restraints vector for the beam

add_span(L, EI, eletype)[source]#

Add a span to the continuous beam

Parameters:
  • L (float) – The length of the member.

  • EI (np.ndarray) – The flexural rigidity of the member.

  • eletype (int) – The element type for the member

Return type:

None.

property loads: List[List[int | float]]#

Returns the load matrix for the beam

Returns:

LM – The load matrix for the beam

Return type:

LoadMatrix

add_load(load)[source]#

Adds a new load to the beam’s load matrix

Parameters:

load (List[Union[int,float]]) – A list describing the load to be added

Return type:

None

property restraints: ndarray#

Returns the restraints vector for the beam

Returns:

_restraints – The restraints vector for the beam

Return type:

np.ndarray

property no_spans#

Returns the no. of spans in the beam

Returns:

no_spans – The number of spans in the beam

Return type:

int

property no_restraints#

Returns the number of restraints of the beam

Returns:

no_restraints – The number of restraints in the beam

Return type:

int

property no_fixed_restraints#

Returns the number of fixed restraints of the beam (fully-supported DOFs)

Returns:

no_fixed_restraints – The number of fixed restraints in the beam

Return type:

int

property length#

returns: length – The total length of the beam :rtype: float

get_local_span_coords(pos)[source]#

Returns the span index and position in span for a position given in global coordinates on the beam

Parameters:

pos (float) – The position of interest in global coordinates along the length of the beam

Return type:

(int, float)

Returns:

  • ispan (int) – The index (1-based) of the span in which the point of interest falls

  • pos_in_span (float) – The local coordinate along the member of the point of interest

get_ref(i_span)[source]#

Returns Released End Forces for the member; that is, the Consistent Nodal Loads modified for the element type (i.e. releases)

Parameters:

ispan (int) – The index (1-based) of the span in which the point of interest falls

Returns:

ref – The totalled CNL object for the member, considering all loads.

Return type:

LoadCNL

get_span_k(i_span)[source]#

Returns the stiffness matrix for the ith span

Parameters:

ispan (int) – The index (1-based) of the span in which the point of interest falls

Returns:

kb – The stiffness matrix for the member

Return type:

np.ndarray

k_FF(EI, L)[source]#

Stiffness matrix for a fixed-fixed element

Parameters:
  • EI (float) – The flexural rigidity for the member (assumed prismatic)

  • L (float) – The length of the member

Returns:

k – The stiffness matrix for the member

Return type:

np.ndarray

k_FP(EI, L)[source]#

Stiffness matrix for a fixed-pinned element

Parameters:
  • EI (float) – The flexural rigidity for the member (assumed prismatic)

  • L (float) – The length of the member

Returns:

k – The stiffness matrix for the member

Return type:

np.ndarray

k_PF(EI, L)[source]#

Stiffness matrix for a pinned-fixed element

Parameters:
  • EI (float) – The flexural rigidity for the member (assumed prismatic)

  • L (float) – The length of the member

Returns:

k – The stiffness matrix for the member

Return type:

np.ndarray

k_PP(EI, L)[source]#

Stiffness matrix for a pinned-pinned element

Parameters:
  • EI (float) – The flexural rigidity for the member (assumed prismatic)

  • L (float) – The length of the member

Returns:

k – The stiffness matrix for the member

Return type:

np.ndarray