# Principal Moment of Inertia-how to calculate?

1. Jul 26, 2012

### cccic

Principal Moment of Inertia--how to calculate?

1. The problem statement, all variables and given/known data
I am writing a program that incorporates calculating the principal moment of inertia for a protein residue based on its component atom XYZ coordinates. I am exceedingly confused about which formulas to use in calculating principal moment of inertia for my situation.

Thus far my program does the following:

1. Calculate elements (Ixx, Iyy, Izz, etc.) of symmetric matrix A
2. Find the eigenvalues (and thus the principal moments of inertia)

2. Relevant equations
The formulas I originally used were from here: https://docs.google.com/viewer?a=v&q...ZFyxHNqw&pli=1 [Broken]

However looking at Wikipedia, the formulas for the symmetric matrix elements are different. http://en.wikipedia.org/wiki/Moment_...tia#Definition [Broken]

I have also been scouring the internet and found open source code where the center of mass is subtracted from the x, y, and z coordinates before beginning calculation of elements Ixx, Iyy, Izz, etc.

3. The attempt at a solution
Which formulas/algorithm do I use to calculate principal moment of inertia for my case? I'm not sure where to begin with picking which formulas to use. Is there a source that is accessible to those with a weak physics background that will help me understand which formula/algorithm to use in calculating principal moment of inertia?

Thank you!

Last edited by a moderator: May 6, 2017
2. Jul 26, 2012

### tiny-tim

hi cccic!
wikipedia is correct

(i can't compare it with your first link, since that isn't working )

wikipedia's formulas work for moment of inertia about any point

however, i expect you will usually need the moment of inertia about the centre of mass, so in that case yes you will have to subtract it from the x, y, and z coordinates first

Last edited by a moderator: May 6, 2017
3. Jul 26, 2012

### cccic

4. Jul 26, 2012

### TSny

Re: Principal Moment of Inertia--how to calculate?

Hi cccic. Ok, you have your molecule sitting in space. Imagine introducing an arbitrary Cartesian coordinate system with origin chosen at an arbitrary location and axes oriented arbitrarily. Then each atom in your molecule will have Cartesian coordinates (x,y,z) in this coordinate system. The equations given in Wikipedia will give you the elements of the moment of inertial tensor relative to the axes of your coordinate system. [The answer given to the question at the link to stackexchange makes an incorrect statement when it says that the formulas at Wikipedia are only for axes passing through the cm. They are in fact valid for any coordinate system.]

Now, suppose you want the moment of inertia tensor for a coordinate system that has origin at the center of mass of the molecule and with axes oriented parallel to your previously arbitrarily chosen coordinate system. Let's call this the center of mass coordinate system. Then you have two ways to go:

Method 1: Find the (x,y,z) coordinates of each atom in the center of mass coordinate system and then use the formulas for the moment of inertia tensor as given in Wikipedia using these coordinates. To find the coordinates of the atoms in the center of mass coordinate system, you would need to find the coordinates of the center of mass of the molecule (xcm, ycm, zcm) in the original coordinate system using standard formulas (see http://hyperphysics.phy-astr.gsu.edu/hbase/cm.html) Subtract these coordinates of the center of mass from each of your (x,y,z) coordinates of the atoms in the original coordinate system.

Method 2: Use the coordinates of the atoms in the original coordinate system, but use the formulas as given in the NASA document.