(bit of history on that Tide Prediction Machine)
You can read the paper underlying the mathematics of tidal computation including pictures and description here:
Special Publication No. 98: Manual of Harmonic Analysis and Prediction of Tides (1940)
https://tidesandcurrents.noaa.gov/publications/SpecialPubNo9...
I worked on a Fortran program which I'm pretty sure is the direct descendant of this paper and the analog computer.
It originated in 1967 and was still used in the mid 1990s. And probably still is used.