---
title: "Fit moving knots without hiding the viewing-angle ambiguity"
description: "Fit frozen synthetic positions, inspect residuals, and compare a two-sided solution with a one-sided family of allowed speeds and angles."
canonical_url: "https://sandboxphysics.com/stories/relativistic-jets/fitting-moving-knots/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/relativistic-jets/fitting-moving-knots/"
last_modified: "2026-11-13"
---

L3 · Method guide

# Fit moving knots without hiding the viewing-angle ambiguity

Sandbox Physics · 2026-11-13

Two measured outward speeds can determine a speed and viewing angle under a symmetric constant-speed model. One measured side instead leaves a whole curve of possibilities. This exercise fits saved synthetic positions first, checks whether straight tracks describe them, and only then attempts the geometric inversion.

Use the [portable knot-fitting exercise](https://sandboxphysics.com/stories/relativistic-jets/materials/relativistic-jets-tutorial.zip) beside this guide. It contains three frozen synthetic cases, thirty position measurements in total, and a Python standard-library analysis. They are teaching measurements, not telescope data. The input files contain positions and quoted uncertainties; the fitting program does not read hidden generation parameters.

## Inspect what a row means

Each CSV row gives side, arrival\_time\_T0, sky\_position\_L0 and position\_sigma\_L0. The first identifies the knot. The next three columns contain the arrival epoch, signed position along the sky-projected approaching axis, and a positive one-standard-deviation position uncertainty. The time unit is $T_0=L_0/c$, so a fitted position slope has units of light speed. A positive receding-side outward speed is the negative of its fitted signed slope.

The exercise assumes the distance scale is already known. Actual angular proper motions would also require a distance conversion and, for a cosmological source, the appropriate redshift factor. Here the epochs are treated as exact, position errors as independent Gaussian errors, and each detected side has its own free intercept. A freely fitted intercept avoids forcing a noisy position sequence through a presumed origin.

## Run the saved-position analysis

Download the ZIP into a new directory. Extract it with Python, enter the extracted directory, and run the analysis against the saved inputs:

```
python3 -m zipfile -e relativistic-jets-tutorial.zip jet-fit
cd jet-fit
python3 verify_bundle.py
python3 analyze_saved_knots.py --inputs inputs --out rerun
python3 verify_bundle.py --rerun rerun
```

The first verification command checks the downloaded members against their manifest. The last compares the fresh analysis with the supplied saved outputs, using the documented numerical tolerances. The fitter itself reads only the input CSV files. No additional Python package is needed. The analysis creates analysis.json, fit-residuals.csv and one-sided-degeneracy.csv inside rerun. Choose another new output-directory name for a repeat; an existing output directory is deliberately refused. Keep inputs unchanged so that you are analysing the same measurements.

The terminal reports a status for each case. A scientific rejection of constant speed is one expected result and does not by itself mean that the program failed. A malformed record, nonpositive uncertainty or unusable set of epochs instead stops the command with an error. Read that first error, keep any outputs already written, and correct the input or invocation before starting in another output directory.

## Estimate a slope without treating every point equally

For one side, write the position model as $x_i=b+mT_i$. The intercept $b$ and slope $m$ are fitted; the quoted uncertainty of point $i$ is $\sigma_i$. Weighted least squares minimizes

$$
\chi^2=\sum_i\frac{(x_i-b-mT_i)^2}{\sigma_i^2}.
$$

A more precise point receives greater weight $w_i=1/\sigma_i^2$. Let $\bar T$ and $\bar x$ be the corresponding weighted means. Subtracting the means leaves the slope formula

$$
m=\frac{\sum_i w_i(T_i-\bar T)(x_i-\bar x)}{\sum_i w_i(T_i-\bar T)^2},
$$

followed by $b=\bar x-m\bar T$. Centering time also makes the calculation less sensitive to a large arbitrary time origin. With known independent errors, the formal slope variance is

$$
\sigma_m^2=\frac{1}{\sum_i w_i(T_i-\bar T)^2}.
$$

These are uncertainty statements under the stated error model. The analysis does not silently rescale all uncertainties to force a reduced chi-square of one.

## Read the residuals before converting the speeds

A residual is observed position minus fitted position. Divide by its quoted uncertainty to see how large it is relative to the measurement error. Six epochs with two fitted parameters leave four degrees of freedom per side. The chi-square survival probability asks how often the assumed straight-line model and errors would produce a statistic at least this large.

The exercise declares a rejection threshold of $0.001$ before inspecting the cases. A result above that threshold does not prove constant motion. A result far below it says that the straight track or the supplied errors are inadequate.

![Saved one-sided speed-angle degeneracy and normalized residuals of a rejected straight-track model.](https://sandboxphysics.com/stories/relativistic-jets/figures/fitted-tracks.en.desktop.svg)

Original figure from the saved synthetic exercise: the one-sided measured slope leaves an angle–speed curve, and the accelerating case leaves curved normalized residuals after a straight-line fit. The residual zero line is a fitted-model reference; the points are the saved position residuals.

Case C is designed to expose that distinction. Its approaching-side chi-square is about $4282$ for four degrees of freedom. The reported survival probability rounds to zero numerically; it is extremely small, not an exact assertion that a probabilistic event is impossible. The receding-side probability is about $3.39\times10^{-7}$. The analysis returns rejected-constant-speed-or-error-model and supplies no ballistic speed–angle estimate. A narrow slope error cannot rescue an unsuitable straight-line model.

## Invert an accepted two-sided fit

Call the fitted positive outward apparent speeds $a$ and $r$. The arrival geometry gives two useful combinations:

$$
\begin{aligned}
u&=\frac{a-r}{a+r}=\beta\cos\theta,\\
v&=\frac{2ar}{a+r}=\beta\sin\theta.
\end{aligned}
$$

The symbol $u$ here labels a dimensionless longitudinal combination, not the Stokes parameter from the polarization chapter. Recover the actual speed fraction and viewing angle with

$$
\begin{aligned}
\beta&=\sqrt{u^2+v^2},\\
\theta&=\operatorname{atan2}(v,u).
\end{aligned}
$$

Check that the speed is subluminal and the angle is in the intended approaching range. An algebraic answer outside that range is a physical inconsistency under these assumptions.

In Case A the measured slopes are about $1.96654$ and $-0.291950$ in light-speed units. The inversion gives $\beta\simeq0.89903$ and $\theta\simeq34.438^\circ$. First-order propagation of the independent fitted slope errors gives approximately $0.00095$ and $0.411^\circ$ as one-standard-deviation errors. These local propagated errors are not a full joint confidence region and do not include distance, shared calibration or pattern–flow uncertainty.

## Keep the one-sided answer as a curve

For Case B only the approaching side is measured. Its fitted apparent speed is about $4.61161$, with formal slope error about $0.00797$. Rearranging one apparent-speed equation gives

$$
\beta(\theta)=\frac{a}{\sin\theta+a\cos\theta}.
$$

Every admissible point on this curve predicts the same measured slope. Changing angle and speed together can leave the track unchanged. The output lists ninety-seven sampled subluminal possibilities, not ninety-seven independent measurements. The point slope gives a minimum Lorentz factor of about $4.71879$.

The two extra speed columns map the fitted slope plus or minus $1.96$ formal errors at each fixed angle. They are pointwise transformations of a one-dimensional slope interval. They do not turn the whole curve into a unique angle, and they are not a joint ninety-five-percent region for speed and angle. Their subluminal flags tell you whether those mapped bounds still lie below light speed.

## Try changing the question

1. Remove the receding-side measurements from Case A. Which part of the inference survives?
2. Give every position an uncertainty twice as large without changing any measured positions. What happens to the slope and to chi-square?
3. Why must a physical brightness ratio not be inserted into the isotropic ratio formula to close Case B automatically?

Explained answers

The approaching slope remains measurable, but two unknown kinematic parameters now share one equation. Retain a speed–angle family and a model-dependent lower bound, rather than the former unique two-sided inversion.

All weights fall by the same factor, so the fitted slope and intercept stay the same. Formal parameter errors double and chi-square falls by a factor of four. This shows why the assumed measurement uncertainties matter to a model-rejection test.

The ordered-field intensity includes a rest-frame angular factor as well as Doppler boosting. Intrinsic side differences and a possible distinction between pattern and emitting-plasma speeds add further assumptions. Another observation helps only when its physical model is stated.

## Sources

- The downloadable exercise contains its saved input tables, analysis source, saved outputs and provenance description. The numerical examples above come from those saved measurements and fits. [Portable synthetic exercise](https://sandboxphysics.com/stories/relativistic-jets/materials/relativistic-jets-tutorial.zip).
- Urry and Padovani (1995), Appendix A, A4 and the assumptions connecting pattern and bulk speed. [Relativistic motion geometry](https://ned.ipac.caltech.edu/level5/Urry1/UrryP_appena.html).
- Urry and Padovani (1995), Appendix B, especially the paragraphs after B6. [Radiation assumptions for a second constraint](https://ned.ipac.caltech.edu/level5/Urry1/UrryP_appenb.html).

## Try the prediction

### [Compare a track with a position fit](https://sandboxphysics.com/labs/relativistic-jets/)

1. Predict whether one apparent speed selects one actual speed and viewing angle.
2. Hold the Lab speed and viewing angle at a chosen pair, export its track, and compare its signed slopes with the formula in the guide.
3. Use the separate downloaded synthetic-position exercise for uncertainty and residual tests; the Lab export is a noiseless model track.

## Keep reading

How a relativistic jet reaches our telescope · Reading path

### How a relativistic jet reaches our telescope

1. [Article **How a jet can outrun light across a photograph**](https://sandboxphysics.com/stories/relativistic-jets/seeing-superluminal-motion/)
2. [Article **Build a photograph from emission and arrival times**](https://sandboxphysics.com/stories/relativistic-jets/emission-and-arrival-times/)
3. [Article **Doppler brightness and the speed of a moving pattern**](https://sandboxphysics.com/stories/relativistic-jets/doppler-brightness-and-moving-patterns/)
4. [Article **Read polarization before drawing a magnetic field**](https://sandboxphysics.com/stories/relativistic-jets/stokes-and-projected-magnetic-fields/)
5. [You are here **Fit moving knots without hiding the viewing-angle ambiguity**](https://sandboxphysics.com/stories/relativistic-jets/fitting-moving-knots/)
6. [Article **Read a helical-jet polarization paper one frame at a time**](https://sandboxphysics.com/stories/relativistic-jets/reading-structured-jet-polarization/)
