pystran.beam module#

Define beam mechanical quantities.

pystran.beam.assemble_mass(Mg, member, i, j)[source]#

Assemble beam mass matrix.

The mass matrix of two-dimensional beam takes into account axial vibration and transverse vibration separately.

In three dimensions, in addition to axial vibration, transverse vibration in two principal planes, torsional vibration is also taken into account.

Parameters:
  • Mg – Global structural mass matrix.

  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

Returns:

Updated global matrix is returned.

Return type:

float

pystran.beam.assemble_stiffness(Kg, member, i, j)[source]#

Assemble beam stiffness matrix.

The stiffness matrix depends on whether the beam is considered in two dimensions or in three dimensions.

In two dimensions, the beam stiffness matrix is a superposition of two mechanisms: axial bar plus bending in the \(x-z\) plane.

In three dimensions, beam stiffness is a superposition of four mechanisms – axial bar, torsion bar, bending in the \(x-y\) plane, and bending in the \(x-z\) plane.

Parameters:
  • Kg – Global structural stiffness matrix.

  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

Returns:

Updated global matrix is returned.

Return type:

array

pystran.beam.beam_2d_3d_axial_stiffness(e_x, h, E, A)[source]#

Compute axial stiffness matrix.

This function works both for 2D and 3D beams.

The axial stiffness matrix is computed as \(K = EA B^T B h\). Here \(B\) is the stretch-displacement matrix, computed by beam_3d_stretch_displ_matrix().

Parameters:
  • e_x – Unit vector of the local cartesian coordinate system in the direction of the axis of the beam.

  • h – Length of the beam.

  • E – Young’s modulus of elasticity.

  • A – Cross section area.

Returns:

Stiffness matrix of the beam.

Return type:

array

pystran.beam.beam_2d_3rd_deriv_displ_matrix(e_z, h)[source]#

Compute beam third derivative-displacement matrix.

Here the third derivative is with respect to the physical coordinate measured along the member (local \(x\)).

The third derivative \(d^3w/dx^3\) is computed in the local coordinate system of the beam as \(d^3w/dx^3 = B U\). Here \(B\) is the third-derivative-displacement matrix and \(U\) is the displacement vector. Two displacement components and one rotation component at each joint are assumed, so the matrix \(B\) has one row and six columns. Note that this matrix is constant (independent of the location along the beam).

Parameters:
  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

Returns:

The third derivative-displacement matrix.

Return type:

array

pystran.beam.beam_2d_axial_force(member, i, j, xi)[source]#

Compute 2d beam axial force based on the displacements stored at the joints.

Refer to the function pystran.truss.truss_strain_displacement() that computes the strain-displacement matrix for a truss member.

The axial force is uniform along the beam. Hence, xi does not matter.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The force resultant.

Return type:

float

pystran.beam.beam_2d_bending_stiffness(e_z, h, E, I)[source]#

Compute 2d beam stiffness matrix.

The formula reads

\[K = (h/2) \int_{-1}^{+1} EI B^T B d\xi,\]

where \(B\) is the curvature-displacement matrix (computed by beam_2d_curv_displ_matrix()), and \(h/2\) is the Jacobian. \(I\) is the second moment of area about the \(y\) axis (which is orthogonal to the plane of bending).

Two-point Gauss quadrature is used to compute the stiffness matrix.

Parameters:
  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • E – Young’s modulus of elasticity.

  • I – Second moment of area for bending about the \(y\)-axis (i.e. bending in the \(x-z\) plane).

Returns:

Stiffness matrix of the beam.

Return type:

array

pystran.beam.beam_2d_curv_displ_matrix(e_z, h, xi)[source]#

Compute 2d beam curvature-displacement matrix.

Here the curvatures is with respect to the physical coordinate measured along the member (local \(x\)).

The curvature \(d^2w/dx^2\) is computed in the local coordinate system of the beam as \(d^2w/dx^2 = B U\). Here \(B\) is the curvature-displacement matrix and \(U\) is the displacement vector. Two displacement components and one rotation component at each joint are assumed, so the matrix \(B\) has one row and six columns.

Parameters:
  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The curvature-displacement matrix.

Return type:

array

pystran.beam.beam_2d_end_forces(member, i, j)[source]#

Compute the end forces of a beam element in 3d.

The end forces of the beam are forces acting on the joints i and j by the beam.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

Returns:

Dictionary with the keys 'Ni', 'Qzi', 'Myi', 'Nj', 'Qzj', 'Myj', is returned.

Return type:

Dict

pystran.beam.beam_2d_mass(e_x, e_z, h, rho, A)[source]#

Compute beam mass matrix.

The mass matrix is consistent, which means that it is computed from the discrete form of the kinetic energy of the element,

\[\int \rho A \left(\dot u \cdot \dot u + \dot w \cdot \dot w\right)dx\]

where \(\dot u\) and \(\dot w\) are the velocities in the \(x\) and \(z\) directions. Note that the rotational velocities of the cross sections do not play a role.

The velocity \(\dot u\) is assumed to vary linearly along the element, and the velocity \(\dot w\) is assumed to vary according to the Hermite shape functions.

Gauss quadrature is used to compute the mass matrix.

Parameters:
  • e_x – Unit vector of the local cartesian coordinate system in the direction of the axis of the beam.

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • rho – Mass density of the material.

  • A – Area of the cross section.

Returns:

Mass matrix of the beam.

Return type:

array

pystran.beam.beam_2d_moment(member, i, j, xi)[source]#

Compute 2d beam moment based on the displacements stored at the joints. The moment is computed at the parametric location xi along the beam.

The moment is mathematically defined as \(M = -EI d^2w/dx^2\).

The curvature is computed with the curvature-displacement matrix \(B\) by the function beam_2d_curv_displ_matrix().

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The moment resultant.

Return type:

float

pystran.beam.beam_2d_shear_force(member, i, j, xi)[source]#

Compute 2d beam shear force based on the displacements stored at the joints.

The shear force is uniform along the beam. Hence, xi does not matter.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The force resultant.

Return type:

float

pystran.beam.beam_3d_axial_force(member, i, j, xi)[source]#

Compute 3d beam axial force based on the displacements stored at the joints.

The axial force is uniform along the beam. Hence, xi does not matter.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The force resultant.

Return type:

float

pystran.beam.beam_3d_bending_stiffness(e_y, e_z, h, E, Iy, Iz)[source]#

Compute 3d beam stiffness matrices for bending in the planes \(x-y\) and \(x-z\).

The formula reads

\[K = (h/2) \int_{-1}^{+1} EI_y B_{xz}^T B_{xz} d\xi,\]

for bending in the \(x-z\) plane, and

\[K = (h/2) \int_{-1}^{+1} EI_z B_{xy}^T B_{xy} d\xi,\]

for bending in the \(x-y\) plane. Here \(B_{xz}\) is the curvature-displacement matrix for bending in the \(x-z\) plane (computed by beam_3d_xz_curv_displ_matrix()), \(B_{xy}\) is the curvature-displacement matrix for bending in the \(x-y\) plane (computed by beam_3d_xy_curv_displ_matrix()), and \(h/2\) is the Jacobian. \(I_y\) is the second moment of area about the \(y\) axis, and \(I_z\) is the second moment of area about the \(z\) axis. The overall matrix is the sum of these two contributions.

Appropriate Gauss quadrature formulas are used to compute the stiffness matrix.

Parameters:
  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • E – Young’s modulus of elasticity.

  • Iy – Second moment of area for bending about the \(y\)-axis (i.e. bending in the \(x-z\) plane).

  • Iz – Second moment of area for bending about the \(z\)-axis (i.e. bending in the \(x-y\) plane).

Returns:

Stiffness matrix of the beam.

Return type:

array

pystran.beam.beam_3d_end_forces(member, i, j)[source]#

Compute the end forces of a beam element in 3d.

The end forces of the beam are forces acting on the joints i and j by the beam.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

Returns:

Dictionary with the keys 'Ni', 'Qyi', 'Qzi', 'Ti', 'Myi', 'Mzi', 'Nj', 'Qyj', 'Qzj', 'Tj', 'Myj', 'Mzj', is returned.

Return type:

Dict

pystran.beam.beam_3d_mass(e_x, e_y, e_z, h, rho, A, Ix)[source]#

Compute beam mass matrix.

The mass matrix is consistent, which means that it is computed from the discrete form of the kinetic energy of the element,

\[\int \rho A \left(\dot u \cdot \dot u + \dot v \cdot \dot v + \dot w \cdot \dot w\right)dx\]

where \(\dot u\), \(\dot v\), and \(\dot w\) are the velocities in the \(x\), \(y\), and \(z\) directions.

The velocity \(\dot u\) is assumed to vary linearly along the element, and the velocity \(\dot v\), \(\dot w\) is assumed to vary according to the Hermite shape functions. Rotations about \(y\) and \(z\) are ignored in the kinetic energy.

For spinning of the beam about its axis, the kinetic energy is given by the formula

