Skip to content

Fix lumped mass from member loads in modal analysis - #375

Open
pedrofaial wants to merge 1 commit into
JWock82:mainfrom
pedrofaial:fix/PN-1-massa-modal
Open

pedrofaial wants to merge 1 commit into
JWock82:mainfrom
pedrofaial:fix/PN-1-massa-modal

Conversation

@pedrofaial

Copy link
Copy Markdown

Problem

Member3D.lumped_m lumps the mass from member loads (distributed and point loads in the mass combo) to the end nodes, but:

  1. The i-node share used load_mass*(1 - x)/L instead of load_mass*(L - x)/L. For any member longer than 1, the i-node gets the wrong mass, and it turns negative once x > 1 (e.g. an 8 m beam with a uniform load: x = 4, i-node mass = −0.375·m). The result is RuntimeWarning: invalid value encountered in sqrt and NaN frequencies, or periods off by an order of magnitude.
  2. It added a rotational inertia m*x² at each node. The lever rule already places the mass, so this counts the lever arm twice and gives spurious, very slow rotational modes.

The existing test_lumped_vs_consistent_mass uses 1 m members, where (1 - x)/L == (L - x)/L, so the suite did not catch it. Nodal loads, self-weight (consistent mass), static and P-Delta analyses are not affected.

Fix

Split the load mass between the end nodes' translational DOFs by the lever rule, (L - x)/L and x/L, with no rotational terms.

Tests

Added to Testing/test_modal_analysis.py:

  • test_member_load_mass_matches_nodal_mass (uniform, partial from 3 to 7 m, and point load on an 8 m beam of a portal frame): periods must match a model with the same mass applied directly as nodal loads (rtol 1e-6).
  • test_portal_frame_distributed_mass_periods: periods checked against T = 2*pi*sqrt(m/k), with the frame's lateral stiffness k from a static analysis (0.6247 s out of plane, k = 2*3*E*Iy/h³; 0.2423 s in plane), rtol 1e-3.

Before the fix the new tests fail (periods around 4.9 s); after, they pass. The full suite passes locally (213 passed), except tests that need vtk/pyvista, which were not installed in my environment and fail the same way on main.

🤖 Generated with Claude Code

Member3D.lumped_m split the load mass with (1 - x)/L instead of (L - x)/L,
so any member longer than 1 got the wrong i-node mass (negative past x = 1),
giving NaN frequencies or periods off by an order of magnitude. It also
added a rotational inertia m*x² at each node, which counts the lever arm a
second time and produced spurious slow modes.

The existing lumped mass test used 1 m members, where both expressions are
equal, so it did not catch this. New tests compare member loads (uniform,
partial and point) against the same mass applied as nodal loads, and check
a portal frame's periods against T = 2*pi*sqrt(m/k) with k from statics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant