---
title: "Turn stellar crossings into timing residuals"
description: "Locate a geometric transit, derive the fitted linear ephemeris, and separate conjunction time from the long near-resonant beat."
canonical_url: "https://sandboxphysics.com/stories/transit-timing/crossings-and-residuals/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/transit-timing/crossings-and-residuals/"
last_modified: "2026-10-28"
---

[Transit timing, from an orbit to a mass](https://sandboxphysics.com/stories/transit-timing/)

L2 · Transit timing variations

# Turn stellar crossings into timing residuals

Sandbox Physics · 2026-10-28

A list of orbital positions is not yet a timing measurement. We must locate a foreground crossing between integration steps, define its time, and subtract a clock whose starting date and period were fitted to the whole series.

## Before you begin

Read Build the orbit before building the clock. You need vectors and the derivative of a square; weighted averages and least squares are introduced below.

## Find a minimum in the image plane

Use the planet's position relative to the star. Project that vector onto the sky, perpendicular to the viewing direction. The square of its length is the squared apparent center separation. Differentiate: the factor of two multiplies the dot product of projected position and velocity.

At a minimum that dot product changes from negative to positive. Two extra tests remain: the planet must be in the foreground, and its projected disk must intersect the star. A planet behind the star can also reach a projected minimum. A face-on orbit can have a closest projected approach while missing the disk entirely.

$$
\frac{d}{dt}|\boldsymbol r_\perp|^2=2\boldsymbol r_\perp\cdot\boldsymbol v_\perp,\qquad D(t_{\rm mid})=0
$$

For the exactly edge-on teaching geometry the sky coordinate is y. The foreground condition is positive relative x. Separation and the radii must share one length unit.

Reading: Deck et al. · Greklek-McKeon et al.

## A tiny root tolerance cannot repair a coarse orbit

A bracket consists of an integrated state just before the minimum and another just after it. Refine the event inside that interval, preserving the same force model and a consistent interpolation of position. Repeated bisection can make the root of an interpolating polynomial extremely precise.

That is only one part of the error. A coarse numerical orbit may already be ahead of the true orbit. The event search then finds the wrong crossing very precisely. Our independent check uses a different integrator, IAS 15, and reintegrates copies of the bracket during root finding. Step refinement and that separate reference test both matter.

At the default resolution, twenty-four preset and corner cases agree with the independent geometric roots within 0.08 seconds over two hundred initial inner periods. This is a numerical comparison under the stated Newtonian model. The model uses geometric coordinate times; stellar activity and finite light propagation remain omitted.

Reading: Deck et al. · Deck & Agol

## Connect the geometry to the light curve

The brightness image adds a finite stellar disk. Its outer edge is dimmer than its center, an effect called limb darkening. At each instant, integrate the intensity over the visible surface and subtract the intensity covered by foreground planets. If their silhouettes overlap, count the blocked region once.

The resulting flux uses the same projected positions as the event search. For an isolated symmetric transit the geometric closest approach lies at the deepest point. Finite exposure time averages nearby instants, and acceleration or surface features can make a measured light-curve midpoint differ from a geometric definition. State which time is being fitted.

For the six saved synthetic presets, the selected instantaneous and thirty-minute averaged inner-transit minima lie within 0.07 seconds of the geometric event, close to the numerical interpolation scale. Adopting a solar-mass star, the leading planet-to-observer propagation term is about fifty seconds; most is absorbed into the fitted clock, but the remaining timing change reaches 0.66 seconds in the longer-beat preset. The saved estimate omits full retarded-ray geometry and stellar surface activity. A precise numerical root therefore does not give the same precision for an observed arrival time.

$$
\frac{I(\mu)}{I(1)}=1-u_1(1-\mu)-u_2(1-\mu)^2,\quad \mu=\sqrt{1-\rho^2},\quad F(t)=\frac{\int_{\rm visible\,unblocked}I\,dA}{\int_{\rm disk}I\,dA}
$$

Here the radial coordinate is measured in stellar radii. The adopted coefficients are 0.4 and 0.2. Flux is dimensionless; the radii control the depth, while gravity controls the orbit.

Reading: Deck et al. · Greklek-McKeon et al.

## Fit the clock, including its two freedoms

Let each observed event retain an integer orbital epoch and a measured time in days. Its uncertainty supplies a weight: the inverse of its timing variance. Choose the clock's epoch and period to minimize the weighted sum of squared timing residuals.

Differentiating with respect to those two clock parameters gives two linear equations. Subtracting weighted means separates the slope from the offset and makes the arithmetic more stable. Missing events leave gaps in the epoch numbers; removing those gaps would change the physical period.

$$
\chi^2=\sum_n w_n[t_n-T_0-nP]^2,\quad w_n=\sigma_n^{-2}
$$

This weighted least-squares expression assumes diagonal timing errors. Shared photometric fits can correlate times; a supplied full covariance should replace these independent weights.

$$
P=\frac{\sum_nw_n(n-\bar n)(t_n-\bar t)}{\sum_nw_n(n-\bar n)^2},\quad T_0=\bar t-P\bar n,\quad r_n=t_n-T_0-nP
$$

Bars denote weighted means. The fitted residuals have zero weighted sum and zero weighted correlation with epoch.

Reading: Lithwick · Deck et al.

## Work an actual synthetic event through the subtraction

Use the saved default integration: twenty-Earth-mass companion, initial ratio 2.04, circular inner orbit and two hundred initial twelve-day periods. The times below are generated events, not Kepler measurements. Their zero is the initial integration epoch.

For the first row, subtract 11.995166 days from 12.001876 days. The difference is 0.006710 days. Multiply by 1440 minutes per day to obtain about 9.66 minutes late. This first future crossing has a positive residual because the fitted clock used the entire record, not just the first two crossings.

The fitted period is an average over a perturbed orbit. Replacing it by the initial twelve-day Kepler period would leave a different slope in the residual series. Always save the adopted ephemeris with a timing plot.

| Inner epoch | Integrated time / day | Fitted time / day | Residual / minute |
| --- | --- | --- | --- |
| 1 | 12.001876 | 11.995166 | 9.66 |
| 100 | 1200.081986 | 1200.077215 | 6.87 |
| 199 | 2388.162079 | 2388.159264 | 4.05 |

Reading: Deck et al. · Lithwick

## Two planets make two different beats

Subtract the planets' mean angular rates to get the rate at which they pass each other. Its inverse gives the conjunction interval. Near a two-to-one period ratio, a different combination changes slowly: twice the outer mean longitude minus the inner mean longitude. The inverse of that frequency is the near-resonant super-period.

With initial periods 12 and 24.48 days, conjunctions recur about every 23.54 days, but the approximate long beat lasts 612 days. Reducing the ratio to 2.008 makes the corresponding long beat about 3012 days. A two-hundred-inner-orbit baseline is only 2400 days, so it does not span that whole slow cycle.

These frequency estimates describe weakly perturbed, near-resonant motion. A resonantly locked system can have its own libration timescale. A near-integer period ratio alone does not identify that dynamical state.

$$
P_{\rm syn}=\frac1{|1/P_1-1/P_2|},\qquad P_{\rm sup}=\frac1{|2/P_2-1/P_1|}
$$

Both results have time units. Each result belongs to its own angular combination. Replacing one by the other changes the physical question.

Reading: Lithwick · Deck & Agol

## Try the observation

### [Follow one crossing into the full timing series](https://sandboxphysics.com/labs/transit-timing-variations/)

1. Pause near the stellar crossing and identify the corresponding gold event marker.
2. Compare A longer beat with Near two-to-one. Estimate whether two hundred periods cover the whole slow cycle.
3. Export the synthetic record and locate the calculated times and residuals for the same events.

## Exercises and explained answers

Only epochs 0,2 and 5 were observed. What happens if they are relabeled 0,1 and 2 before fitting?

The fit treats unequal physical gaps as equal. The resulting slope is not an orbital period, and the invented residual curvature can mimic timing variation. Keep the actual integer epochs even when most crossings are missing.

A four-event arithmetic example has epochs 0–3 and times 100,112.010,124.010,136.000 days with equal errors. Find the fitted clock and residuals.

The centered slope is twelve days and the fitted epoch is 100.005 days. The residuals are minus 7.2, plus 7.2, plus 7.2 and minus 7.2 minutes. This is a least-squares exercise, not a claimed physical orbit or observed dataset.

Why can a tiny reported root tolerance coexist with a false timing wave?

The root tolerance describes solving a function built from the numerical orbit. Accumulated orbital phase error can shift that entire function. Compare an analytic null and refine both the orbit and the observation calculation.

[Previous: Build the orbit before building the clock](https://sandboxphysics.com/stories/transit-timing/orbits-before-clocks/) [Next: Why a timing wave can leave the mass uncertain](https://sandboxphysics.com/stories/transit-timing/mass-and-eccentricity/)

## Sources and calculation scope

1. [Lithwick, Xie & Wu, Extracting Planet Mass and Eccentricity From TTV Data (2012)](https://arxiv.org/abs/1207.4192v2)

   Pinned v2, Sections 2.1–2.3, Equations 1–10 and Appendix B. The free-eccentricity vector and the near-resonant validity conditions.

2. [Deck & Agol, Measurement of Planet Masses with Synodic Chopping (2015)](https://arxiv.org/abs/1411.0004v1)

   Pinned v1, Sections 2–5.1, Equations 10–15 and Appendix A. The transit sampling aliases some harmonics; the PH3 application explicitly compares mass constraints with and without chopping.

3. [Deck et al., TTVFast (2014)](https://arxiv.org/abs/1403.1895v1)

   Pinned v1, Sections 2.1.3, 2.2–2.3 and 3. Mid-transit is a foreground minimum of astrocentric sky separation. This teaching calculation reuses the site's RK4 kernel and independently checks IAS15; it does not port the GPL TTVFast code.

4. [Greklek-McKeon et al., Kepler-289 Densities and Transit Timing (2023)](https://arxiv.org/abs/2208.00022v1)

   Pinned v1, Sections 2–3, Table 1 and Figures 2–4, 9–10. CC BY 4.0. The author analysis jointly fits transit shapes, then fits the measured times with a three-planet dynamical model.
