How can one predict the length of the Synodic month? Why is it irregular? I'd like to write a program that uses the exact (down to the second) amount of time from one new moon (or full moon) to the next.
Yet, I am told that this period is irregular.
Yet, it seems to be predicted in a number of places (ie, by the navy).  How do they do this?
http://aa.usno.navy.mil/data/docs/MoonPhase.php
 A: If you are just looking for rough approximations, then the synodic month is regular, but asking for serious precision means that you have to take into account all manner of small variations- the eccentricity of both the Earth's and Moon's orbits, including both the uneven angular dependence due to changing radii and uneven speeds, longitude of observer, irregularities resulting from Earth's oceans sloshing around during the tidal cycle, Jupiter's gravity, all that stuff. The Navy has enough scientists onhand that they can handle a lot of that, but even their predictions only go out a couple of decades.
A: Beyond a certain level of precision, all calendars linked to astronomical events are now observational as all those astronomical events are irregular when observed with sufficient detail.
have a look at UT2R at http://en.wikipedia.org/wiki/UT2#Versions for a related example.
A: A workable expression appears in the Explanatory Supplement to the Astronomical Almanac, which was taken in turn from this 1988 paper by Chapront-Touze & Chapront which explains it in more detail.
If you're interested in astronomical calculations, the Explanatory Supplement is an essential reference. It is quite literally an explanation of how they (the navy) do this, and many of the other calculations that go into the Astronomical Almanac, which the United States Naval Observatory collaborates with others to produce.
