Skip to content

Add eigenvalue stability check to detect mechanisms #134

@ccaprani

Description

@ccaprani

Problem

pycba currently solves mechanism structures without raising an error. The stiffness matrix is near-singular, so the solve "succeeds" but produces enormous displacements (~10^17) that are numerically meaningless.

For example, P10F (pin at one end, free at the other) with a point load at the free end is a mechanism — it rotates about the pin. But BeamAnalysis solves it and returns reactions = [1.0] (correct from ΣFy=0) with displacements of order 10^17.

Suggested fix

Add an eigenvalue check on the assembled stiffness matrix before solving, similar to what anaStruct does. anaStruct raises a StabilityError when eigenvalues indicate instability:

FEMException: ('StabilityError', 'The eigenvalues of the stiffness matrix are non zero, which indicates a instable structure. Check your support conditions')

Alternatively, check cond(K) or min(eig(K)) after assembly and before solve, and raise a clear error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions