• Sea and the wave equation

A model of the sea surface as points connected to neighbours by 'springs' + a small horizontal displacement.

java apps: sea model sea model with raindrops

The behaviour of the surface can be plotted using the wave equation:

In the animation below the equation is used to calculate the change in shape of the surface using the previous two time steps. The new shape for the next time step is adjusted by adding the calculated change and plotting the surface.

The symbols in the equation mean:

c has a value equal to the speed of the wave;


2 ψ has a value at each point on the surface that represents how curved the surface is.

A positive value, ∇2 ψ > 0, would be at the bottom of a dip,

and ∇2 ψ = 0 is where the surface is flat;

The simplest computer code for calculating successive time steps for the wave equation applied to an elastic cord is of the following form:

At each time step repeat:


for(i=1;i<99;i++)

v[i]+=p[i-1]-2*p[i]+p[i+1];


for(i=1;i<99;i++){

p[i]+=c*v[i];

plotPointAt(i,p[i]);

}


where p[0]...p[100] has a set of initial values

and v[0]...v[100] = 0.


A small example html file (size 1 kb) is available from here wave equation model which will show an animated pulse on a string. The html file can be edited in a text editor to experiment with different parameter values and initial string shapes.