The simplest example of Simple Harmonic Oscillation (SHO) is a mass hanging on a spring. In equilibrium, the string will have stretched some equilibrium distance x o x o, so that the weight of the mass m g m g is balanced by the spring force −k x o−k x o. Any additional motion x x of the spring will result in an unbalanced force:

Σ F=m a=m g−k(x o+x)(1)(1)Σ F=m a=m g−k(x o+x)
m d 2 x d t 2=(m g−k x o)−k x(2)(2)m d 2 x d t 2=(m g−k x o)−k x
d 2 x d t 2=−k m x(3)(3)d 2 x d t 2=−k m x

This last equation is in the form of the equation for SHO:

d 2 x d t 2=−ω 2 x(4)(4)d 2 x d t 2=−ω 2 x

where ω≡k m−−√ω≡k m in this case. Knowing ω ω, we can then go on to do whatever we need to do with the problem. The period of the motion is T=2 π ω T=2 π ω, the position as a function of time will be x(t)=A cos(ω t+ϕ)x(t)=A cos⁡(ω t+ϕ), etc.

We can use this “known solution” to SHO any time we can get the equation of motion into the form of the SHO differential equation. If the second derivative of a variable is equal to a negative constant times the variable, the solution is SHO with ω ω equal to the square root of that constant.

Even when we can’t get the equation of motion for a system into the form of SHO, we can often approximate the motion as SHO for small oscillations. The classic example of this is the simple pendulum. The equation of motion for the pendulum is

d 2 θ d t 2=−g L sin θ(5)(5)d 2 θ d t 2=−g L sin⁡θ

This equation is not SHO, but for small θ θ, sin θ≈θ sin⁡θ≈θ so we can approximate the motion as SHO as long as the oscillations are small.

In the case of our wedge-shaped boat, the equation of motion is

d 2 γ d t 2=−ω 2 o(1+γ 2)γ(6)(6)d 2 γ d t 2=−ω o 2(1+γ 2)γ

This is not SHO! If γ γ is small, it is approximately SHO, but only approximately.

Note: The Mathematica and Python solutions here make use of built-in tools for solving differential equations. For other implementations the reader is directed to Numerical Recipes in C, or equivalent text, which will provide an introduction and theoretical description of the numerical approach to solutions via finite-difference methods.