Repository navigation
Fix lumped mass from member loads in modal analysis - #375
Open
pedrofaial wants to merge 1 commit into
Open
pedrofaial wants to merge 1 commit into
pedrofaial wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Member3D.lumped_mlumps the mass from member loads (distributed and point loads in the mass combo) to the end nodes, but:load_mass*(1 - x)/Linstead ofload_mass*(L - x)/L. For any member longer than 1, the i-node gets the wrong mass, and it turns negative oncex > 1(e.g. an 8 m beam with a uniform load:x = 4, i-node mass = −0.375·m). The result isRuntimeWarning: invalid value encountered in sqrtand NaN frequencies, or periods off by an order of magnitude.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_massuses 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)/Landx/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 againstT = 2*pi*sqrt(m/k), with the frame's lateral stiffnesskfrom 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 onmain.🤖 Generated with Claude Code