\[\int \rho I_x \dot \theta_x \cdot \dot \theta_x dx.\]

Gauss quadrature is used to compute the mass matrix.

Parameters:
  • e_x – Unit vector of the local cartesian coordinate system in the direction of the axis of the beam.

  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • rho – Mass density of the material.

  • A – Area of the cross section.

  • Ix – Second moment of area of the cross section for rotation about x.

Returns:

Mass matrix of the beam.

Return type:

array

pystran.beam.beam_3d_moment(member, i, j, axis, xi)[source]#

Compute 3d beam moment based on the displacements stored at the joints. The moment is computed at the parametric location xi along the beam. The moment acts about the axis specified by the string axis ('y' or 'z').

The moments are mathematically defined as \(M_y = -EI_y d^2w/dx^2\) for bending about the y axis, and \(M_z = +EI_z d^2v/dx^2\) for bending about the \(z\) axis.

The curvatures are computed with curvature-displacement matrices \(B\) by the functions beam_3d_xz_curv_displ_matrix() and beam_3d_xy_curv_displ_matrix(), respectively.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • axis – Bending about which axis? Specify either ‘y’ or ‘z’.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The moment resultant.

Return type:

float

pystran.beam.beam_3d_shear_force(member, i, j, axis, xi)[source]#

Compute 3d shear force based on the displacements stored at the joints.

The shear force in the direction of axis axis ('y' or 'z') is uniform along the beam. Hence, xi does not matter.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • axis – Shearing in the direction of which axis? Specify either ‘y’ or ‘z’.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The force resultant.

Return type:

float

pystran.beam.beam_3d_stretch_displ_matrix(e_x, h, xi)[source]#

Compute beam stretch-displacement matrix.

Stretch here means axial strain.

The job is delegated to the truss module.

Parameters:
  • e_x – Unit vector along the axis of the member.

  • h – Length of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

Stretch-displacement matrix.

Return type:

array

pystran.beam.beam_3d_torsion_displ_matrix(e_x, h, xi)[source]#

Compute torsion-displacement matrix.

The torsion-displacement matrix is constant. Hence, xi does not matter.

Parameters:
  • e_x – Unit vector of the local cartesian coordinate system in the direction of the axis of the beam.

  • h – Length of the beam.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The torsion rate-displacement matrix of the bar.

Return type:

array

pystran.beam.beam_3d_torsion_moment(member, i, j, xi)[source]#

Compute 3d beam torsion moment based on the displacements stored at the joints. The moment is uniform along the beam.

The moment is mathematically defined as \(T = GJ d\theta_x/dx\). The rate of change of the axial rotation, \(d\theta_x/dx\), is computed with the torsion-displacement matrix \(B\), obtained by the function beam_3d_torsion_displ_matrix().

The torsion moment is uniform along the beam. Hence, xi does not matter.

Parameters:
  • member – Dictionary that defines the data of the member.

  • i – Dictionary that defines the data of the first joint of the member.

  • j – Dictionary that defines the data of the second joint of the member.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The moment resultant.

Return type:

float

pystran.beam.beam_3d_torsion_stiffness(e_x, h, G, J)[source]#

Compute torsion stiffness matrix.

The torsion stiffness matrix is computed as \(K = GJ B^T B h\). Here \(B\) is the torsion-displacement matrix, computed by beam_3d_torsion_displ_matrix().

Parameters:
  • e_x – Unit vector of the local cartesian coordinate system in the direction of the axis of the beam.

  • h – Length of the beam.

  • G – Shear modulus of elasticity.

  • J – Torsion constant of the section.

Returns:

Stiffness matrix of the beam.

Return type:

array

pystran.beam.beam_3d_xy_3rd_deriv_displ_matrix(e_y, e_z, h)[source]#

Compute 3d beam third derivative-displacement matrix for displacements in the \(x-y\) plane.

Here the third derivative is with respect to the physical coordinate measured along the member (local \(x\)).

The third derivative \(d^3v/dx^3\) is computed in the local coordinate system of the beam as \(d^3v/dx^3 = B U\). Here \(B\) is the third-derivative-displacement matrix and \(U\) is the displacement vector. All three displacement components and all three rotation components at each joint are assumed, so the matrix \(B\) has one row and twelve columns. Note that this matrix is constant (independent of the location along the beam).

Parameters:
  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

Returns:

The third derivative-displacement matrix.

Return type:

array

pystran.beam.beam_3d_xy_curv_displ_matrix(e_y, e_z, h, xi)[source]#

Compute beam curvature-displacement matrix in the local \(x-y\) plane (i.e. bending about the \(z\) axis).

