*Tides on Earth follow a straightforward pattern, but this pattern may not be observed on Mars, which has two moons (Phobos and Deimos) that affect its tides.*

**Tidal forces on Earth**

The gravitational force of the moon has a different effect on different locations on the Earth: it is stronger on the side of the Earth facing towards the moon and weaker on the side facing away from the moon. As a result, a tidal force arises, which causes the Earth to become slightly deformed. The water in the oceans is more readily deformed, so adopts a elongated shape in response to the tidal forces exerted on the planet.

The Sun also exerts a gravitational force on the Earth, so it too contributes to the tidal forces experienced by the Earth. The effects of the Sun and Moon combine to result in an overall tidal force on the Earth, similar in shape to that shown in the image above.

As the Earth rotates about its own axis, points on the surface experience a different magnitude of tidal force. When there is a maximum tidal force a high tide occurs; and when there is a minimum tidal force a low tide occurs. Looking at the shape of the tidal force on the Earth, we can see that there should be two high tides and two low tides each day, as the Earth rotates through tidal force maxima and minima.

**Modeling tidal forces on Earth**

In order to model tidal forces on Earth, we need to make some assumptions:

- The Earth, Moon and Sun are perfect spheres with uniform density.
- The orbit of the Earth around the Sun and the orbit of the Moon around the Earth are circular.
- The rotation of the Earth about its own axis is in the same plane as the orbit of the Moon around the Earth and of the Earth around the Sun.
- The surface of the Earth is completely covered in water.
- The gravitational forces exerted by other planets are negligible.

Now, we consider a single point on the equator, and calculate the tidal forces experienced by this point as a function of time:

**1) We have to keep track of the positions of the Earth and Moon around the Sun.**

Let’s set up a 2D coordinate system where the Sun is at the origin.

We can use polar coordinates to express the position of the Earth around the Sun:

x = r*cos(A) ; y = r*sin(A)

Where r is the orbital radius of the Earth, and A is the angle of the Earth around the Sun, which is calculated by this formula:

A = (2*pi / T) * t

Where T is the orbital period of the Earth (approximately 365 days), and t is a particular point in time.

We can do the same for the movement of the Moon around the Earth, and the movement of the point on the surface of the Earth around the Earth.

**2) We have to calculate the gravitational force exerted on the Earth by the Moon and Sun.**

To calculate the gravitational force exerted on the Earth by each body, we use this formula:

F = G*M*m / d^2

Where F is the gravitational force, G is the gravitational constant, M is the mass of the more massive body, m is the mass of the less massive body, and d is the distance between the two bodies.

Since we know the positions of the bodies at any given time, we can calculate the distance between them by using the formula below:

d = ( ((x2 – x1)^2) + ((y2 – y1)^2) ) ^ 0.5

Where x1 and y1 are the coordinates of one body, and x2 and y2 are the coordinates of another body.

We can repeat this process to work out the gravitational force exerted by the Sun and Moon on the particular point on the Earth.

**3) We have to calculate the resultant tidal force at the specific point on Earth.**

We use this formula to calculate the tidal force exerted on the point for the Sun and Moon separately:

Tidal force = (gravitational force at a specific point in the Earth) – (gravitational force at the center of the Earth)

Then we work out the x components for each tidal force:

x component = |F*cos(A)|

Where F is the tidal force, and A is the angle between the Earth and body. This value must always be positive because a tidal force always acts outwards from a point.

Finally, we add the x components for each tidal force together to get the resultant tidal force in the x direction. The overall function comes out as:

F(t) = F1*cos(A1) + F2*cos(A2)

**4) Plotting our function.**

We can use a Python script to plot different values of tidal forces against time, and we get the following graph:

The peaks indicate the occurrence of a high tide and the troughs indicate the occurrence of a low tide. As the Earth rotates there is a peak when our particular point experiences a tidal force maximum and a trough when it experiences a tidal force minimum. **This cycle is caused by the rotation of the Earth and occurs twice each day.**

The largest tidal differences (known as spring tides) occur when the moon, sun and earth are aligned, so there is a large tidal force in a single direction. The smallest tidal differences (known as neap tides) occur when the moon sun and Earth form a right angle, so the effects of the sun and moon cancel each other out. **This cycle is caused by the orbit of the moon around the Earth and occurs twice every 27 days.**

To test the accuracy of the model, I compared it to real data of tidal ranges measured in January 2014 at Swansea Bay:

The model seems to match the general pattern of the real data, but is has more exaggerated peaks and troughs.

The resultant tidal force that we plotted should be proportional to the tidal range seen in the real data, however our model is a simplification, and in reality many other factors contribute to tidal ranges. It could be the case that at Swansea bay, factors such as the shape of the seabed and wind speeds dampen the effect of tidal forces.

**Modeling tidal forces on Mars**

Mars has two moons: Phobos and Deimos, so along with the Sun there are three major contributors to its tidal forces.

Luckily we can maintain the 2D nature of our model as Phobos and Deimsos orbit Mars in the same plane.

We tweak the model consider the effects of the two moons on the tidal forces of Mars and the final function comes out as:

F(t) = F1*cos(A1) + F2*cos(A2) + F2*cos(A3)

When we plot this function, we get an interesting graph:

This is similar to the graph for Earth, but the presence of two moons creates some interesting fluctuations. Martians would sometimes experience smaller, secondary high tides. This can be seen more clearly when we zoom in on the tidal activity over a single week:

The tidal ranges on Mars are around a hundred times less than those on Earth. This is because Phobos and Deimos are much less massive than the Earth’s moon, and Mars is further from the Sun, meaning that the total tidal forces acting on Mars are lower than those on Earth.