In [2]:
from miscpy.utils.sympyhelpers import *
init_printing()
m,r,R,R1,R2,th,ph = symbols('m,r,R,R_1,R_2,theta,phi')
The shell has interior radius $R_1$ and exterior radius $R_2$. The origin of the coordinate system is located at the center of the base (there is no cap on the shell - $O$ is in empty space). A differential mass element in the shell is located by spherical coordinates $r,\theta,\phi$ where $\theta$ is the aximuth and $\phi$ is the zenith angle.
In [3]:
rdmO = r*Matrix([cos(th)*sin(ph),sin(th)*sin(ph), cos(ph)]);rdmO
Out[3]:
In [4]:
V = integrate(integrate(integrate(r**2*sin(ph),(r,R1,R2)),(th,0,2*pi)),(ph,0,pi/2)); V
Out[4]:
In [7]:
rGO = simplify(integrate(integrate(integrate(rdmO*r**2*sin(ph),(r,R1,R2)),(th,0,2*pi)),(ph,0,pi/2))/V);
mat2vec(rGO,'b')
Out[7]:
In [8]:
mat2vec(rGO.subs(R1,0),'b')
Out[8]:
In [ ]:
In [12]:
tmp = simplify((rdmO.T*rdmO)[0]*eye(3) - rdmO*rdmO.T); tmp
Out[12]:
In [13]:
Io = m/V*integrate(integrate(integrate(tmp*r**2*sin(ph),(r,R1,R2)),(th,0,2*pi)),(ph,0,pi/2)); Io
Out[13]:
In [14]:
Ig = simplify(Io - m*((rGO.T*rGO)[0]*eye(3)-rGO*rGO.T)); Ig
Out[14]:
In [15]:
Ig.subs(R1,0)
Out[15]:
In [ ]: