**Introduction**

Recently Google, in collaboration with Columbia University and about a dozen research labs, has released a set of high res maps of seafloor terrain. See the following intro video about the new dataset:

This looks pretty amazing. Possible uses? You can probably use it as the background of some aquarium screensaver or some underwater game, for example. But before you start to develop your next Google Earth based hit game "Angry Penguins", you need to know how to sink an object properly. And this is what this post is about - sink an object in a physically correct way using Google Earth's new seafloor terrain.

**Formulation**

When an object sinks in a medium, such as sea water, at certain velocity, there are three major forces involved, gravity, buoyant and drag.

*Fig. 1. Gravity, buoyant and drag forces exerted on a sinking object.*

The drag force is a function of the velocity of the sinking object and can be expressed as:

(1) |

where,

*F _{d}* - drag force

*C*- drag coefficient

_{d}*ρ*- the density of the medium

*A*- the object's cross section area

*v*- the velocity of the object

The drag coefficient, *C _{d}*, is a function of a dimensionless number called Reynolds number, which in turn is a function of, among other factors, the object's velocity. However, within a relatively large range of Reynolds number, the drag coefficient remains approximately a constant (≈0.44). So in this post we'll stick with constant drag coefficient. In other words, the drag on the object is considered quadratic in the velocity.

Referring to Fig. 1, the equation of motion of the object reads:

(2) |

Here the second term to the right is the buoyant force. *m ^{*}* is the mass of the displaced medium. Substitute Equ. 1 into Equ. 2 and we have:

(3) |

where,

(4) |

(5) |

*ρ* - the density of the medium

*ρ _{obj}* - the density of the object

*m*- the mass of the object

*m*- the mass of the displaced medium

^{*}The differential Equ. 3 has an analytical solution. For the initial condition

(6) |

the solution (the velocity of the object at any moment* t*) is:

(7) |

