The Tank Stays Put. The Balance Point Moves.

Conceptual RC trainer airplane with its fuel tank visible, a spreadsheet on a laptop, and a bench full of measuring tools.
The airplane stays assembled. Its mass and balance still change as fuel disappears.

The fuel tank is fastened to the fuselage. The engine, wings, and battery have not shifted. Yet your small RC airplane might balance at one mark before a flight and at a slightly different mark after it. The missing weight has not moved to the tail. It has left the airplane as fuel burns.

How far can that change move the center of gravity (CG)? And if the mass is no longer spread out the same way, what happens to the moments of inertia (MOI)? Those are familiar questions from our three-mass calculations. The trouble now is the number of parts—and the need to repeat the calculation at more than one fuel level.

Let us put each part on one editable list, then use Python to run the same equations for a full and an empty tank. You can copy both the input and the code from this page; the results will be your own, not a fixed answer hidden in a calculator.

Copy an airplane into Excel

Picture a high-wing, roughly 1.6-meter-class glow-engine RC trainer. This example is fictional. Its components total 2.825 kg at full fuel; the masses and positions are teaching assumptions, not measurements or instructions for a flight-ready airplane.

We need one set of axes before we can do any arithmetic: put the origin near the nose, let +x point aft, +y toward the aircraft's right wing, and +z upward. Use kilograms and meters. Each row below represents a component's mass, the location of its own center, and (when relevant) its overall rectangular dimensions.

Try it without downloading a spreadsheet: select the tab-separated table below, copy it, open a blank Excel workbook, and paste into cell A1. The tabs should put the data into ten columns. If everything lands in one column, choose Data → Text to Columns → Delimited → Tab. Save the sheet as CSV UTF-8 (Comma delimited), with the exact name rc_airplane_input.csv. Keep it in the same folder as the Python file you will create later in this article.

Part	DryMass_kg	FuelFull_kg	x_m	y_m	z_m	Lx_m	Ly_m	Lz_m	Model
Fuselage structure	0.54	0	0.66	0	0	1.15	0.15	0.16	BOX
Left wing assembly	0.32	0	0.59	-0.385	0.09	0.23	0.77	0.04	BOX
Right wing assembly	0.32	0	0.59	0.385	0.09	0.23	0.77	0.04	BOX
Horizontal tail	0.135	0	1.17	0	0.065	0.18	0.52	0.025	BOX
Vertical tail	0.055	0	1.16	0	0.18	0.2	0.04	0.26	BOX
Glow engine	0.425	0	0.155	0	-0.015	0.14	0.11	0.11	BOX
Propeller	0.06	0	0.055	0	-0.015	0.018	0.28	0.025	BOX
Nose landing gear	0.065	0	0.255	0	-0.155	0.12	0.15	0.15	BOX
Main landing gear	0.115	0	0.62	0	-0.21	0.08	0.48	0.17	BOX
Left aileron servo	0.05	0	0.65	-0.38	0.09	0.045	0.035	0.032	BOX
Right aileron servo	0.05	0	0.65	0.38	0.09	0.045	0.035	0.032	BOX
Elevator servo	0.05	0	0.92	0	0.02	0.045	0.035	0.032	BOX
Rudder servo	0.05	0	0.93	0	0.02	0.045	0.035	0.032	BOX
Radio receiver	0.04	0	0.57	0	0.03	0.07	0.04	0.025	BOX
Receiver battery	0.2	0	0.55	0	0.03	0.1	0.065	0.045	BOX
Wiring bundle (point)	0.05	0	0.69	0	0.03	0	0	0	POINT
Fuel tank - dry	0.06	0	0.37	0	0.02	0.17	0.11	0.09	BOX
Fuel (contents)	0	0.24	0.37	0	0.02	0.16	0.105	0.08	BOX

Only ten headings are needed. Part names a component. DryMass_kg remains on the airplane in every fuel case. FuelFull_kg is the mass of its contents when the tank is full. x_m, y_m, z_m locate the component's own CG. Lx_m, Ly_m, Lz_m give full dimensions. BOX means a uniform axis-aligned rectangular solid; POINT ignores the component's own spatial inertia.

Copy component mass and position rows into Excel, save as CSV, and compare RC aircraft fuel-full and fuel-empty cases with Python.
One editable parts list feeds both fuel cases. Python saves its results to outputs/summary.csv.

Notice that the fuel tank shell has DryMass_kg = 0.060. The separate Fuel (contents) row has DryMass_kg = 0 and FuelFull_kg = 0.240. At empty fuel, only the contents disappear. The tank's structure remains. Add a new row or change an existing number whenever you want to experiment.

The block above is tab-separated for easy pasting, while the saved file is comma-separated CSV. The next Python program expects that CSV file, not an .xlsx workbook. That is why it needs no extra packages.

What can a full tank change if the tank never moves?

Our fuel-free components weigh 2.585 kg. Their mass-weighted x-position sum is 1.4598 kg·m. The fuel contents are assigned 0.240 kg at x = 0.370 m, ahead of the fuel-free CG. The tank shell itself is already included in the dry mass.

With no fuel, the first calculation is just the weighted average we learned much earlier:

xCG,empty = 1.4598 / 2.585 = 0.56472 m.

With the fuel added, we add its mass and its mass times position:

Mfull = 2.585 + 0.240 = 2.825 kg

xCG,full = [1.4598 + 0.240(0.370)] / 2.825 = 0.54818 m.

Remember that x increases toward the tail. So when forward fuel disappears, the CG moves aft by 0.56472 − 0.54818 = 0.01654 m, or about 16.5 mm. That result is not a property of all RC airplanes; it is the result of the masses and positions we chose. Move the fuel tank toward the original CG, and the shift gets smaller.

The tank is ahead of the example RC airplane center of gravity. Fuel FULL CG is x 0.5482 m, EMPTY CG is x 0.5647 m, a 16.5 mm aft shift.
Removing forward fuel moves the overall CG aft. The lower scale zooms in to make a 16.5 mm shift visible.

RC builders face a real trade-off: placing a tank near the CG can reduce the shift during fuel burn, but the engine also needs reliable fuel delivery. A discussion among RC builders raised exactly that placement problem. Our table can test the CG effect; it cannot decide the fuel-feed design or a safe CG range for an actual model.

Balance is only half the story

Our previous article showed why each part has inertia even about its own center. A wing's spread-out material matters. Now we must do two jobs for every component: calculate its own inertia and shift that inertia to the whole airplane's current CG.

For a uniform rectangular component with mass m and full dimensions Lx, Ly, and Lz, the own pitch inertia is Iyy,own = m(Lx² + Lz²)/12. If its center is at (x, y, z) and the airplane CG is at (xCG, yCG, zCG), the parallel-axis contribution to the pitch axis is m[(x − xCG)² + (z − zCG)²].

Add those two terms for each part, then add the parts. Do the same for x and z. But notice a new detail: the shared CG in those formulas must be recalculated in each fuel case. Simply subtracting the fuel's own inertia from the full-airplane value would not generally give the right empty-airplane inertia.

The result for our example is:

PropertyFuel fullFuel empty
Mass (kg)2.8252.585
CG x (m)0.548180.56472
Ixx (kg·m²)0.1653360.164987
Iyy (kg·m²)0.2743330.265365
Izz (kg·m²)0.4060260.396967
Pairwise bars show the RC model's roll, pitch, and yaw moments of inertia for full and empty fuel, each recalculated about that case's center of gravity.
All three axial moments change. Their sizes reflect this fictional distribution, not a general rule for RC aircraft.

Why is the roll moment so much less affected than the pitch and yaw moments? Most of the roll inertia in this model comes from the wings, which are already spread far across y. The fuel is near the centerline. By comparison, the fuel's forward position matters more for the axes that use x-distance. This is a physical explanation, not just a row of output numbers.

Our complete program also computes the 3×3 inertia tensor, including the off-diagonal terms we met in the previous lesson. It treats every BOX as a uniform axis-aligned rectangular solid; a POINT has no own inertia. Real curved wings, angled parts, fuel free surfaces, and propeller gyroscopic effects need more careful models. An Excel estimate should never be mistaken for measured flightworthiness.

Copy one Python file, then run it

The next block is the whole working program, not an excerpt. Copy it into a plain-text editor such as VS Code or Notepad and save it as main.py beside rc_airplane_input.csv. No Google Drive, extra Python files, or third-party packages are needed.

On Windows, if Notepad tries to save main.py.txt, choose Save as type → All files and name it main.py. The folder should contain main.py and rc_airplane_input.csv side by side.

