Introduction to ancient astronomy 

«Astronomy is a science that sinks its roots into ancient times, as known to everybody: the sky, the sequence of the Seasons, the motion of the Sun and the planetary transit onto the celestial vault were subjects of study since past times, many centuries B.C.. Religion is determinant in this scenario: the relations among astronomy, astrology and religion are perceivable throughout all past civilizations»  

« ... The theological aspect, however, is not sufficient to explain the great accuracy and exactness our ancestors displayed cataloguing the stars and recording the celestial motions. The need of calendars that could emphasize the seeding periods; the need to measure time; the possibility to find out one’s position with the help of the stars, making it more easy to travel by sea and ground, arose many practical requests which created an interest, not only limited to astronomical observation, but also addressed towards the achievement of a model that could foresee the motion of the celestial objects. In the past, many scientists and philosophers tried to meet these requirements. To see the number of data and information put together without the use of many instruments, without telescopes and without the help of modern technology is, still today, very much surprising. The Greek people had already recognized five stars in the sky that behaved different in comparison to all other stars, as they shifted their position with respect to constellations (this is how the name: "errant stars" originated)»  

« ... It was evident that the planets not only moved eastwards, throughout the constellations (normal motion) with a different, non uniform velocity, but also that the normal motion was, from time to time, interrupted by a westward motion, called retrograde motion, common to all observable planets, except for the Sun and the Moon. Moreover, during these retrograde motions, a regular periodical variation of the planet’s brightness was observed, suggesting a variation of the distance that occurred between Earth and planet. Another complicated problem was connected to the variation of the velocity of the celestial objects, a matter difficult to couple with a theory that only disposed of circular uniform motions. Observations carried out on the motion of the Sun revealed that, during Summer time, the motion of this star was slower than its motion in Winter time. As a matter of fact, to move from the Spring to the Winter equinox, hence to complete 180° onto the ecliptic, the Sun takes about 6 more days time than it takes to return from the Winter to the Spring equinox, even if the arc: 180°, remains unchanged» 

« ... Ptolemy of Alexandria succeeded in this task some centuries later (second century A.D.). In his work, the "Almagest" (in Arabic language "The Greatest"), he conceived a geocentric model in which the Earth is seen as a sphere placed into the middle of the sky, similar to a point in form, lacking any motion of translation and rotation. The orbits of the planets onto the celestial vault are all described as a timely combination of circles, epicycles and constant angular velocities. Even though the Ptolemaic model showed some inaccuracies, towards a different reality that observations emphasized, trying to match experimental data of the Lunar motion with the theory, Ptolemy was forced to introduce an epicycle with a remarkable radius. This involved a considerable variation of the distance between the Earth and the Moon, with a consequent variation of the Lunar disc’s size. On the contrary, observations did not confirm these theories» 

« ... But the importance of the Ptolemaic theory, even though the final model appeared very much involving, is emphasized by the combination of quite simple elements, that can be understood describing the trajectory of a point that moves uniformly onto a fixed circle or onto a circle revolving about another circumference» 

« ... This is the most simple model that can be devised for an epicycle-deferent system. Using trigonometric functions, it is possible to describe the curve covered by the P point. However, if distances r1 and r2 and angular velocities v1 and v2 are varied, it is possible to achieve different curves, each curve having particular and specific features» 
 
.  .
1)   the kinetic complex motion centre is not coincident with the Earth’s centre (eccentricity) 
2)   a great blue eccentric circle is motionless about the Earth (deferent)
3)   the centre of a smaller circle revolves about the deferent (epicycle)
4)   the planet drives through the epicycle, while the epicycle revolves about the deferent
. .
 
5) Two are the motions in question: the sidereal period of the Sun and that of the Planet
6) The motion on the deferent is slower than the one on the epicycle
7) In the case of an inner planet, the deferent is covered within the course of the Sun’s sidereal period
8) In the case of an outer planet, the deferent is covered within the course of the Planet’s sidereal period
 
When the planet covers the inner part of the loop, it moves with a retrograde motion. The orbit is seen edgewise, therefore, during this period (opposition), it seems to move to and fro in the sky. Following, is a true simulation of Mars at opposition 2007 – 2008.
  

  
 
z
 
Theory of the Moon – First inequality
Book IV of the "Almagest" is dedicated to an "elementary" theory of the Moon, namely, to a simple kinetic model that assumes the Moon moving (with a retrograde motion) on an epicycle moving (with a direct motion) on a deferent, on which the observer is centrally positioned. 

This model should be the exact kinetic equivalent of the Sun’s motion model, except for two characteristics which are peculiar to the Lunar theory:

a) the apsidal line of the orbit of the Moon rotates (with a direct motion)
b) the orbit of the Moon, i.e. the common plane of the deferent and of the epicycle, is inclined to the ecliptic. Anyway, as the value of the angle of this inclination is small (5°), it will not be considered for the computation of longitude. The latitudes can be computed independently, using the same method used for the solar declination.
The "elementary" theory of the Moon’s motion is, for sure, the greatest contribution of theoretical astronomy that Ptolemy inherited from his predecessors. Anyway, a careful analysis of the grounds on which classical theory was developed, drove him to significant numerical and methodological improvements. 

The theory developed up to this moment is based on data achieved from the eclipses of the Moon. Book V of the Almagest shows that the longitudes of the Moon, different than those of the syzygies, are not represented with sufficient accuracy. It also puts into evidence a "second anomaly" of the Moon’s motion, which depends from the elongation of the Moon with respect to the Sun. This anomaly is zero at syzygies, therefore, the elementary theory of Book IV is valid for the theory of the eclipses. 