Since the hyperbolic tangent is bounded to (-1, 1), *v(t)* has a maximum value of -1/*γ*, which is called terminal velocity, i.e.

(8) |

The negative sign indicates that the direction of velocity is toward the seafloor. The elevation of the object at any moment *t* can be obtained by integrating Equ. 7:

(9) |

with the initial condition

(10) |

When *v _{0}* = 0, Equs. 7 and 9 are reduced to

(11) |

and

(12) |

respectively. If you are interested in how all these are derived, please refer to the last section of this post.

Fig. 2 is a plot of Equ. 12 and Fig. 3, a plot of Equ. 11 for a basketball-sized object with various densities.

*Fig. 2. The object's elevation change over time*

*Fig. 3. The object's velocity change over time*

The plots show that the heavier the object, the faster it sinks, and the higher its terminal velocity. For a good sized object like the one in the example, it only takes a few seconds for it to reach its terminal velocity. After that it maintains the terminal velocity until it lands on the seafloor. So if you want to simulate an object sinking into very deep water, you can pretty much ignore the cumbersome Equ. 7 and use Equ. 8 instead.

**Implementation**

I wrote a small program in C# that utilizes the above formulas to calculate the dynamics of multiple sinking objects and spits out a KML file, which can be rendered in Google Earth with the new seafloor terrain. Fig. 4 shows a screenshot of the user interface of the program.

*Fig. 4. Sink KML Generator UI*

The object to be sunk is actually a 3D model in COLLADA format. You can download a 3D model from numerous online 3D warehouses, or you can create your own one using 3D tools such as Google Sketchup. In the above example, a 3D ball or globe is used. Once a 3D model for the object is selected, you can specify how many copies of the object to be generated and where exactly they are located. The location data in the input field has this format:

* lat0,lon0,elev0 lat1,lon1,elev1 lat2,lon2,elev2 ... *

The elevation here means seafloor (below sea level) and is in meters, not feet. You can read out the coordinates from Google Earth by hovering your mouse pointer over a desired location.

Each object will be assigned a random density (within certain range) so that they will sink in different speeds. The program also adds a gentle random spin to each object to enhance the visual effects.

The following is a snip of KML generated by the program:

<kml xmlns="http://earth.google.com/kml/2.1">

<Document>

<name>Sinking Balls</name>

<description><![CDATA[by <a href="http://tofuculture.com">Gong Liu</a>]]></description>

<Folder>

<name>Ball 0</name>

<Placemark>

<TimeSpan>

<begin>2011-05-19T00:00:00</begin>

<end>2011-05-19T00:00:01</end>

</TimeSpan>

<Model>

<altitudeMode>relativeToGround</altitudeMode>

<Location>

<longitude>-125.379875</longitude>

<latitude>36.693736</latitude>

<altitude>0</altitude>

</Location>

<Orientation>

<heading>206</heading>

<tilt>169</tilt>

<roll>10</roll>

</Orientation>

<Scale><x>1</x><y>1</y><z>1</z></Scale>

<Link><href>files/Earth.dae</href></Link>

</Model>

</Placemark>

<Placemark>

<TimeSpan>

<begin>2011-05-19T00:00:01</begin>

<end>2011-05-19T00:00:02</end>

</TimeSpan>

<Model>

<altitudeMode>relativeToGround</altitudeMode>

<Location>

<longitude>-125.379875</longitude>

<latitude>36.693736</latitude>

<altitude>-3.767087</altitude>

</Location>

<Orientation>

<heading>238.4</heading>

<tilt>169</tilt>

<roll>10</roll>

</Orientation>

<Scale><x>1</x><y>1</y><z>1</z></Scale>

<Link><href>files/Earth.dae</href></Link>

</Model>

</Placemark>

...

</Folder>

<Folder>

<name>Ball 1</name>

<Placemark>...</Placemark>

<Placemark>...</Placemark>

...

</Folder>

...

</Document>

</kml>

Notice that each object (ball) has its own folder so that when loaded in Google Earth they can be shown or hidden individually.** **

**Demonstration**

The following series of screenshots shows the sinking objects (balls) in Google Earth's seafloor view.

*Fig. 5. The objects are at sea level at the beginning*

*Fig. 6. Showing the path of each object and notice the spin*

*Fig. 7. Sinking objects with seafloor as the background*

*Fig. 8. Another view closer to the seafloor*

You can download the sample KML file at the Downloads section below and play it alive on your own computer with Google Earth. If you are not bothered to install Google Earth or download the KML file, you can watch the following video I made. Enjoy!

Notice that the balls are not moving very smoothly at current one-second interval. This can be fixed by using smaller time interval when generating the KML. Also, it helps to use a joystick to browse around the seafloor terrain. It's like driving a submarine.

**Downloads**

You can download the program executable and a sample kmz file generated by the program from the following links:

SinkObj.zip (8.44 kb)

SinkBalls.kmz (135.04 kb)

If you are interested in the C# source code, please contact me.

**More Math Stuff**

Equ. 3 belongs to a special type of differential equations called Riccati Equations. To solve a Riccati Equation, we need to know a particular solution of it. In our case, we can easily spot a particular solution such as:

(13) |

Now we introduce a new variable *z*:

(14) |

or

(15) |

Do a substitution of v for z in Equ. 3 and we have

(16) |

Equ. 16 is a linear differential equation. The general solution is given by

(17) |

Substituting *z* back for *v *in Equ. 17 yields

(18) |

The constant *C* can be determined as

(19) |

with this initial condition

(20) |

*v _{0}* does not always have to be 0. For the situation where we want to drop a dead body to the ocean from an aircraft carrier, for example, before the body hits the water, it has already gained certain speed. Now substitute Equ. 19 into Equ. 18 and with some algebraic manipulations we get

(21) |

To prove Equ. 9, integrate Equ. 21

(22) |

With the initial condition

(23) |

the constant *C _{1}* can be determined as

(24) |

Substitute Equ. 24 into Equ. 22 and with some algebraic manipulations we get

(25) |