Member stiffness matrix
64-bitThe 12 by 12 stiffness of one beam-column in its own axes.
EA ÷ L, GJ ÷ L, 12EI ÷ L³, 6EI ÷ L², 4EI ÷ L, 2EI ÷ L
Closed-form terms written straight into a 64-bit array. Symmetry is by construction: each term is stored on both sides of the diagonal.
/** 12×12 local stiffness (row-major Float64Array). */
export function localK(E, G, A, Iy, Iz, J, L) {
const k = new Float64Array(144);
const s = (i, j, v) => { k[i * 12 + j] += v; if (i !== j) k[j * 12 + i] += v; };
const ea = E * A / L, gj = G * J / L;
s(0, 0, ea); s(0, 6, -ea); s(6, 6, ea);
s(3, 3, gj); s(3, 9, -gj); s(9, 9, gj);
const z1 = 12 * E * Iz / L ** 3, z2 = 6 * E * Iz / L ** 2, z3 = 4 * E * Iz / L, z4 = 2 * E * Iz / L;
s(1, 1, z1); s(1, 5, z2); s(1, 7, -z1); s(1, 11, z2);
s(5, 5, z3); s(5, 7, -z2); s(5, 11, z4);
s(7, 7, z1); s(7, 11, -z2); s(11, 11, z3);
const y1 = 12 * E * Iy / L ** 3, y2 = 6 * E * Iy / L ** 2, y3 = 4 * E * Iy / L, y4 = 2 * E * Iy / L;
s(2, 2, y1); s(2, 4, -y2); s(2, 8, -y1); s(2, 10, -y2);
s(4, 4, y3); s(4, 8, y2); s(4, 10, y4);
s(8, 8, y1); s(8, 10, y2); s(10, 10, y3);
return k;
}