# Non Uniform Density Rod Center of Mass

Consider a rod in three dimensional space where $$y$$ is the height axis. $$h$$ is the height of the rod and $$a$$ is the radius of the rod. The function $$\rho(r, \theta, y)$$ is the density function. The mass of the rod can be calculated with

$$m =\int_{y=0}^{h}\int_{\theta=0}^{2\pi}\int_{r=0}^{a}\rho(r, \theta, y)rdrd\theta dy$$

similarly the center of mass in the y direction is

$$C_y = \frac{\int_{y=0}^{h}\int_{\theta=0}^{2\pi}\int_{r=0}^{a}y\rho(r, \theta, y)rdrd\theta dy}{m} \label{1}$$

How can the center of mass in the $$x$$ and $$z$$ direction and or in terms of $$r$$ and $$\theta$$ be expressed?

• Definitely an issue. For example if you have a rod thats radially uniform, then the center of mass would be 0 but the integral with respect to r would be positive – Saketh Malyala Jun 12 at 0:31
• A "rod" is generally a linear instrument. You say that $a$ is the (uniform?) radius of the rod, so presumably the rod has a circular cross-section but perhaps density varies as a function of $r\in [0,a]$ and $\theta\in [0,2\pi)$. So while the cross-sections are uniformly circular, their density can vary arbitrarily? I'm guessing at your meaning, but a (right circular) cylinder might be a better term for the figure. – hardmath Jun 12 at 0:32
• @hardmath The density can vary with all three variables $r, \theta, y$ within their domain however it wants, continuously, continuously whatever. Otherwise yes, I think you are correct. – fullnitrous Jun 12 at 0:36

You can convert these coordinates back to $$r$$ and $$\theta$$ using $$r=\sqrt{x^2+z^2}$$ and $$\theta=\displaystyle \arctan\left(\frac{z}{x}\right)$$.

$$\displaystyle C_x = \frac{\int_{y=0}^{h}\int_{\theta=0}^{2\pi}\int_{r=0}^{a}r\cos(\theta)\rho(r, \theta, y)rdrd\theta dy}{m}$$

$$\displaystyle C_z = \frac{\int_{y=0}^{h}\int_{\theta=0}^{2\pi}\int_{r=0}^{a}r\sin(\theta)\rho(r, \theta, y)rdrd\theta dy}{m}$$

• damn that's a large angle expression, good thing it works – user251865 Jun 12 at 2:10
• Wait I think this solution is a bit problematic. I am numerically solving these triple integrals so the limits need to be constant. The limit for $x$ expressed as $\sqrt{a^2 - z^2} = \sqrt{a^2 - (rsin(\theta))^2}$ varies with $\theta$ right? That does not work for my case. Also are you saying that it would be more accurate if I were to use the larger expression for $\theta$ instead of $arctan(\frac{z}{x})$ as argument for $\rho$? – fullnitrous Jun 12 at 9:40
• yes, about the other expression, because arctan only works for positive x – Saketh Malyala Jun 12 at 10:36
• oh no, i'm literally dumb. the other method (for x, for example) would be to use polar integration, but instead of multiplying by x, multiply by rcostheta, and divide by mass as usual – Saketh Malyala Jun 12 at 10:38
• for z, use polar coordinates again, but multiply by rsintheta, and divide by mass – Saketh Malyala Jun 12 at 10:39

Calculate center of mass along radial direction. Then put $$\theta=0$$ for x direction and $$\theta=\pi/2$$ for z direction

• By radial do you mean in the $y$ direction? Also do i use the same expression for $C_y$ when getting the center of mass for $x$ and $z$ only having the limits changed? – fullnitrous Jun 12 at 0:40
• Actually I am not sure about the answer. I was trying to say that, you calculate $C_r$, then use different values of $\theta$ to find the center of mass the corresponding direction. – Vishal Tripathy Jun 12 at 0:53