"""Lumentora 44: RC airplane mass properties from a copy-paste CSV.

Put main.py and rc_airplane_input.csv in the SAME folder.
Python 3 standard library only. Run: python main.py
Optional additional case: python main.py --fuel 0.5

Coordinates: +x aft, +y aircraft right, +z upward.
Masses in kg, locations and BOX dimensions in meters.
BOX parts are uniform, axis-aligned rectangular solids; POINT parts
have no inertia about their own centers. Educational model, not
flightworthiness or manufacturer's weight-and-balance data.
"""
import argparse
import csv
from math import isfinite
from pathlib import Path

HERE = Path(__file__).resolve().parent
INPUT = HERE / "rc_airplane_input.csv"
OUTPUT = HERE / "outputs" / "summary.csv"
COLUMNS = ["Part", "DryMass_kg", "FuelFull_kg", "x_m", "y_m", "z_m",
           "Lx_m", "Ly_m", "Lz_m", "Model"]


def load_parts(path):
    if not path.exists():
        raise FileNotFoundError(f"Save the Excel sheet as CSV UTF-8 here: {path}")
    parts = []
    with path.open(newline="", encoding="utf-8-sig") as file:
        reader = csv.DictReader(file)
        if reader.fieldnames != COLUMNS:
            raise ValueError("CSV headers must match: " + ", ".join(COLUMNS))
        for row_no, row in enumerate(reader, start=2):
            if all(not str(v or "").strip() for v in row.values()):
                continue
            try:
                name = (row["Part"] or "").strip()
                dry = float(row["DryMass_kg"])
                fuel = float(row["FuelFull_kg"])
                pos = tuple(float(row[k]) for k in ("x_m", "y_m", "z_m"))
                model = (row["Model"] or "").strip().upper()
                size = tuple(float(row[k] or 0) for k in ("Lx_m", "Ly_m", "Lz_m"))
            except (ValueError, TypeError) as error:
                raise ValueError(f"CSV row {row_no}: invalid field: {error}") from error
            numbers = (dry, fuel, *pos, *size)
            if not name or not all(isfinite(v) for v in numbers):
                raise ValueError(f"Row {row_no}: missing name or nonfinite value")
            if dry < 0 or fuel < 0 or dry + fuel <= 0:
                raise ValueError(f"Row {row_no}: invalid component masses")
            if model not in ("BOX", "POINT"):
                raise ValueError(f"Row {row_no}: Model must be BOX or POINT")
            if model == "BOX" and any(v <= 0 for v in size):
                raise ValueError(f"Row {row_no}: BOX lengths must be positive")
            parts.append((name, dry, fuel, pos, size, model))
    if not parts:
        raise ValueError("The input CSV has no parts")
    return parts


def calculate(parts, fuel_fraction):
    if not 0 <= fuel_fraction <= 1:
        raise ValueError("Fuel fraction must be between 0 and 1")
    current = [(p, dry + fuel_fraction * fuel, pos, size, model)
               for p, dry, fuel, pos, size, model in parts]
    total_mass = sum(mass for _, mass, _, _, _ in current)
    if total_mass <= 0:
        raise ValueError("Total mass must be positive")
    cg = tuple(sum(mass * pos[k] for _, mass, pos, _, _ in current)
               / total_mass for k in range(3))
    tensor = [[0.0] * 3 for _ in range(3)]
    for name, mass, pos, size, model in current:
        if mass == 0:
            continue  # Empty fuel has no mass; the tank shell is a separate row.
        dx = [pos[k] - cg[k] for k in range(3)]
        radius_sq = sum(v * v for v in dx)
        own = [0.0, 0.0, 0.0]
        if model == "BOX":
            lx, ly, lz = size
            own = [mass * (ly**2 + lz**2) / 12,
                   mass * (lx**2 + lz**2) / 12,
                   mass * (lx**2 + ly**2) / 12]
        for i in range(3):
            for j in range(3):
                # Own inertia + the 3D parallel-axis theorem.
                tensor[i][j] += (own[i] if i == j else 0.0) + mass * (
                    (radius_sq if i == j else 0.0) - dx[i] * dx[j]
                )
    return total_mass, cg, tensor


