# mass_matrix

compas.numerical.mass_matrix(Ct, ks, q=0, c=1, tiled=True)[source]

Creates a network’s nodal mass matrix.

Parameters
• Ct (sparse) – Sparse transpose of the connectivity matrix (n x m).

• ks (array) – Vector of member EA / L (m x 1).

• q (array) – Vector of member force densities (m x 1).

• c (float) – Convergence factor.

• tiled (bool) – Whether to tile horizontally by 3 for x, y, z.

Returns

array – Mass matrix, either (m x 1) or (m x 3).

Notes

The mass matrix is defined as the sum of the member axial stiffnesses (inline) of the elements connected to each node, plus the force density. The force density ensures a non-zero value in form-finding/pre-stress modelling where E=0.

$\mathbf{m} = |\mathbf{C}^\mathrm{T}| (\mathbf{E} \circ \mathbf{A} \oslash \mathbf{l} + \mathbf{f} \oslash \mathbf{l})$