I am developing a software to compute the plastic collapse in Steel structures.

The computing algoritm works properly when the structure has more than 4 nodes.

But in simply structures, like a simply supported beam, the program crashes down, because the general stiffness matrix procedure don't works properly with the smallest structures.

I need made the matritial process in order to use the same procedure.

Any idea?