def main():
    parser = argparse.ArgumentParser(description="RC airplane CG and MOI from CSV")
    parser.add_argument("--fuel", type=float, default=None,
                        help="Add a fuel fraction, e.g. 0.5 for 50 percent")
    args = parser.parse_args()
    parts = load_parts(INPUT)
    cases = [("Full", 1.0), ("Empty", 0.0)]
    if args.fuel is not None and args.fuel not in (0.0, 1.0):
        cases.append((f"{args.fuel:.0%}", args.fuel))
    results = []
    for label, fraction in cases:
        mass, cg, I = calculate(parts, fraction)
        results.append([label, fraction, mass, *cg,
                        I[0][0], I[1][1], I[2][2], I[0][1], I[0][2], I[1][2]])
        print(f"{label:>5} | mass={mass:.3f} kg | CG x={cg[0]:.5f} m | "
              f"Ixx={I[0][0]:.6f}, Iyy={I[1][1]:.6f}, Izz={I[2][2]:.6f}")
    OUTPUT.parent.mkdir(parents=True, exist_ok=True)
    with OUTPUT.open("w", newline="", encoding="utf-8-sig") as file:
        writer = csv.writer(file)
        writer.writerow(["Case", "FuelFraction", "Mass_kg", "CGx_m", "CGy_m", "CGz_m",
                         "Ixx_kgm2", "Iyy_kgm2", "Izz_kgm2", "Txy_kgm2", "Txz_kgm2", "Tyz_kgm2"])
        writer.writerows(results)
    print("Open the results in Excel:", OUTPUT)


if __name__ == "__main__":
    main()

Open a terminal in that folder and run:

python main.py

If your system uses python3, run python3 main.py instead. The script reads rc_airplane_input.csv, computes the full- and empty-fuel CG and 3×3 inertia tensor, prints a short summary, and creates outputs/summary.csv. Open that results CSV in Excel.

Want an extra halfway case? Run python main.py --fuel 0.5. The default fictional model gives 2.705 kg and CG x ≈ 0.55608 m at 50% fuel. Fuel fractions must be between zero and one.

Why does the program loop over rows twice? It first calculates the current total mass and CG. Only then can it find each component's distance from that shared CG, combine its own box inertia with the parallel-axis shift, and add its contribution to the tensor. That order is the mathematics we learned in the earlier articles.

If you already have an Excel workbook of your own, make a sheet with the same ten headings and export just that sheet as CSV UTF-8. Do not rename the headings or change their order. The program reads every nonempty row, so new parts require no changes to the Python source.

Move the tank. Check your prediction.

Try this first: move the whole fuel tank toward the airplane’s dry CG. In Excel, change x_m from 0.370 to 0.550 in both the Fuel tank - dry row and the Fuel (contents) row. Save the CSV and run the program again. The empty-fuel CG becomes about 0.56890 m, and the full-fuel CG about 0.56729 m. Their difference is only 1.6 mm, instead of 16.5 mm. We moved the tank shell as well as its contents, so we did not leave the fuel behind.

For a second test, restore the original input and move the Receiver battery from x = 0.550 to 0.600 m. The full-fuel CG becomes about 0.55172 m and the empty-fuel CG about 0.56859 m. Both move aft, but by slightly different amounts because the total masses are different. Finally, run python main.py --fuel 0.5 with the original input. It adds a half-fuel case of 2.705 kg and CG x ≈ 0.55608 m without another spreadsheet.

Nothing in this input table is sacred. Add a servo, edit a battery mass, or replace a point-mass estimate with a simple box. The same program reads the new rows. For a real design, however, the assumed shapes and fuel distribution would need checking against measurements. At half fuel this teaching program scales the fuel mass while keeping its assigned center and box shape fixed; a real partly filled tank may not behave that way.

There is still a critical boundary. The numbers here do not determine whether an RC airplane is safe to fly. You would need the actual manufacturer's recommended CG range, accurate parts and fuel measurements, geometry, control setup, and appropriate ground and flight checks. This model is a way to think and calculate—not permission to skip those steps.

If the tank is moved closer to the airplane’s CG, the calculated shift becomes smaller. If a battery moves aft, the result changes again. The code will recalculate both, but the useful question is still yours: does the new answer make sense for where the mass actually sits? In this example the tank stayed in place while the fuel disappeared—and the balance point moved.

Sources and further reading