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 , so that the weight of the mass is balanced by the spring force . Any additional motion of the spring will result in an unbalanced force:
This last equation is in the form of the equation for SHO:
where 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 , the position as a function of time will be , 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
This equation is not SHO, but for small , 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
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.