Calculate rocket centre of mass

I wish to calculate the centre of mass of a two stage rocket, for example the Falcon 9. Since the mass of the rocket is constantly changing (first the mass of the first stage is depleting, then the second stage), how do I go about calculating the instantaneous centre of mass?

I'm assuming each stage consists of a hollow outer cylinder made of say, aluminium, and within it a cylindrical shaped propellant which is constantly being depleted. Then there is a payload at the top in the shape of, for example, a nosecone.

Any help is appreciated!

• A good question, welcome to the site. What you have described is a solid fuel rocket, Falcon (and most other) rockets are liquid fueled, where there are 2 cylindrical tanks for fuel and oxidizer.
– GdD
Mar 11, 2020 at 15:11
• The fuel "cylinders" can be considered to be fixed at their bases and reducing in height
– user20636
Mar 11, 2020 at 15:33
• Related, possible duplicate: space.stackexchange.com/q/30557/6944 Mar 11, 2020 at 16:18
• – uhoh
Mar 12, 2020 at 1:20
– Lisa
Mar 12, 2020 at 5:11

$$X_{cm} = \frac{(m_1*X_{cm1} + m_2*X_{cm2} +...)}{(m_1+m_2+...)}$$