>[!warning]
>This content has not been peer reviewed.
# SPARC evaluation — implementation (rst + notebooks)
This note documents the **code** in this folder: the **rst** package and the **notebooks** that run the SPARC evaluation. For **method and data source** see **[[../python calculations/SPARC Evaluation - Code]]**. For **results summary** see **[[../python calculations results/SPARC Evaluation Results]]**.
---
## Purpose
- **rst:** Implements the RST gravity-sector pipeline: $\mu(\eta,n)$, solvers for $q'$ from $g_N$, cosmology $a_0(z)$, $n(z)$, and rotation-curve prediction $v(r) = \sqrt{r \cdot q'}$.
- **notebooks:** Scripts that load SPARC data, fit $\Upsilon_{\text{disk}}$, and produce plots and CSV outputs (e.g. RAR curve, rotation curves, high-z shift).
---
## Engine (same as applications)
**`rst/interpolation.py`** does **not** reimplement the core maths. It imports from the shared **`rst_engine`** at the workspace root:
- **$\mu(\eta,n)$:** `mu_rst(eta, n)` from `rst_engine`.
- **Solve for $q'$:** For generic $n$, `solve_acceleration(g_N, a0, n)` calls `solve_omega(g_N, a0, n)` from `rst_engine` (same equation: $I = \Omega \cdot \mu(\Omega/N)$ with $I = g_N$, $N = a_0$, $\Omega = q'$). Closed-form solvers for $n=1$ and $n=2$ remain in rst for speed.
**Path:** From `rst/`, the workspace root is three levels up; `sys.path` is set in `interpolation.py` so that `from rst_engine import mu_rst, solve_omega` works.
See **[[../../expanded theory applied/How we do applications]]** for how all scripts plug into the engine.
---
## What lives where
| Component | Location | Role |
|:---|:---|:---|
| $\mu$, generic solver | `rst_engine` (workspace root) | Single implementation shared with applications |
| Closed-form $n=1$, $n=2$ | `rst/interpolation.py` | Speed; same maths as engine |
| $a_0(z)$, $n(z)$, $H(z)$ | `rst/cosmology.py` | RST cosmology for evaluation |
| $g_N \to v(r)$ | `rst/rotation_curve.py` | Uses `solve_acceleration` and cosmology |
| Scripts (RAR, rotation curves, SPARC fit) | `notebooks/*.py` | Load data, call rst, write `notebooks/output/` |
---
## Outputs
- **`notebooks/output/`** — PNG plots (e.g. RAR, rotation curves, high-z), CSV result tables (e.g. `sparc_results.csv`, `sparc_float_n_results.csv`).
- **Results note:** **[[../python calculations results/SPARC Evaluation Results]]** summarises fit statistics (median $\Upsilon_{\text{disk}}$, $\chi^2$ rates).
---
## Links
- **Method and data:** [[../python calculations/SPARC Evaluation - Code]]
- **Verification and interpretation:** [[../python calculations/SPARC Evaluation Verification]]
- **Results summary:** [[../python calculations results/SPARC Evaluation Results]]
- **Engine:** `rst_engine/` at workspace root ([[../../rst_engine/README]])
- **Applications guide:** [[../../expanded theory applied/How we do applications]]