How to Numerically Compute the Moment of Inertia

If you enjoyed this post or know someone who would, please share! (It really helps me grow)

Back before computers ran the show, Drafters & Engineers had to manually compute their section properties. While some shapes are simple or contrived enough that we can fully describe their boundaries with mathematical equations (and thereby integrate for an exact, analytical solution), many other shapes get used in real structures.

When the boundaries of a structural section can’t be fully described mathematically, they can’t be integrated analytically, so the section properties must be computed numerically instead. Any shape can be approximated as an assembly of sufficiently-fine squares, and the parallel axis theorem allows for the properties of the overall shape to be computed from those squares.

Simple Shapes

With basic geometric shapes, exact analytical solutions can be derived from the actual calculus definition of the “Second Moment of Area”, which about the x-axis is as follows:

Most books on Mechanics of Materials still feature tables of the worked-out section properties for a variety of basic shapes to this day, in my Hibbler Mechanics of Materials book it’s right inside the front cover, while my Philpot version of the book published briefer references there, and gave over an entire appendix to simple section properties instead.

An excerpt from National Tube Co’s 1913 “Book of Standards”

Built-Up Sections and the Parallel Axis Theorem

Pure geometric shapes only get us so far, but many structural shapes are composed of just a few basic geometric shapes. With a little creativity and the knowledge of how to compute the area and moment of inertia of the constituent shapes, these can be broken down with help from the Parallel Axis Theorem.

The Parallel Axis Theorem tells us that the moment of inertia of a component of the section about an axis some distance “d” from its own neutral axis is equal to its own moment of inertia about a parallel axis through its centroid, plus an additional contribution equal to the area of the component times the distance squared. Mathematically, that looks like this:

That means that all it takes to come up with the moment of inertia of a large section composed of several small geometric shapes is to find the areas and moments of inertia of each shape, then locate the centroid of the overall shape, and use the parallel axis theorem to add it all up.

Example: T-Shape from Two Plates

The simplest example of this is a T-shape, composed of two equal rectangles, say 1″ x 4″ each.

First, we need to find the centroid of the overall shape. The stem and flange each have areas of 4 sq in. The centroid of the stem is located half way up from its base, at 2″, while the centroid of the flange is at the mid thickness of the flange, plus the full 4″ of the height, so at 4.5″ Mathematically, we get:

From there, all we need to do is use our formula for the moment of inertia of a rectangle (I = b*h³/12) coupled with the parallel axis theorem, which plays out as follows:

This same strategy can be applied to any section composed of geometric shapes we can break the overall section down into.

Numerical Approaches – Old & New

Sometimes, a section can’t actually be decomposed into a reasonable number of geometric shapes, or can’t be easily described with mathematical boundaries. Often these shapes occur when structural concerns aren’t the only ones governing a design, and other competing design constraints leave us with very complex sections

That’s when we break out the brute force methods, which are made a whole lot easier by computers. The snip below is from an early 20th-century textbook, but it’s what window engineers did by hand as recently as twenty years ago.

Any student of Calculus should recognize this as basically approximating a discrete two-dimensional integration, where we’re using a finite number of small slices to represent the overall whole.

This method is almost exactly the same as what we just did with our rectangle, only here, we have an awful lot more discrete shapes to keep track of. Several expedients can lighten our brainpower load, but it’s still best to force a computer to do the heavy-lifting for you.

The mathematical form of what we’re trying to do is (the approximation comes in our approximating the shape with squares or pixels. From there, the integral IS strictly equal to the summation):

Cheat-codes to keep Numerical Integration Easy

1. Use Square Cells

By using one size square, a few simplifications can be made. For a square, b = h.

2. Make All Your Squares the Same Size

If each square is the same size, then both our I’ and A terms become constants, which can pass through the summation, leaving just a summation of the distance square terms, as represented below:

3. Count by Rows

While the above seems obvious, the actual consequence for our numerical approach is that our total Moment of Inertia becomes nearly a counting exercise. Simply compute the I’ and A values for a single grid square, then count up the number of grid squares occupied in a given row.

Tally those rows occupied off to the side, and tally the total number of rows.

From there, you can readily compute the vertical location of the centroid of the section, it’s just the sum of the number of cells occupied in a row times the midheight of the row, totalled over all the rows, divided by the total number of cells filled.

Mark down that vertical centroid (neutral axis), then tally the distance from it to the midheight of each row, and note that down as well.

Now, for each row, figure the number of occupied cells times the area per cell times the centroidal distance squared, and note that down as the last row-wise computation.

Finally, multiply the single-cell I-value times the total number of occupied cells, and add that to the total of all the A*d² terms from all the rows. This final number is the approximate I-value, in that particular orientation for the section, no matter what your shape.

Why Computers?

Example finite element mesh, for illustrating the concept.png

Finer “meshes” of grids will give you a better approximation of the result, but trying to tabulate all that info by hand quickly gets old, so modern computer tools like Risa Section or Shapebuilder, or even some of the built-in commands in AutoCAD can quickly do exactly this behind the scenes, at such fine grid spacings they’re practically the same as the true analytical answers would be anyway!

Don’t forget to make use of our 15% discount at PPI2Pass (a Kaplan Company) for select study materials, references, and review courses for the FE, PE, and SE exams! These are great materials I’ve used a ton myself, and you’ll help support this website.

Engineer Eric

Eric is a licensed Professional Engineer working as a structural engineer for an architectural facade manufacturer, which straddles the line between structural and mechanical engineering. He holds an MS in Structural Engineering from the University of Minnesota.

One thought on “How to Numerically Compute the Moment of Inertia

  1. Pingback: Parallel Axis Theorem – The StructEd

Comments are closed.

Recent Posts