Non-linear Frame Analysis – Scipy solvers

The frame analysis spreadsheet presented in the previous post has been updated to use the solvers included in the Scipy package.  There is now an option to use either the Cholesky solver, or an iterative sparse solver.  The main advantages of this change are:

  1. Cholesky factorisation is the same method as used in the original Fortran code, but the Scipy solver makes better use of multi-core processors, and is significantly faster for large frames.
  2. For very large frames the iterative sparse solver provides much better performance, and will work with much larger frames without hitting memory limits.

In addition to linking to the Scipy functions it was necessary to modify the format of the stiffness matrix.  The Cholesky function uses a lower triangle banded format, and the sparse solver uses a COO sparse format (see the Scipy manual for details).  Using Python to generate these matrices was found to be very slow, so short Fortran routines were added to the main module.

As before, the new spreadsheet and related files, including full open source code, may be downloaded from:

See the previous post for details of software required, and installation details.

In addition to the 3D frame with 1476 beams used in the previous post, two larger frames were analysed, with 7065 beams:


and 14130 beams:nl-frame2-2

For the frame used in the previous post the new solvers made little difference to performance, but with the first of the larger frames the time for the first iteration using the Fortran solver increased from about half a second to between 15 and 60 seconds, depending on the numbering system.  Using the Scipy Cholesky solver, this was reduced to about 1 second for the first iteration (including the matrix factorisation stage), and about 0.5 seconds for each subsequent iterations, allowing iterative solution of 8 non-linear load stages in abut 90 seconds:


As before, beam shears and moments were compared with results from the Strand7 package, showing good agreement:


With the largest frame the first iteration using the Cholesky solver took about 60 seconds, but the sparse solver took only 3 seconds:nl-frame2-5

This entry was posted in Arrays, Beam Bending, Excel, Finite Element Analysis, Fortran, Frame Analysis, Link to dll, Link to Python, Newton, NumPy and SciPy, Strand7, UDFs, VBA and tagged , , , , , , , , , , , , , . Bookmark the permalink.

One Response to Non-linear Frame Analysis – Scipy solvers

  1. Pingback: Non-linear frame analysis; moment curvature and self-weight | Newton Excel Bach, not (just) an Excel Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s