The curvature \(d^2v/dx^2\) is computed in the local coordinate system of the beam as \(d^2v/dx^2 = B U\). Here \(B\) is the curvature-displacement matrix and \(U\) is the displacement vector. All three displacement components and all three rotation components at each joint are assumed, so the matrix \(B\) has one row and twelve columns.

Parameters:
  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The curvature-displacement matrix.

Return type:

array

pystran.beam.beam_3d_xy_shape_fun(xi)[source]#

Compute the beam shape functions for deflection in the \(x-y\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The signs of the shape functions that go with the rotations (i.e. the second and fourth) need to be reversed relative to the \(x-z\) plane of bending: An array of second derivatives of shape functions is returned (i.e. \([N_1(\xi), -N_2(\xi), N_3(\xi), -N_4(\xi)]\)).

Return type:

array

pystran.beam.beam_3d_xy_shape_fun_xi2(xi)[source]#

Compute the second derivative of the beam shape functions for deflection in the \(x-y\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The signs of the shape functions that go with the rotations (i.e. the second and fourth) need to be reversed: An array of second derivatives of shape functions is returned (i.e. \([d^2N_1(\xi)/d\xi^2, -d^2N_2(\xi)/d\xi^2, d^2N_3(\xi)/d\xi^2, -d^2N_4(\xi)/d\xi^2]\)).

Return type:

array

pystran.beam.beam_3d_xy_shape_fun_xi3(xi)[source]#

Compute the third derivative of the beam shape functions with respect to xi for deflection in the \(x-y\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The signs of the shape functions that go with the rotations (i.e. the second and fourth) need to be reversed: An array of third derivatives of shape functions is returned (i.e. \([d^3N_1(\xi)/d\xi^3, -d^3N_2(\xi)/d\xi^3, d^3N_3(\xi)/d\xi^3, -d^3N_4(\xi)/d\xi^3]\)).

Return type:

array

pystran.beam.beam_3d_xz_3rd_deriv_displ_matrix(e_y, e_z, h)[source]#

Compute 3d beam third derivative-displacement matrix for displacements in the \(x-z\) plane.

Here the third derivative is with respect to the physical coordinate measured along the member (local \(x\)).

The third derivative \(d^3w/dx^3\) is computed in the local coordinate system of the beam as \(d^3w/dx^3 = B U\). Here \(B\) is the third-derivative-displacement matrix and \(U\) is the displacement vector. All three displacement components and all three rotation components at each joint are assumed, so the matrix \(B\) has one row and twelve columns. Note that this matrix is constant (independent of the location along the beam).

Parameters:
  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

Returns:

The third derivative-displacement matrix.

Return type:

array

pystran.beam.beam_3d_xz_curv_displ_matrix(e_y, e_z, h, xi)[source]#

Compute beam curvature-displacement matrix in the local \(x-z\) plane (i.e. bending about the \(y\) axis).

The curvature \(d^2w/dx^2\) is computed in the local coordinate system of the beam as \(d^2w/dx^2 = B U\). Here \(B\) is the curvature-displacement matrix and \(U\) is the displacement vector. All three displacement components and all three rotation components at each joint are assumed, so the matrix \(B\) has one row and twelve columns.

Parameters:
  • e_y – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • e_z – Unit vector of the local cartesian coordinate system (orthogonal to the axis of the beam).

  • h – Length of the beam.

  • xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

The curvature-displacement matrix.

Return type:

array

pystran.beam.beam_3d_xz_shape_fun(xi)[source]#

Compute the beam shape functions for deflection in the \(x-z\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

An array of shape function values is returned (i.e. \([N_1(\xi), ..., N_4(\xi)]\)).

Return type:

array

pystran.beam.beam_3d_xz_shape_fun_xi2(xi)[source]#

Compute the second derivative of the beam shape functions for deflection in the \(x-z\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

An array of second derivatives of shape functions is returned (i.e. \([d^2N_1(\xi)/d\xi^2, ..., d^2N_4(\xi)/d\xi^2]\)).

Return type:

array

pystran.beam.beam_3d_xz_shape_fun_xi3(xi)[source]#

Compute the third derivative of the beam shape functions with respect to xi for deflection in the \(x-z\) plane.

Parameters:

xi – Parametric coordinate (\(-1\le\xi\le+1\)): first joint is at \(\xi =-1\), second is at \(\xi =+1\).

Returns:

An array of third derivatives of shape functions is returned (i.e. \([d^3N_1(\xi)/d\xi^3, ..., d^3N_4(\xi)/d\xi^3]\)).

Return type:

array