No error is thrown on unstable model in some scenarios
Describe the bug
In some cases, when using FEModel3D.analyze(), when the model is obviously unstable, no errors are thrown. This happens with the default options, but with sparse=False, errors are sometimes correctly thrown. I've come across a couple different scenarios that I'll go through below.
- Scenario 1: A warning is sent to
stderr:MatrixRankWarning: Matrix is exactly singular D1 = spsolve(K11.tocsr(), subtract(subtract(P1, FER1), K12.tocsr() @ D2)), but no error is thrown and code execution continues. - Scenario 2: No warnings are given, no errors are thrown, code execution continues.
- Scenario 3: Same as Scenario 2, but no errors are thrown when even
sparse=Falseis added
To Reproduce Scenario 1:
from Pynite import FEModel3D
m = FEModel3D()
m.add_node("N1", 0, 0, 0)
m.add_node("N2", 0, 1, 0)
m.add_material("Steel", 29000, 11400, 0.5, 490 / 1000 / 12**3)
# No supports are added
m.add_section("Section", 10, 100, 150, 250)
m.add_member("M1", "N1", "N2", "Steel", "Section")
m.analyze()
Scenario 2:
from Pynite import FEModel3D
m = FEModel3D()
m.add_node("N1", 0, 0, 0)
m.add_node("N2", 0, 12 * 12, 0)
m.add_node("N3", 15 * 12, 12 * 12, 0)
m.add_node("N4", 15 * 12, 0 * 12, 0)
m.add_material("Steel", 29000, 11400, 0.5, 490 / 1000 / 12**3)
m.add_section("Section", 10, 100, 150, 250)
m.add_member("M1", "N1", "N2", "Steel", "Section")
m.add_member("M2", "N4", "N3", "Steel", "Section")
m.add_section("Section2", 15, 100, 250, 250)
m.add_member("M3", "N2", "N3", "Steel", "Section2")
m.add_node_load("N2", "FX", 50)
# No supports are added
m.analyze()
Scenario 3:
from Pynite import FEModel3D
m = FEModel3D()
m.add_node("N1", 0.0, 0.0, 0.0)
m.add_node("N2", 4.0 , 0.0, 0.0)
m.add_node("N3", 4.0 , 3.0 , 0.0)
m.add_node("N4", 0.0, 3.0 , 0.0)
m.add_material("Steel", E=29000, G=11200, nu=0.3, rho=0.00028356481481481483)
m.add_section("W10x33", A=9.71, Iy=36.6, Iz=171, J=0.58)
m.add_member("M1", "N1", "N2", "Steel", "W10x33")
m.add_member("M2", "N2", "N3", "Steel", "W10x33")
m.add_member("M3", "N3", "N4", "Steel", "W10x33")
m.add_member("M4", "N4", "N1", "Steel", "W10x33")
m.add_node_load("N2", "FX", 50)
# No supports are added
m.analyze(sparse=False)
Expected behavior An exception should be thrown if we encounter any singular matrices/there is any global instability.
Thanks for reporting this. This isn't the expected or desired behavior. There is a stability check option that is enabled by default when you analyze, but isn't picking it up for some reason.
I'll have a closer look at this now that I've released v1.1.0.