---
title: "Recompute five fixed gas slices"
description: "Use an independent offline package to recompute disk mass, binding, star formation and the static restoring-force reference from five exact synthetic slices."
canonical_url: "https://sandboxphysics.com/stories/ram-pressure-stripping/recompute-five-fixed-gas-slices/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/ram-pressure-stripping/recompute-five-fixed-gas-slices/"
last_modified: "2026-11-11"
---

[Ram pressure and returning gas](https://sandboxphysics.com/stories/ram-pressure-stripping/)

Ram pressure and returning gas · L3

# Recompute five fixed gas slices

Sandbox Physics · 2026-11-11

Open the standalone package beside this guide. You will start from five fixed 64-sheet gas slices, recover the position and energy tests, and independently calculate the static restoring-force curve. The result is a reproducible diagnostic of specified synthetic data.

## Before you begin

Read the two preceding chapters. You need arrays, units, kinetic energy and simple Python. NumPy and SciPy handle array operations and the one-dimensional numerical search.

## Open the input before running the calculation

The file inputs/fixed-slices.json contains five snapshots. The first three use $q=0$ at frame 49, 64 and 128; their model times are minus 2.34375, 150 and 800 million years. The final two use $q=2.72$ and $q=4$ at frame 79, both at 302.34375 million years. They are our own synthetic results, not an observed galaxy catalogue.

Each slice carries 64 rows and 13 fields. The first six are Cartesian position and velocity in the galaxy rest frame, with the disk normal along $z$. Positions use kiloparsecs and velocities kiloparsecs per million years. The next fields retain work, dissipation, input energy, gas and birth mass, birth energy and birth angular momentum. Read fieldOrder before reshaping.

The common block gives initial radii, masses and fixed areas. The source-archive and full-record hashes identify where a slice came from; the public package contains selected slices with those source identities. Its fixed input SHA is e536102615f5fc2bfdda56b4374dc63fc0307229a0a248c6e84a7ab8ad2638ca.

Reading: Original fixed-slice and static-restoring-force materials

## Run once in an ordinary Python environment

Unpack the ZIP into its own folder and install the declared dependencies in a virtual environment if needed. The calculation itself is offline. recompute.py calls the independent criterion.py, checks the supplied fixed reference and writes recomputed.json.

The script evaluates the slices, searches restoring-force maxima and calculates colour ratios from a small set of our band luminosities. It does not integrate new gas paths or rebuild the stellar spectrum convolution. Keeping that distinction visible tells you which part of the chain you have actually repeated.

The input numbers are written with full decimal roundtrip precision. Keep full roundtrip precision while calculating binding, then round the displayed values.

```
python recompute.py --out recomputed.json
```

Reading: Original fixed-slice and static-restoring-force materials

## Make the disk and binding masks yourself

For each row, calculate cylindrical radius from the two in-plane coordinates. A row belongs to the disk only when radius is at most 16 kiloparsecs and the absolute height is at most 1 kiloparsec. Sum current gas mass over those rows, then divide by the 2000-million-year consumption time and convert to a yearly rate.

For binding, add half the squared speed to the external potential evaluated at the same position. The potential contains the declared bulge, halo and disk and tends to zero at infinity. Use all three velocity components. Positive energy gives the currently unbound mask; it is independent of the disk mask.

On the first $q=0$ slice you should recover an outside fraction 0.265625, a current unbound fraction zero, and a disk rate about 0.186096 solar masses per year. At frame 64, the outside fraction is still 0.265625 but the positive-energy fraction is 0.0625. This is a useful test against accidentally using the same mask twice.

$$
R=\sqrt{x^2+y^2},\qquad e=\tfrac12(v_x^2+v_y^2+v_z^2)+\Phi(R,z)
$$

The code uses kpc and Myr internally. Energy per unit mass therefore has units $\mathrm{kpc}^2\,\mathrm{Myr}^{-2}$. A later wind can still change this current energy.

Reading: Original fixed-slice and static-restoring-force materials

## Rebuild the local static comparison

criterion.py differentiates the specified potential analytically to obtain the positive-height restoring acceleration. At each initial radius it samples a logarithmic height grid, locates every resolved local maximum bracket, and refines the candidates. The search extends to 10000 kiloparsecs; a total-mass inverse-square bound keeps the unsearched tail below the selected maximum.

It repeats the search on 256 and 512 grids. Preparation also compared 512 with 1024. These finite checks test whether changing the sampled brackets changes the numerical maximum. They are not a mathematical proof that an arbitrary, differently shaped potential has no unresolved peak.

Two pressure curves multiply the same acceleration by different columns: the initial mass divided by fixed area, and that column consumed to nominal closest approach, multiplied by the exponential factor for 500 million years. Actual sheets also move radially. The curves are explicitly fixed-radius quasi-static references, not a fitted stripping radius or a finite-pulse escape prediction.

![Static fixed-radius restoring pressure for initial and nominal closest-approach gas columns](https://sandboxphysics.com/_astro/force.C0w_4Omt.svg)

Independent numerical maxima of the original declared potential at $64$ initial radii. Blue uses initial columns; gold multiplies them by $\exp(-500/2000)$. The horizontal line is the central incident peak. These are local quasi-static references, not a finite-pulse escape prediction. [Open the full figure](https://sandboxphysics.com/_astro/force.C0w_4Omt.svg)

Reading: Original fixed-slice and static-restoring-force materials · Köppen, Jáchym, Taylor & Palouš, Ram Pressure Stripping Made Easy, arXiv:1806.05887v1 (2018)

## Check a force without trusting its own plot

The independent mathematical checks use two other routes. First, the vertical work integral of restoring acceleration must equal the potential difference between the midplane and a large height. Second, an isolated Plummer bulge has a known maximum, obtained by differentiating its simple analytic force. These tests check sign, units and the force–potential relation.

The preparation gave relative differences near 2.22 times ten to the minus 16 for both controls. Those tiny finite arithmetic residuals do not measure astrophysical uncertainty. The most consequential physical assumption remains the uniform centre-sampled wind applied even to the far tail.

Finally, compare disk and all-gas rates at matched times for $q=2.72$ and q4. The all-gas values should agree, while the weakly lifted gas changes the disk count. A result that instead claims global wind quenching has changed the prescribed consumption model.

Reading: Original fixed-slice and static-restoring-force materials

## Keep a short calculation note

Record the input hash, units, model time, aperture definition, potential zero and numerical refinement. Keep the static reference separate from the actual trajectory result. If you change a column, potential or consumption time, save a new input and state exactly which comparison changed.

The population block is a second small exercise: it contains two input histories, three dust screens, four exact ages and five bands. The script recalculates $g-r$ from those band luminosities. Recomputing the original SSP convolution would additionally require the fixed native spectral input and its normalization conventions, discussed in the next chapter.

Reading: Original fixed-slice and static-restoring-force materials

## Exercises and explained answers

1. Why is the same unit convention needed for velocity and potential?

   Read the explanation

   Kinetic and potential energy are added. Mixing kilometres per second with a potential in kpc squared per Myr squared changes the result by a large conversion factor.

2. Your static curve agrees, but your disk rate is wrong. What should you inspect first?

   Read the explanation

   Check the aperture mask and gas-mass field index, sum current gas masses, then verify the per-Myr to per-year conversion.

## Try the prediction

### [Follow gas lifted by a cluster wind](https://sandboxphysics.com/labs/ram-pressure-stripping/)

1. Export the current frame from the Lab and compare its field order and units with the package.
2. Compare the first two $q=0$ slices and explain why their outside fractions agree while their current binding fractions differ.

## Independent scientific materials

[Download the offline scientific ZIP](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/ram-pressure-science-v1.zip) · [Read units and calculation scope](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/README.md)

Python, NumPy and SciPy recompute the five fixed synthetic slices, the local static restoring-force reference and four-age global colour ratios. This package evaluates saved scientific data; original gas integration and native SSP convolution are separate calculations.

Files, sizes and SHA-256

- [README.md](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/README.md) (4173 B)
  `963ce7a0921c497a5556558faa685310a3ad424db826831c794f031492b7ad90`
- [requirements.txt](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/requirements.txt) (27 B)
  `39b93fa1b8397265839a510ca7601608248a7f3524067b61667e977bf4351475`
- [criterion.py](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/criterion.py) (4267 B)
  `ab0ce3a9e95a01ca886e3a9f997e162cee4c7d9081d36c7e1cec2ae5d1c1b2e0`
- [recompute.py](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/recompute.py) (2612 B)
  `47b44c4dd30ddecb64226dc6f1b0c59c6e25e769ec8e8885f38b581b77b68a5f`
- [fixed-slices.json](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/fixed-slices.json) (82090 B)
  `e536102615f5fc2bfdda56b4374dc63fc0307229a0a248c6e84a7ab8ad2638ca`
- [expected.json](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/expected.json) (19249 B)
  `4816379eba85e94a8477f6268b8186cba5b23f8ee2f079075cff31fcf7ef7d0e`
- [ram-pressure-science-v1.zip](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/ram-pressure-science-v1.zip) (45741 B)
  `979dbcbd25d63a9a9f79e85f921976d051c46a57eac82f21713dee288297a2f2`

[Previous: Follow fuel across the disk boundary](https://sandboxphysics.com/stories/ram-pressure-stripping/follow-fuel-across-the-disk-boundary/) [Next: Why global colour needs a history](https://sandboxphysics.com/stories/ram-pressure-stripping/why-global-colour-needs-a-history/)

## Sources and calculation scope

1. [Köppen, Jáchym, Taylor & Palouš, Ram Pressure Stripping Made Easy, arXiv:1806.05887v1 (2018)](https://arxiv.org/abs/1806.05887v1)

   Sections2.1–2.2 and5.4 explain the slow-pressure/impulse limits and re-accretable gas. Our fixed three-component potential, equal-mass sheets and consuming gas are specified independently; the own static comparison does not reproduce every published simulation or observational sample.

2. [Original fixed-slice and static-restoring-force materials](https://sandboxphysics.com/stories/ram-pressure-stripping/materials/ram-pressure-science-v1.zip)

   Our five exact synthetic slices with sixty-four sheets and thirteen fields, initial common arrays, two global-light histories/three screens/four-age band subset, independent Python static maxima and mask/energy/colour diagnostics. Original trajectory and native SSP production are distinct earlier calculations; this offline package repeats diagnostics and band ratios. No browser Engine, original FITS/SED, paper, author code or observed-galaxy data is included.
