Dynamic Solution Algorithm for OpenSEES
Throughout our collapse work using OpenSees, numerical stability was a huge problem, and we developed these algorithms over the course of a couple of years, in order to get past the numerical issues. Hopefully your use of this algorithm can help you to avoid similar frustrations!
The full algorithm has some complications that are not too easy to follow in the code (it checks the nodal displacement output to search for singularity, etc.), so I have included two sets of files to try and make things easier to follow.
1) The first set of files is a simplified solution algorithm that does not include all of the complication. This can be used to get a general idea of how the algorithm is structured. [link]
2) The second set of files is the full solution algorithm, as well as the procedure that calls the algorithm. [link]