# Centroid of a Bottle

1. Oct 25, 2013

### cytochrome

I'm trying to find the centroid of a coke bottle, which is basically like a cylinder with varying radius.

I have a 1x500 vector of radius points and I have the volume of the bottle, any thoughts on how to calculate the centroid numerically?

2. Oct 25, 2013

### Khashishi

When you say radius points, do you mean you have a set of points (z,r) which represent some surface of revolution? If you assume such a cylindrical symmetry, then it's clear that the centroid must lie on the cylindrical axis.

Are you talking about a full bottle or empty bottle? If you are talking about a full bottle, you can use something like
EDIT: formula was wrong.
$\left< z \right> = \frac{\int z 2\pi/3 r^3 dz}{\int 2\pi/3 r^3 dz}$
You'll have to find r as a function of z. You can do this with a spline interpolation. It is common to use cubic splines. I'll let you search for resources on how to do that. Anyways, you'll get a bunch of cubic segments. To integrate over the curve, you'll integrate over each cubic segment (which you can do analytically), and take the sum.

Last edited: Oct 25, 2013
3. Oct 25, 2013

### cytochrome

Thanks! Yes I have r as a function of z and I have the appropriate curves obtained from spline interpolation. My bottle is hollow and has a certain thickness, how will that change the problem?

4. Oct 25, 2013

### SteamKing

Staff Emeritus
Find the centroid of the empty space. Find the centroid of the outer surface. Use the principle of moments to find the centroid of what's left.

5. Oct 25, 2013

### cytochrome

How does the principle of moments apply here?

6. Oct 25, 2013

### Khashishi

In that case, if you neglect the thickness, you can integrate the arc length over the surface of revolution
http://en.wikipedia.org/wiki/Arc_length

In the numerator, you integrate everything weighted by z, and in the denominator, you integrate the same thing without the z.

7. Oct 25, 2013

### Staff: Mentor

I have an interesting way of doing this that I think will appeal to you. Rather than representing r as a function of z, represent r and z parametrically as a function of the contour arc length s: r = r(s) and z = z(s) such that
$$(dr)^2 +(dz)^2=(ds)^2$$
Next, define the contour angle θ of the bottle by tanθ=dr/ds.

We are going to determine the function θ=θ(s) which best fits the contour shape of the bottle. We do this as follows: Write the equations for the variation in r and z as functions of s:

$$\frac{dr}{ds}=sinθ(s)$$
$$\frac{dz}{ds}=cosθ(s)$$

These equations guarantee that the sum of the squares of the differential changes in r and z are equal to the square of the differential change in the contour length.

We are going to solve these equations for r and z as functions of s for a given prescribed variation in θ(s). We are going to be seeking the best representation of θ(s) that matches the contour shape of the coke bottle. To do this, we are going to express θ(s) as a cubic spline function of s, by specifying just a limited number of values of θ (say <10) along the contour, and we will seeking the set of θ values at these locations that minimizes the sum of the squares of the distances from the predicted contour to the actual contour. This will involve integrating the above equations multiple times, and varying the θ values at the prescribed points to minimize the deviation. Once we know θ as a function of s, we can add the following two differential equations (assuming the bottle thickness is constant):

$$\frac{dM}{ds}=2πr(s)z(s)$$
$$\frac{dS}{ds}=2πr(s)$$
where M is the cumulative moment with respect to z = 0, and S is the cumulative surface area.

The center of mass, as measured from the bottom of the bottle is M/S evaluated at the value of s corresponding to the top of the bottle.

8. Oct 25, 2013

### cytochrome

How can I use this principle to solve for the centroid of a hollow body? How does that change the centroid equation?

9. Oct 25, 2013

### SteamKing

Staff Emeritus
If you can describe the outer surface of the bottle (by whatever means), you can calculate the volume and centroid of this surface. Do likewise for the interior of the bottle. The volume and centroid of the material forming the bottle must be the difference between the two.

To be clear, by principle of moments, I mean that Vb*cb = VO*cO-VI*cI, where

Vb - V bottle
cb - centroid of the bottle

VO - Volume of outer surface
cO - centroid of outer surface

VI - Volume of bottle interior surface
cI - centroid of bottle interior surface

10. Oct 25, 2013

### cytochrome

11. Oct 25, 2013

### cytochrome

Thanks a lot for this, it's always nice to have more than one way for going about something

12. Oct 25, 2013

### cytochrome

I think that formula is incorrect, correct me if I'm wrong.

13. Oct 26, 2013

### Staff: Mentor

The method I described in #7 was an approach we used in actual engineering practice in the man-made fiber company I worked for back in the day to parameterize the cross sectional geometry of radial automobile tires (measured using plaster casts), as part of our analysis of the deformational mechanics of the tires under operational loading conditions. This was in support of sales and customer service to our tire cord customers in the tire industry.

As a supplement to the analysis I presented in #11, I might also mention that, if the thickness of the bottle is variable along the contour of the bottle, this can be accounted for simply by multiplying the right hand sides of the last two differential equations by the local thickness t(s).

Last edited: Oct 26, 2013