The central difference method is an explicit integrator that forms a linear combination of the mass and damping matrices to advance the solution to the next time step. So, if the mass matrix is lumped and there’s no damping, or only mass-proportional damping, the left-hand side matrix is diagonal. Then, you can solve the system of equations in linear time using the diagonal solver (currently undocumented in OpenSees, use `ops.system('Diagonal')`

or `system Diagonal`

).

But did you know that you can also use the diagonal solver for general static and dynamic analysis with implicit integrators where the stiffness matrix enters the left-hand side matrix?

You probably didn’t know you can use the diagonal solver so broadly–likely because doing so is usually a bad idea. And we rarely hear about bad ideas, only the good ones.

Before showing why the diagonal solver is a bad idea, here’s an easy example from my nonlinear structural analysis course that might lead you to believe using this solver is a good idea. It’s the same example described in this post.

Using standard Newton-Raphson with a regular equation solver, the residual and displacement increment reduce quadratically.

Now, if we switch the solver to diagonal, i.e., ignore all off-diagonal terms when solving for the displacement increments at each iteration, Newton-Raphson will converge linearly.

The diagonal solver works on a simple two DOF spring model, so it will definitely scale up to a real structural model, right? Imagine the speed up, trading extra iterations for fast equation solutions. LPU, here we come!

Unfortunately, the diagonal solver working on a real structural model is hit or miss–mostly miss. Below is the output of using `ops.system('Diagonal')`

for gravity load analysis of a multi-story linear-elastic frame. Not only is the equilibrium iteration not converging, it is *diverging*!

With any other solver in OpenSees, the gravity load analysis converges in one iteration, as expected. You can play a few tricks to get the diagonal solver to converge, but it takes so many iterations that there’s not much point in taking this point any further.

Like many things in OpenSees, e.g., the linear algorithm, just because you *can* do it doesn’t mean you *should*. So, unless you are using central difference with mass-proportional or no damping, add the diagonal solver to the compost pile.

The convergence issues described in this post are similar to those encountered when not using a full matrix solver with modal damping.

## One thought on “Don’t Try This at Home”