Simple Harmonic Oscillation (SHO) is everyone’s favorite type of periodic motion. It’s simple, easy to understand, and has a known solution. But SHO is not the only kind of periodic motion. In this set of exercises we’ll investigate ananharmonicoscillator. We’ll explore characteristics of its motion, and try to get an understanding of the circumstances under which the motion can be approximated as simple harmonic.
First Year and Beyond the First Year
Students who complete these exercises will be able to use an ODE solver to develop a qualitative understanding of the behavior of an anharmonic oscillator.
Most students gain a good understanding of the behavior of harmonic oscillators in their introductory classes, but not all oscillators are harmonic. Here we investigate an idealized boat hull which exhibits asymmetric oscillation: the restoring force is stronger for displacements in one direction than in the other. This results, for large oscillations, in a visibly non-sinusoidal oscillation. For small oscillations, the motion is approximately simple harmonic again.
Time to Complete
This set of exercises guides students through the development of an anharmonic oscillator, then lets them use an ODE solver to plot the motion. It does not describehowto use an ODE solver. Emphasis is on qualitative understanding of the system, although if the instructor chooses it is certainly possible to use real parameters (ρwater, dimensions of boat, etc) to obtain an “engineer’s answer”.
The problem is accessible to first-year students, but it may also be of interest to students in higher-level courses.
There is opportunity to discuss limitations of the model on the final problem. In this problem, if the amplitude is high enough that the boat gets out of the water, the model in the ODE breaks down in interesting and spectacular ways.
The pseudocode, Mathematica notebook, python code, and sample solutions of this Exercise Set assume the use of built-in differential equation solving capabilities. Depending on instructor preference, it may be desirable for students to have experienced the direct application of a finite-difference algorithm to a variety of first-order differential equations before using a computational ‘black box.’
The simplest example of Simple Harmonic Oscillation (SHO) is a mass hanging on a spring. In equilibrium, the string will have stretched some equilibrium distancexo, so that the weight of the massmgis balanced by the spring force−kxo. Any additional motionxof the spring will result in an unbalanced force:
This last equation is in the form of the equation for SHO:
whereω≡km−−√in this case. Knowingω, we can then go on to do whatever we need to do with the problem. The period of the motion isT=2πω, the position as a function of time will bex(t)=Acos(ωt+ϕ), etc.
We can use this “known solution” to SHOanytime 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 wecan’tget 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 isnotSHO, but for smallθ,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
This isnotSHO! Ifγis small, it isapproximatelySHO, 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 toNumerical Recipes in C,or equivalent text, which will provide an introduction and theoretical description of the numerical approach to solutions via finite-difference methods.
Exercise 1: A straight-sided boat
Imagine a boat with vertical sides, floating. There will be two forces on this boat: its weightmg, and the buoyant force−ρgV. (I’ve defined down to be the positive direction, here, so the buoyant force is negative since it’s upwards.) The volumeVin the buoyant force component is the volume of water displaced by the boat: in other words, the volume of boat that isbelowwater level. In equilibrium, the bottom of the boat will be some distancexobelow the water, soV=Axo, whereAis the area of the boat at the waterline.
If we then push the boat down some additional distancexand let go, the boat will bob up and down.
Show that the boat’s vertical motion is SHO. It will probably be helpful to follow the same pattern as for the introduction example: the key is to get the equation in the form of the equation for SHO.
What is the period of the boat’s motion?
Exercise 2: A V-hulled boat
Instead of a straight-sided boat, imagine a boat with a V-shaped hull profile, as shown below.
The widthwof the hull at the waterline depends on the depth below waterlineh:
The volume of water displaced by this boat is the area of the triangle below water level, times the length of the boat:
Show that the vertical motion of this boat is not SHO. Replacehwith(yo+y), whereyois the equilibrium depth, and follow the example in the introduction.
Rearrange the equation you got in the previous problem to be as close to SHO as possible by putting it in this form:
In this form, you can see that ify2yois small, the motion is approximately SHO with angular frequencyωo. What is thatωo? What must be small for this approximation to be valid?
Ify2yois not small, would the period of the boat’s oscillation be larger or smaller thanTo=2πωo? Use a numeric solution of the equation of motion for the boat to verify your answer.
Plot the motion of the boat for various amplitudes. In addition to effects onT, how else does the motion differ from SHO? It will be helpful to plot both the solution to the differential equation and the SHO approximation,
We’ve neglected viscous damping, which is a bad idea in liquids! Redo your calculations, and plots, adding a viscous damping force
to your equations.
A solution to the vertical motion of a V-hulled boat.
from pylab import *
from scipy.integrate import odeint
w = 1.0 # Well, we need to pick something. Might as well
# normalize the frequency. :-)
delta = 0.2 # not sure what this should be, play with it!
# derivs function for v-hull ODE, without viscous damping
g0 = s
g1 = -w*(1+s/2)*s
# derivs function for v-hull ODE, with viscous damping added
g0 = s
g1 = -w*(1+s)*s - delta*s
# Now set up the solutions.
time = linspace(0,20,500) # 500 points on interval [0,20]
# And now plot some things!
# Here's a low-amplitude one, should be approximately SHO.
For a boat with vertical sides, the equation of motion can be derived by starting with Newton’s second law:
whereAis the area of the boat’s cross-section at the waterline.yois the equilibrium depth, somg=ρgAyoand
This is in the form of the equation for SHO, with
The period of the boat’s oscillation will be
Exercise 2: A V-hulled boat
The derivation for the V-hulled boat follows the same general procedure.
The equilibrium position is given byyo, somg−12ρgβLy2o=0and
This can be further simplified as
From that equation we can see that ify2yois small, then the motion is approximately SHO with
There are an awful lot of constants in that equation, so to simplify our numeric calculations let’s just redefine things.
We can also define the unitless variableγ≡yyo, which allows us to rewrite the equation in (almost) unit-independent form:
That’s the equation we need to send through the ODE solver.
The equation is approximately SHO if the amplitude is small. The easist way to control the amplitude is to set initial position toyi, withvi=0, so that the amplitude isyi.
Setting different values of amplitude gives different behavior: for small amplitude (γo=0.1) the result is nearly indistinguishable from SHO, but for larger values both the period and symmetry change. The figure below shows that atγo=0.5, the boat spends more time higher (the graph is inverted, since down is positive in our initial setup) and the period lengthens relative to the SHO approximation.
These effects are even more prominent at larger values ofγo, as shown in the next figure.
There’s an opportunity here for the model to break down. If the boat gets completely out of the water, then the width of the boat becomes negative (ok, it doesn’t really but it does in themodel) so then the volume becomes negative and the buoyant force becomes negative and the boatleapsaway from the water exactly the way that real boats don’t. Be prepared to discuss this interesting result should the students get the amplitude too high.
Adding damping is relatively easy: just add another force term in the definition of the ODE. Results are shown below.
with best with
Yes. Chrome/Opera No. Firefox/ Samsung Internet
cannot work on
cannot work on Internet Explorer 9 and below
Fremont Teng; Loo Kang Wee
Sample Learning Goals
Solver Combo Box
Toggle this combo box to select their respective solver.
Selecting the EJSS RK4 Solver includes a playable animation.
Amplitude Field Box
Adjust this to change the amplitude of the wave.
Damped Check Box
Toggling this will determine if the oscillation is damped or not.
Play/Pause and Reset Buttons
Plays/Pauses and resets the simulation respectively.
That is all, do enjoy the simulation in the link below: