{
"cells": [
{
"cell_type": "markdown",
"id": "bbf822e6",
"metadata": {},
"source": [
"# 16 Principal axes and Moments of Inertia"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "448e1c8e",
"metadata": {},
"outputs": [],
"source": [
"# import all python add-ons etc that will be needed later on\n",
"%matplotlib inline\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from numpy import linalg as LA\n",
"plt.rcParams.update({'font.size': 16}) # set font size for plots"
]
},
{
"cell_type": "markdown",
"id": "78a71518",
"metadata": {},
"source": [
"## 16 Introduction\n",
"We can cause any mass, such as a ball or spanner, to spin in any direction whatsoever with respect to itself; spin up, spin down, left, right, or any combination. If we calculate the moment of inertia about each of the axes the mass is spinning, we find that it is always possible to represent the motion and moments as a linear combination of three principal axes, which are intrinsic to the body and are defined by the shape and mass of the body itself. It is not so surprising that we can find a unique set of axes because we know that we can\n",
"decompose any vector into its basis vectors, for example along the $x-, y-$, or $z$-axes for the\n",
"unit vectors $i, j, k$. When decomposing the motion or moments of inertia, if each does not\n",
"contain components from any of the others, then the axes must be orthogonal and they are the principal axes.\n",
"\n",
"The principal axes about which the body will rotate, are shown in Figure 71; the moment of inertia about axis A will be relatively small, as the girder is long and thin. The moments of inertia about B and C, will be larger than about axis A, but approximately equal to one another because of symmetry. The same arguments apply to a molecule.\n",
"\n",
"![Drawing](matrices-fig71.png)\n",
"\n",
"Figure 71. Principal rotation axes about which moments of inertia are calculated.\n",
"_____\n",
"It is clear from Figure 71 how to choose the principal axes for the girder, but for an oddly shaped body, which means in practice most molecules this is hard to decide _per se_. If we were to choose another set of axes at some angle to those shown on the girder, then the moments of inertia would contain terms with contributions from the principal axes to a lesser or greater extent, depending on exactly how these other axes are placed with respect to the body. This would be rather awkward because everyone would have calculated different values for the same body, depending on exactly where the axes are chosen to be. By calculating the principal axes, which are unique to the body considered because angular momentum points in a fixed direction for a given rotational motion, then this ambiguity is removed.\n",
"\n",
"Molecules have discrete masses and Fig. 72 shows the approximate location of the centre of mass of the chloro-mesiylene and propynal molecules together with two of the principal rotation axes; the third is $90^\\mathrm{o}$ to these two and out of the page. In the vapour phase, the molecule rotates about its centre of mass (or gravity) and this may not be situated on an atom. Most of our calculations are aimed at finding these principal axes because molecular properties can be referenced to these. Principal axes are used in different ways by different authors, but only in the sense that $x, y,$ and $z$ labels become interchanged, therefore, a convention is adopted to label axes with the largest moment of inertia as the axis C and the smallest as A.\n",
"\n",
"In Figure 72 the moment about the axis through the chlorine atom will be small as this heavy atom is on the axis and for this atom, and the other two carbon atoms on the axis the product $mr^2$ is zero. Rotation about the other two axes will be larger but different to one another.\n",
"\n",
"In calculating the moment of inertia, we are not interested in the exact formula for a particular molecule, which is often very complicated and of no intrinsic interest. We are interested, however, in the numerical values of the moment of inertia and their directions with respect to the molecule, because we ultimately want to calculate bond lengths. A very elegant eigenvalue - eigenvector matrix method can automatically find the principal axes and the moments of inertia of very complex molecules. The algorithm with which to do this is shown below. The eigenvalues produced are the moments of inertia; the eigenvectors are used to produce the principal or inertial axes; eigenvectors always produce geometry! The method is described next; equation (75) is the one we will use.\n",
"\n",
"![Drawing](matrices-fig72.png)\n",
"\n",
"Figure 72. Approximate location of the centre of mass together with two of the principal rotation axes. The third, describing rotational motion in the plane of the figure, is perpendicular to the other axes and points out of the plane of the figure. The molecule rotates about the centre of mass or gravity. This need not be situated on an atom.\n",
"______"
]
},
{
"cell_type": "markdown",
"id": "c8dbc713",
"metadata": {},
"source": [
"## 16.1 Formal description of the method\n",
"\n",
"If all the atoms are rigidly connected together, the $k^{th}$ atom and its velocity vector $\\pmb{v}_k$, are\n",
"related to the angular velocity of the molecule $\\pmb{\\omega}$ about the centre of mass as \n",
"\n",
"$$\\displaystyle \\pmb{v}_k=\\pmb{\\omega}\\times\\pmb{r}_k $$\n",
"\n",
"where $\\pmb{r}_k$ is the position vector from the centre of mass and $\\pmb{\\omega}$ is a vector but does not carry an index. This is because in a rigid body, all atoms move with the same angular velocity. The angular momentum for the $k^{th}$ atom is defined as the vector cross product\n",
"\n",
"$$\\displaystyle \\pmb{J}_k =\\pmb{r}_k\\times\\pmb{p}_k$$\n",
"\n",
"where $\\pmb{p} = m\\pmb{v}$ is the momentum vector and the total _angular momentum_ is the sum over\n",
"all $n$ atoms and is\n",
"\n",
"$$\\displaystyle \\pmb{J}_k=\\sum_{k=1}^n m_k (\\pmb{r}_k\\times \\pmb{v}_k)=\\sum_{k=1}^n m_k (\\pmb{r}_k\\times (\\pmb{\\omega}\\times \\pmb{v}_k) )$$ \n",
"\n",
"where we have substituted for $p$ and then $v$. The cross product of a cross product is called a _triple product_ (see Chapter 6.18) and is a vector;\n",
"\n",
"$$\\displaystyle \\pmb{a}\\times (\\pmb{b}\\times \\pmb{c})= (\\pmb{a}\\cdot\\pmb{c})\\pmb{b}-(\\pmb{a}\\cdot \\pmb{b})\\pmb{c}$$\n",
"\n",
"The two dot products each produce a number, and these multiply the vectors $\\pmb{b}$ and $\\pmb{c}$. We can now write, remembering that $\\pmb{r}_k$ is a vector,\n",
"\n",
"$$\\displaystyle J=\\sum_{k=1}^n m_k \\left((\\pmb{r}_k\\cdot\\pmb{r}_k)\\pmb{\\omega}-(\\pmb{r}_k\\cdot\\pmb{\\omega})\\pmb{r}_k \\right)=\\sum_{k=1}^n m_k(r_k^2\\pmb{\\omega} -(\\pmb{r}_k\\cdot\\pmb{\\omega})\\pmb{r}_k) $$\n",
"\n",
"The vector $\\pmb{J}$ has components $x, y, z$ so it represents three equations. This can be written as a matrix equation but note that $r_k^2$ is a number; it is the perpendicular distance of atom $k$ from an axis, $x, y$ or $z$, but $\\pmb{r}_k$ is the vector $\\pmb{r}_k = (x_k\\, y_k\\, z_k)$ describing the position of atom $k$.\n",
"\n",
"\n",
"$$\\displaystyle \\pmb{J}_{(x,y,z),k}= m_kr_k^2\\begin{bmatrix} \\omega_x\\\\ \\omega_y \\\\ \\omega_x \\end{bmatrix}-m_k\\left(\\begin{bmatrix} x_k& y_k & z_k \\end{bmatrix}\\begin{bmatrix} \\omega_x\\\\ \\omega_y \\\\ \\omega_x \\end{bmatrix} \\right)\\begin{bmatrix} x_k\\\\ y_k \\\\ z_k \\end{bmatrix} $$\n",
"\n",
"The $x$ component for the $k^{th}$ atom is found by expanding the dot product as $x_k\\omega_x + y_k\\omega_y + z_k\\omega_z$ and then multiplying by $x_km_k$ and rearranging a little\n",
"\n",
"$$\\displaystyle \\pmb{J}_{x,k} = m_k(r_k^2-x_k^2)\\omega_x -m_kx_ky_k\\omega_y-m_kx_kz_k\\omega_z \\qquad\\tag{74}$$\n",
"\n",
"and there are similar equations for the $y$ and $z$ direction components.\n",
"\n",
"By comparing coefficients of $\\omega_x, \\omega_y$, and $\\omega_z$ in equations 74 and 75, the diagonal terms in this matrix are\n",
"\n",
"$$\\displaystyle I_{xx}=\\sum_k m_k(r_k^2-x_k^2);\\qquad I_{yy}=\\sum_k m_k(r_k^2-y_k^2);\\qquad I_{zz}=\\sum_k m_k(r_k^2-z_k^2);$$\n",
"\n",
"For each atom $r^2=x^2+y^2+z^2$ then these terms become \n",
"\n",
"$$\\displaystyle I_{xx} =\\sum_k m_k(y_k^2+z_k^2)$$\n",
"\n",
"and similarly for the other diagonal terms. These terms are called _moments of inertia coefficients_ and cannot be negative as they are the sum of squared terms. The cross terms $I_{xy}$, for example, are called _products of inertia coefficients_, and are \n",
"\n",
"$$\\displaystyle I_{xy}=-\\sum_k m_kx_ky_k;\\qquad I_{xz}=-\\sum_k m_kx_kz_k;\\qquad I_{yz}=-\\sum_k m_yx_zy_k;$$ \n",
"\n",
"Equation 74 can be rewritten for each atom $k$ using the inertial coefficients\n",
"\n",
"$$\\displaystyle \\begin{align}J_x&=I_{xx}\\omega_x+I_{xy}\\omega_y + I_{xz}\\omega_z \\\\\n",
"J_y&=I_{xy}\\omega_x+I_{yy}\\omega_y + I_{yz}\\omega_z \\\\\n",
"J_z&=I_{xz}\\omega_x+I_{yz}\\omega_y + I_{zz}\\omega_z \\end{align}$$\n",
"\n",
"\n",
"and, of the nine coefficients, only six are different because of symmetry; $I_{xy} = I_{yx}$ and so forth. In matrix form these equations are\n",
"\n",
"$$\\displaystyle \\qquad\\qquad\\pmb{J}=\\pmb{I\\omega}= \\begin{bmatrix}I_{xx} & I_{xy} & I_{xz} \\\\ I_{xy} & I_{yy} & I_{yz} \\\\I_{xz} & I_{yz} & I_{zz} \\\\\\end{bmatrix} \\begin{bmatrix}\\omega_x\\\\ \\omega_y\\\\ \\omega_z\\end{bmatrix}\\qquad\\qquad\\qquad\\qquad\\text{(75)}$$\n",
"\n",
"The matrix $\\pmb{I}$, is also sometimes either called the _moment of inertia dyadic_ or the _inertia tensor_, but, more importantly, it is symmetrical and Hermitian so has real eigenvalues and orthogonal eigenvectors.\n",
"\n",
"The next step in the calculation is to perform a principal axis transform, which we can view as a rotation of the inertia matrix to remove all the off-diagonal terms that become zero on forming a diagonal matrix. The methods of matrix algebra enable us to find for any molecule, or any body in general, the set of Cartesian axes for which the inertia $\\pmb{I}$ matrix will be diagonal. The result of this transformation is to produce moments of inertia about the principal axes.\n",
"\n",
"The eigenvalues $\\lambda$, are found for each atom $k$, using the secular determinant\n",
"\n",
"$$\\displaystyle \\begin{vmatrix} I_{xx}-\\lambda & I_{xy} & I_{xz} \\\\ I_{xy} & I_{yy}-\\lambda & I_{yz} \\\\ I_{xz} & I_{yz} & I_{zz}-\\lambda \\end{vmatrix}=0$$\n",
"\n",
"The expressions for the diagonal and off-diagonal terms are given above. Because the moments of inertia coefficients contain squared terms we can pictorially view then as an ellipse. The rotation to principal axes is then akin to rotating the ellipse, as shown in Figure 66.\n",
"\n",
"Finally, the kinetic energy relative to the centre of mass is also calculated in a straightforward way in matrix form and is\n",
"\n",
"$$\\displaystyle \\pmb{T}= \\frac{1}{2}\\pmb{\\omega}\\cdot \\pmb{I}\\cdot \\pmb{\\omega} =\\frac{1}{2}\\begin{bmatrix}\\omega_x & \\omega_y & \\omega_z\\end{bmatrix}\\begin{bmatrix}I_{xx} & I_{xy} & I_{xz} \\\\ I_{xy} & I_{yy} & I_{yz} \\\\I_{xz} & I_{yz} & I_{zz} \\\\\\end{bmatrix} \\begin{bmatrix}\\omega_x \\\\ \\omega_y \\\\ \\omega_z\\end{bmatrix} $$\n",
"\n",
"An example is easier to understand than this complex theory; the moments of inertia of ethanol will now be calculated. The X-ray coordinates give the atoms' coordinates and Python/Sympy is used to do the algebra. The rotational constants are then easily calculated and compared with experimental values, which are $A = 1.18, B = 0.318, C = 0.277 \\,\\mathrm{cm^{-1}}$ (Senent et al. 2000).\n",
"\n",
"This problem is transferable to any molecule, although inputting data will be tedious for large molecules; only the coordinates C1, Ox, etc. will need to be changed and the order of array 'molec' and the mass. The numerical diagonalization will normally produce complex numbers as the eigenvalues and eigenvectors. As the determinant is Hermitian, the eigenvalues must be real, and any complex part should be small because it is caused by the method used to numerically solve of the equations, and should be made zero. \n",
"\n",
"Note that distances are in angstroms, and the masses of the common isotopes, $^{16}$O and $^{12}$C are in atomic mass units, therefore, we take the mass to be 16 and 12 respectively. The units of the moment of inertia can be changed to kg m$^2$ units at the end of the calculation. Note that the coordinates are each adjusted to the centre of mass before the calculation of the moments of inertia begins. The centre of mass is labelled 'com'.\n",
"\n",
"The order of the atoms is the same as for their coordinates\n",
"\n",
"## 16.2 Calculating a molecule's moments of inertia: "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "0bfe59b4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cente of mass -1.2153 0.32596 0.24802\n",
"\n",
" Eigenvalues\n",
" [15.31632914 52.87227246 60.38671239]\n",
"\n",
" Moments of Inertia kg.m^2 [2.54327645e-46 8.77944084e-46 1.00272136e-45]\n",
" determinant kg^3 m^6 2.2389e-136\n",
" High temperature rotation partition function 3.2866 * T^(3/2)/sym \n",
"\n",
" Eigvectors\n",
" [[ 0.28934619 -0.44995832 -0.8448765 ]\n",
" [ 0.79846164 0.60026765 -0.04623586]\n",
" [-0.52795624 0.6612233 -0.53295961]]\n",
"\n",
"Rotational constants A, B, C /cm^{-1} 1.10007 0.31867 0.27902\n",
"radius of gyration /m [5.77030049e-11 1.07209945e-10 1.14575504e-10]\n"
]
}
],
"source": [
"# data is for ethanol \n",
"# atoms contains sequence of atoms to go with coords in order\n",
"# coords are x,y z positions in Angstrom\n",
"# mass is a dict with values in amu. \n",
"\n",
"atoms=['C', 'O', 'H', 'C', 'H', 'H', 'H', 'H', 'H'] # atom type \n",
"coords=[[ -0.968, -0.008, -0.167],\n",
" [ -0.953, 1.395, -0.142],\n",
" [ 0.094, -0.344, -0.2],\n",
" [ -1.683, -0.523, 1.084],\n",
" [ -1.49, -0.319, -1.102],\n",
" [ -1.842, 1.688, -0.25],\n",
" [ -1.698, -1.638, 1.101],\n",
" [ -1.171, -0.174, 2.011],\n",
" [ -2.738, -0.167, 1.117]] # coordinates as x,y,z\n",
"\n",
"#-------------------------------------\n",
"def mom_of_I(xyz,atm):\n",
" \n",
" hbar = 1.054e-34 # J s\n",
" c = 2.9979e10 # cm / s\n",
" amu = 1.6605e-27 # kg\n",
" kB = 1.38065e-23 # J / K\n",
" angst= 1e-10\n",
" consts = hbar/(4*np.pi*amu*angst**2*c)\n",
" mass = {'H':1, 'C':12, 'N':14,'O':16, 'F':18,'Na':23, 'Mg':24.3, 'P':31,'S':32,\n",
" 'Cl':35.5,'Ca':40,'Mn':55,'Fe':55.8,'C0':59,'Ni':58.7,'Cu':63.5,'Zn':65.4}\n",
" tmass = 0\n",
" n = len(atm)\n",
" for i in range(n):\n",
" tmass = tmass + mass[atm[i]] # total mass\n",
" \n",
" com = [0.0 for i in range(3)]\n",
" ss = np.zeros((n,3),dtype=float ) #2D array n atoms, 3 -> x,y,z \n",
" for i in range(n):\n",
" ss[i][0]= xyz[i][0]*mass[atm[i]] # mass weighted coords\n",
" ss[i][1]= xyz[i][1]*mass[atm[i]]\n",
" ss[i][2]= xyz[i][2]*mass[atm[i]]\n",
"\n",
" com = np.sum(ss,0)/tmass # centre of mass\n",
" print('{:s} {:10.5g} {:10.5g} {:10.5g}'.format( 'cente of mass', com[0],com[1],com[2]) )\n",
" \n",
" ss = xyz - com\n",
" #print('CoM based coordinates \\n',ss )\n",
" r = [0.0 for i in range(n)] # radial distance from com\n",
" for i in range(n):\n",
" r[i]= np.sqrt( (xyz[i][0] -com[0])**2 + (xyz[i][1] - com[1])**2 + (xyz[i][2] - com[2])**2)\n",
" \n",
" Ixx= np.sum( [mass[atm[i]] *(r[i]**2 - (ss[i][0])**2 ) for i in range(n)] ) # Ixx, Ixy etc\n",
" Iyy= np.sum( [mass[atm[i]] *(r[i]**2 - (ss[i][1])**2 ) for i in range(n)] )\n",
" Izz= np.sum( [mass[atm[i]] *(r[i]**2 - (ss[i][2])**2 ) for i in range(n)] )\n",
" \n",
" Ixy= np.sum( [-mass[atm[i]] * ss[i][0]*ss[i][1] for i in range(n)] )\n",
" Ixz= np.sum( [-mass[atm[i]] * ss[i][0]*ss[i][2] for i in range(n)] )\n",
" Iyz= np.sum( [-mass[atm[i]] * ss[i][1]*ss[i][2] for i in range(n)] )\n",
" \n",
" M= [[Ixx,Ixy,Ixz],[Ixy,Iyy,Iyz],[Ixz,Iyz,Izz]] # moment of inertia matrix \n",
" \n",
" eigvals = LA.eigh(M)\n",
" \n",
" print('\\n Eigenvalues\\n', eigvals[0]) # print results \n",
" print('\\n Moments of Inertia kg.m^2', eigvals[0]*amu*angst**2)\n",
" \n",
" adet = LA.det(M)\n",
" \n",
" print('{:s} {:10.5g}\\n {:s} {:10.5g}{:s} '\n",
" .format( ' determinant kg^3 m^6', adet*(amu*angst**2)**3, \n",
" 'High temperature rotation partition function', \n",
" np.sqrt( np.pi*adet*(amu*angst**2)**3 )*(2*kB/hbar**2)**(3.0/2.0),' * T^(3/2)/sym') )\n",
" print( '\\n Eigvectors\\n', eigvals[1] )\n",
" print('\\n{:s} {:10.5f} {:10.5f} {:10.5f}'\n",
" .format( 'Rotational constants A, B, C /cm^{-1}', \n",
" consts/eigvals[0][0], consts/eigvals[0][1], consts/eigvals[0][2] ) )\n",
" print('radius of gyration /m', np.sqrt(eigvals[0]*amu*angst**2/(tmass*amu) ) )\n",
" \n",
" return eigvals,ss\n",
"#-----------------------------\n",
"\n",
"eigvals,ss = mom_of_I(coords,atoms) # do calculation "
]
},
{
"cell_type": "markdown",
"id": "13262668",
"metadata": {},
"source": [
"![Drawing](matrices-fig73.png)\n",
"\n",
"Figure 73 X-ray structure of ethanol and its new inertial axes drawn to scale with respect to one another using the eigenvalues. The lengths are in units of amu A$^2$ or $1.667 \\cdot 10^{-47}\\,\\mathrm{ kg\\,m^2}, I_a = 15.2, I_b = 52.9, I_c = 60.4$. The H atoms are in grey the oxygen in red.\n",
"_______\n",
"\n",
"Note that these results should be rounded to four figures, as this is the precision of the data. The rotational constants compare well with experimentally measured values which are, $A = 1.18, B = 0.318, C = 0.277\\,\\mathrm{ cm^{-1}}$. The inertial axes can now be drawn on top of the molecular structure. By convention, $Ic$ labels the largest moment of inertia and $Ia$ the smallest. Note that the units we use are in atomic mass units $\\times$ angstrom squared, which are equivalent to $1.667 \\cdot 10^{47}\\,\\mathrm{ kg\\,m^2}$.\n",
"\n",
"As might have been anticipated, the centre of mass is between the heavier atoms and is almost in the plane of these atoms. The smallest moment of inertia is about an axis in the plane of the OCC atoms and it points in the OC direction as shown approximately along the 'line' of the CCO atoms. The two largest moments of inertia, which are similar in value, describe motion perpendicular to this axis and are larger because the atoms are further from the axes. The new inertial axes, which are parallel to the moments of inertia, are drawn in proportion to the size of each eigenvector component from the initial molecular $x, y$, and $z$-axes; the $Ia$ axis has $x, y, z$ components of approximately $0.29, 0.8, -0.53$ as shown in the modal matrix of eigenvectors."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}