Method Deck / astronomy

Tide height by the rule of twelfths

Estimates the tide height at a query time between a known high and low tide using the traditional rule-of-twelfths approximation.

Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.

Try it

Inputs

Outputs

Steps

  1. The rule of twelfths splits the roughly 6-hour rise or fall between a high and a low tide into 6 hourly amounts of 1, 2, 3, 3, 2, and 1 twelfths of the total range, in order.
  2. Cumulative twelfths at hour marks 0 through 6 are therefore 0, 1, 3, 6, 9, 11, and 12.
  3. Scale the elapsed time between start_time_hours and query_time_hours onto a canonical 0-to-6-hour timeline (elapsed / actual duration * 6), since the real interval may not be exactly 6 hours.
  4. Within the hour that contains the scaled elapsed time, linearly interpolate between that hour's cumulative twelfths and the next hour's cumulative twelfths.
  5. estimated_height = start_height + (end_height - start_height) * (interpolated cumulative twelfths / 12).
  6. Round the result to 2 decimals.
  7. This is a classroom approximation only. Real tide predictions come from NOAA CO-OPS (https://tidesandcurrents.noaa.gov/) and account for the actual, non-uniform tidal curve and the true semidiurnal period (about 6 hours 12.5 minutes, not exactly 6 hours).

Constants

Sources

Worked example and test vectors

NameInputsAnswer
worked example{"start_time_hours":0,"start_height":4,"end_time_hours":6,"end_height":1,"query_time_hours":2}3.25
test vector: rising tide, midpoint of hour 5{"start_time_hours":0,"start_height":0.5,"end_time_hours":6,"end_height":5,"query_time_hours":4.5}4.25

Published card