The second anomaly, known today as "evection", had a vast influence on the techniques of the ancient and medieval astronomers through the invention of Ptolemy of mobile eccenters by which he succeeded to correctly describe the deviations observed with respect to the elementary theory. 

In accordance with these improvements in the theory of the motion of the Moon’s positions, the most accurate known data for the determination of the nearby positions of planets and fixed stars were provided. Effectively, the parameters of the theory of the Moon originate from the eclipses, because only with the use of the solar theory the ecliptic coordinates are known with enough accuracy. 

The above underlines the crucial importance of theoretical models and of their correlation (in the order) with the Sun, the Moon, the Planets and the Fixed Stars (which, in turn, influence the determination of the sidereal and tropical coordinates), showing its major importance with respect to individual observations. This unbalance between theoretical structures and direct observations increased more and more post Ptolemy’s times and is a peculiarity of all the pre-telescopic astronomy. 

In Chap. 1 of Book IV Ptolemy explains that only the eclipses of the Moon are useful for the determination of the longitudes of the Moon as they are independent from the parallax. Chap. 2 gives a brief historical summary concerning the determination of the fundamental relations between the periods of the motions of the Moon, followed by a critical discussion of the method to determine the length of the anomalistic period. Chap. 3 derives the numerical values of the different mean motions, afterwards tabulated in Chap. 4. 

Ptolemy inherits from Hipparchus the following parameters:

a) Mean Synodic Month: 29;31,50,8,20 days
b) 251 Synodic Months = 269 Anomalistic Months
d) 5458 Synodic Months = 5923 Periods of Latitude
d) sexagesimally: 4,11 Synodic Months = 4,29 Anomalistic Months
e) sexagesimally: 1,30,58 Synodic Months = 1,38,43 Periods of Latitude
We saw that the anomaly of the Sun was determined in Greek astronomy by the disparity of the seasons. Such a simple method does not exist for the Moon because of its short anomalistic period of about 27,5 days. It is difficult to imagine an alternative other than that of discovering the variability of the velocity of the Moon by observing, day after day, the motion of the Moon with respect to the fixed stars. The existence of such observation is greatly certified in the "Babylonian Diaries" of the Persian and of the Seleucid period; it is therefore not surprising that very accurate values of the length of the anomalistic month, integrated in the computation of the Babylonian ephemerides can be found.  

The historical introduction of Ptolemy to Book IV of the Almagest shows, in an evident way, that Babylonian parameters were known to Hipparchus. For him, the problem consisted in testing these Babylonian parameters and in obtaining values the most accurate possible, for the mean anomalistic motion. Ptolemy assumes that only the eclipses of the Moon are sufficiently accurate for the determination of the longitudes of the Moon. 
 

z
Theory of the Moon – Second inequality
As seen in the previous section, the determination of the characteristic features of the theory of the Moon are derived from the observation of the eclipses. Particularly, the Babylonian values and those of Hipparchus, relevant to the mean motions in longitude, anomaly and latitude had at their back nearly six centuries of records of eclipses. It is therefore not surprising that, both Hipparchus and Ptolemy, found a good correspondence between data predicted and data observed, both relevant to the eclipses of the Moon.  

Therefore, the "elementary" epicycle model that produces the first inequality shows satisfactory for the prediction of the eclipses. But as known from the introduction to Chap. 2 of Book V of the Almagest, Hipparchus found significant deviations from the predicted longitudes for the Moon positions not associated with the syzygies, particularly near to the quadratures. To all appearances, however, these discrepancies were too irregular, both in value and in position, and enough not to allow Hipparchus to build up a self-consistent theoretical picture of the motion of the Moon.  

Ptolemy, aware of these deviations, undertook a systematic study of the observational evidence, succeeding in the task of discovering the structure of these perturbations. Such study involved a great work of calculation, since he would have not been able to reach his conclusions without computing in each single case, the mean longitudes of the Sun and of the Moon, the anomaly of the Moon and the effects of the longitudinal components on the parallax of the Moon. 

The structure that Ptolemy draws from the numerical data is summarized in the following statements: 
 

1) absence of deviations (or, at the limit, deviations within values justifiable by the parallax) in the syzygies
2a) absence, or only small deviations in the quadratures, under the condition that the Moon is simultaneously near to the apogee or to the perigee of the epicycle
2b) maximum deviation in the quadratures when, the Moon is at the same time, near to the maximum equation caused by the epicycle anomaly 
Ptolemy realized that exactly this type of discrepancies from the elementary theory would have been explained by an increase of the radius of the epicycle in the quadratures, with respect to the syzygies, as previously confirmed by the eclipses. 

A dynamic variation in the measure of the epicycle would contradict the spirit of the kinetic models of the Greek astronomy. Anyway the same effect could be obtained moving the epicycle near to the observer when in quadrature, apparently increasing its size. 

Consequently, Ptolemy imposed an eccentric independent motion to the deferent of the orbit of the Moon, connected with the elongation with regard to the Sun. At conjunctions and oppositions the centre C of the epicycle remains at its original distance = 60 from the observer O, while at elongations 90° and 270° the distance OC must be reduced to the value required by the observed maximum increment of the epicycle equation. 

The kinetic device created by Ptolemy, to obtain such a periodic variation of the distance, consists in a mechanism of the type: crank -connecting rod. 

The effect produced by this innovative model on the longitude of the Moon, not regulated by the "elementary" model, is known as the "second inequality". It generally identifies the periodic inequality that in modern celestial dynamic is known as "evection", to which Tycho Brahe added another term, the "variation", that reaches its maximum between the syzygies and the quadratures, being zero at both these points. 

A similar term occurs also in Ptolemy’s model of the Lunar motion. 

Bibliography: O. Neugebauer - "A History of Ancient Mathematical Astronomy" - Springer