Click here to go to the applet.
This java applet is a simulation that demonstrates scalar waves in two dimensions.
Wave motion crops up in many different areas in physics; water waves, sound,
and light are three examples.
When the applet starts up you will see a blue circle (called the "source")
emitting red and green circular waves. The green areas are positive and
the red areas are negative. So, if you prefer to think of the waves as
sound waves, the green areas would be areas of high pressure, and the
red areas would be low pressure. The source might be a speaker of some
The first thing to do when starting up the applet is to adjust the
settings for your computer. First try clicking the "Alternate Rendering" checkbox,
if it is not already checked. Depending on your browser it may speed
things up or slow things down. If it makes things slower then uncheck
Next, slide the "Resolution" slider to the right as far as you can
without slowing things down too much. Or you could slide it to the left
if things are already too slow. Another thing to try, if the simulation
is too slow, is to slide the "Simulation Speed" button to the right.
That won't improve the framerate (it will slow it down slightly, in fact)
but it will get the waves moving faster. Or you could make the window
smaller. The applet runs slower when the window is large.
Now you can start playing with the applet. You can drag the source
around wherever you want. Also you can create new waves (areas of high
pressure) by clicking anywhere. There is a popup menu that controls what
the mouse does. By default it is set to "Mouse = Edit Wave". If you change
it to "Edit Walls", then you can use the mouse to put obstacles in the
The Setup popup can be used to view some interesting pre-defined
experiments. Once an experiment is selected, you may modify it all you
want. The choices are:
- Single Source: this is just a single source emitting circular
- Two Sources: this is just two sources emitting circular
waves, creating an interference pattern between them.
- Four Sources.
- Single Slit: this demonstrates diffraction of waves travelling
through a slit.
- Double Slit: this demonstrates diffraction of waves travelling
through a double slit.
- Triple Slit.
- Obstacle: this demonstrates diffraction of waves travelling
around an obstacle.
- Half Plane: this demonstrates diffraction of waves around
the edge of a plane.
- Dipole Source: this demonstrates an acoustic dipole source
consisting of two sources out of phase.
- Lateral Quadrupole: this demonstrates an acoustic quadrupole
source consisting of four sources arranged in a square.
- Linear Quadrupole: this demonstrates an acoustic quadrupole
source consisting of four sources arranged in a line.
- Plane Wave: this demonstrates a simple plane wave source.
- Intersecting Planes: this demonstrates two plane waves intersecting
at right angles.
- Phased Array: this is a group of point sources arranged
in a line, where the relative phases of each point is different.
This causes the radiation to be pointed in a downwards. The angle
can be adjusted with the Phase Difference slider.
- Doppler Effect 1: this shows a moving source, thereby demonstrating
the Doppler effect.
- Doppler Effect 2: this shows waves being reflected by a
moving obstacle. The horizontal obstacle on the right is moving up
and down. (The divider in the middle is just there to make the effect
more clear.) When the obstacle is moving up, the reflected waves
have a higher frequency than the source. When it's moving down, the
reflections have a lower frequency.
- Sonic Boom: this shows a source moving faster than the speed
of wave propagation, creating a shock wave behind it.
- Big 1x1 Mode: this creates a small box with a standing wave
in its normal mode of oscillation. The inside of the box changes
color with a simple time dependence with no left-right or up-down
- 1x1 Modes: this creates several small boxes of different
sizes in their fundamental modes. If you cut out the right side of
one of the boxes and turn up the brightness you can see waves coming
out of the box at its resonant frequency.
- 1xN Modes: this creates several small boxes in other normal
- NxN Modes: this creates several small boxes in other normal
- 1xN Mode Combos: this creates several small boxes, each
of which has a combination of two random 1xN modes.
- NxN Mode Combos: this creates several small boxes, each
of which has a combination of two random NxN modes.
- 0x1 Acoustic Modes: this creates several small boxes of
different sizes in their fundamental modes. The Fixed Edges checkbox
is off, which causes the waves to act like acoustic waves.
- 0xN Acoustic Modes: this creates several small boxes in
other acoustic normal modes. The mode frequencies are all multiples
of the fundamental, so you will see all the modes sync up periodically.
(This is not the case with the 1xN Modes example above.)
- NxN Acoustic Modes: this creates several small boxes in
other acoustic normal modes.
- Coupled Cavities: this creates pairs of boxes with a small
interconnection between them. This causes the oscillation energy
to move back and forth between the two boxes.
- Beats: this creates two sources close together with different
frequencies. Because the frequencies are close but not exactly the
same, you will see black lines of interference or "beats".
- Slow Medium: in this demonstration, the area below the blue
line has a different refractive index, so that waves move slower
through that area. As a result, waves hitting the the blue region
will be partially reflected and partially transmitted. Waves travel
through the blue region at half the speed as they travel through
the black region, so the blue region has a refractive index of 2.
As a comparison, most common types of glass have a refractive index
anywhere from 1.46 to 1.96.
- Refraction: this creates a blue region similar to the last
setup, but shows short pulses hitting it at an angle so you can see
the waves being reflected and refracted.
- Internal Reflection: this creates a blue region similar
to the last setup, but shows short pulses hitting it at an angle
from inside the blue region. The angle is such that none of the main
part of the wave is transmitted; this is called total internal reflection.
You will see some activity in the blue area; this is partly because
the top part of the wave is rounded instead of being a plane, so
that it hits the interface at a different angle (it goes up from
the source instead of diagonally). This part is transmitted, but
the plane part going diagonally is reflected. But, even for the part
of the wave that is reflected, you will a portion of the wave travelling
along the interface between the blue and black area; but it will
not propagate into the black area.
- Zone Plate (Even): This creates a zone plate, which uses
diffraction to focus light.
- Zone Plate (Odd): This creates another zone plate which
is similar to the previous one, but has opaque areas made transparent
and vice versa. It also focuses light.
- Circle: This creates a circular area with a source at the
center. Pulses will travel outward and will then be reflected back
to the center.
- Ellipse: This creates a circular area with a source at one
focus. Pulses will converge at the other focus.
- Resonant Cavities 1: This creates a series of rectangular
cavities being driven by a plane wave from above. As you change the
frequency you will see the response of each cavity change. Each cavity
has a different resonant frequency so it will respond differently.
After changing the frequency you may want to wait a bit for things
to settle down (or turn the simulation speed way up).
- Resonant Cavities 2: This creates a series of smaller rectangular
- Room Resonance: This shows acousting standing waves in a
series of rooms being driven by the same frequency, but at different
positions. The brightness is turned way down so you only see waves
in the rooms that resonate. As you can see, three of the rooms resonate
but the fourth does not, because the source is not located in the
right place (there aren't any modes with the right frequency that
have antinodes at the source location). By varying the frequency
you can see different resonance behavior. (You may want to turn the
simulation speed up so you get faster results as you experiment.)
- Waveguides 1: This creates a series of waveguides of different
widths. Narrower waveguides, like at the left end of the screen,
have higher cutoff frequencies; the leftmost waveguide has a cutoff
frequency that is higher than the source, so there is no wave motion
in it. You can fix this by turning the Source Frequency slider
Notice that the waves seem to be moving faster in thinner waveguides.
They appear to be moving faster than waves normally move in the
applet. This is because the phase velocity is faster in thinner
waveguides; but the signal velocity is actually slower than normal,
as you can verify by clicking the Clear Waves button and
watching the wave move down the guide for the first time.
Since the waveguides are being driven by a plane wave, only
the TE01 mode is present. (See the waveguide applet for another
way to view waveguide modes.)
- Waveguides 2: This is just the same set of waveguides
with a lower frequency, showing that more of the guides
are driven below cutoff.
- Waveguides 3: This is a set of identical waveguides
being driven by small holes at different locations. This
causes different sets of modes to be excited in different
proportions. When the guide is being driven near the center,
the TE01 mode is dominant, but when it is driven near the
edge, the TE02 mode is more prevalent. The frequency is
low enough so that all other modes are cut off. You can
fix this by turning the frequency up. By turning the frequency
down, you can cut off the TE02 mode as well.
- Waveguides 4: This is a set of acoustic waveguides
being driven at various locations.
- Waveguides 5: This is a set of identical waveguides
with various modes present. The first waveguide contains
the TE01 mode; the second contains the TE02 mode; the third
contains both; the fourth contains the TE03 mode; the fifth
contains TE01 and TE03; the sixth contains TE02 and TE03.
(There may not be room on your screen for all these modes
if your resolution is not set high enough.)
Notice that the higher modes (TE02 and especially
TE03) seem to be moving faster. This is because the
phase velocity of TE02 and TE03 is greater than that
of TE01. Their signal velocities are slower, though,
which is why it takes the TE03 wave so long to make
it down to the end of the waveguide. Also if you turn
off the source (by setting the source popup to "No
Sources") it will take quite a while for the TE03 mode
- Horn: The interesting thing
about an exponential horn is it acts
as a high-pass filter. Low-frequency
sound waves do not travel through it
as well as high-frequency waves. Try
modifying the frequency to test this.
- Parabolic Mirror 1: This shows
a parabola with a source at the focus.
The parabola direct the waves upward
as plane waves (except at the edges
where the waves don't look planar;
if we extended the parabola further
it would fix this).
- Parabolic Mirror 2: This shows
a parabola with plane waves coming
from above. They converge at the focus.
- Sound Duct: This shows a duct
with sound waves travelling through
it. When they get to the end, they
are partially reflected, even through
there is nothing there for them to
bounce off of. This shows that waves
are reflected by any discontinuity,
not just by walls.
- Baffled Piston: This shows
the sound radiation from a baffled
piston, which is a simple model of
a boxed loudspeaker.
- Low-Pass Filter 1, 2: This
shows an acoustic low-pass filter.
Low-frequency waves travel through
it more easily than high-frequency
waves, as you can verify by comparing Low-Pass
Filter 1 with Low-Pass Filter
2. (These two setups are the same
except for the frequency.) However
there are a few higher frequencies
which will pass easily. If you follow
the link you can take a look at the
frequency response curve.
- High-Pass Filter 1, 2: This
shows an acoustic high-pass filter.
High-frequency waves travel through
it more easily than low-frequency waves,
as you can verify by comparing High-Pass
Filter 1 with High-Pass Filter
- Band-Stop Filter 1, 2, 3:
This shows an acoustic band-stop filter,
which blocks out a range of frequencies.
There are three versions of this setup;
one at a low frequency, one high, and
one at the blocked frequency.
- Planar convex lens: This shows
a lens made out of a glasslike material.
It focuses plane waves. Unfortunately
the lens is pretty small compared to
the wavelength of light so it won't
focus the light as well as it would
in real life. This lens is only a dozen
or so wavelengths wide. The range of
visible light wavelengths is 400 to
700 nanometers, so obviously a real
lens is much larger compared to a wavelength
and so will focus better without running
into diffraction effects.
- Biconvex lens: This shows
another lens. It takes line coming
from a point source and focuses it
at another point.
- Planar Concave Lens: This
shows a lens that takes plane waves
and spreads them out.
- Circular Prism: This shows
a round prism made out of a dense material.
- Right-Angle Prism: This shows
a prism that takes waves travelling
down and points them to the right.
- Porro Prism: This shows a
prism that takes waves travelling down
and points them up. Obviously in real
life it would do this at light speed.
- Scattering: This shows a plane
wave being scattered by a point particle.
- Lloyd's Mirror: This shows
an interferometer which consists of
a point source close to a mirror (at
the bottom of the window). The waves
coming from the source interfere with
the waves coming from its mirror image.
- Temperature Gradient 1: This
shows refraction of a wave due to a
temperature gradient. The blue area
represents cool air, where sound waves
move more slowly. This causes the waves
to bend downwards.
- Temperature Gradient 2: This
shows refraction of a wave due to a
different type of temperature gradient.
The blue area represents cool air,
where sound waves move more slowly.
This causes the waves to bend upwards.
A similar effect is responsible for
- Dispersion: This demonstrates
dispersion, which is an effect that
causes waves to move at different speeds
depending on their frequency. This
effect is unavoidable because of the
finite differencing method used to
design this applet. Note that the low-frequency
waves on the left move faster than
the high-frequency waves on the right.
The waves are moving through a slow
medium to illustrate the effect better,
but dispersion occurs even without
a medium in this applet.
Usually the effect is not noticeable,
unless you are using sources of
two different frequencies. However,
if you use the mouse to edit the
wave function (using the Edit
Wave setting on the Mouse popup),
the changes you make will have
sharp edges and other high-frequency
components. As a result, you will
create a wave that spreads out
quite a bit as it propagates; there
will be an initial wavefront that
quickly travels to the edges of
the screen, but there will be a
bunch of high-frequency noise left
behind which will hang around for
a while (you can see it better
if you turn the brightness up).
This would not happen in a nondispersive
medium or in a medium where high-frequency
waves are faster than low-frequency
The Source popup controls the wave sources. It has the following
- No Sources: there will be no source of new wave motion except
for waves you create with the mouse.
- 1 Src, 1 Freq: there will be a single source of sinusoidal
waves at a single frequency (set using the Source Frequency slider).
This source can be dragged anywhere on the screen with the mouse.
- 1 Src, 2 Freq: the source will be emitting two waves, at
separate frequencies. The first frequency is set using the Source
Frequency slider, and the second frequency is set using 2nd
- 2 Src, 1 Freq: two sources will be created, both at the
same frequency. But you can select the phase difference using the Phase
Difference slider. If the slider is all the way to the left,
the sources will be in phase; if it is all the way to the right,
the sources will be 180 degrees out of phase. (The top one will be
green while the bottom one is red, and vice versa.)
- 2 Src, 2 Freq: the two sources will be at different frequencies.
The Source 2 Frequency slider can be used to set the second
- 3 Src, 1 Freq or 4 Src, 1 Freq: 3 or 4 sources will
be created, all at the same frequency.
- 1 Src, 1 Freq (Square): the source will emit a square wave.
This works best at low freqencies; at high frequencies it is hard
to tell it from a sine wave.
- 1 Src, 1 Freq (Pulse): the source will emit green pulses
- 1 Moving Src: the source will move, thereby demonstrating
the Doppler effect. The speed can be controlled with the Source
- x Plane Src, y Freq: the source(s) will emit plane waves
rather than circular waves. The location and direction of the plane
wave can be modified by dragging one or both of the two blue circles.
If the blue circles are located at the edge of the screen, the plane
is extended offscreen; otherwise it is not. If it is not extended
offscreen it is finite and so is not a true plane wave, strictly
- 1 Plane 1 Freq (Pulse): the source will emit plane wave
- 1 Plane 1 Freq w/Phase: see the "Phased Array" setup.
The Mouse popup controls what happens when the mouse is clicked.
If the popup is set to Mouse = Edit Wave, then a green or red
area is drawn on the screen. When the mouse is released, this will create
a circular wave centered at that point.
If the popup is set to Mouse = Edit Wall, then clicking on a
point will create a wall there which will reflect waves. Clicking on
a wall will erase it.
If the popup is set to Mouse = Edit Medium, then clicking on
a point will create (or remove) an area which has a higher refractive
index than the surrounding area, so that waves will move slower through
it. This area will be shown in blue.
If the popup is set to Mouse = Hold Wave, then if you click
on a point and hold the mouse down, it will create a green area on the
screen which will persist as long as the mouse is down. This will cause
the surrounding area to also be green. For sound waves, this is like
adding air at that point; it puts more pressure on the surrounding area.
If you click on a green area instead, it will turn it red.
The Clear Waves button clears out any waves but does not remove
any walls or sources. The Clear Walls button clears out walls
without clearing out waves.
The Add Border button add walls all around the edge of the screen,
so the waves will be reflected at the edges of the screen. If you don't
put walls up, then the waves will just drift off the edge of the screen.
These walls can be removed with the Clear Walls button; or you can remove
some of them with the mouse, if you set the mouse popup to "Mouse = Edit
The Stopped checkbox stops the applet, in case you want to take
a closer look at something, or if you want to work on something with
the mouse without worrying about it changing out from under you.
The Alternate Rendering checkbox is used to speed up rendering,
but it actually slows things down on some machines. (Internally, it uses
the MemoryImageSource class instead of drawing a bunch of rectangles.)
The Fixed Edges checkbox determines what happens when the wave
hits a wall. To simulate sound waves, this should not be checked.
To simulate electromagnetic waves or waves in a membrane, this should be
checked. If this box is unchecked, waves will be reflected with no phase
change (so, green wavefronts will still be green when reflected). If
it is checked, waves will be reflected negatively (green wavefronts will
be red when reflected). Different types of waves have different boundary
conditions when they hit an obstacle, and that's what determines the
behavior when a wave is reflected.
A good example to illustrate this is a string. If you have a string
under tension, fixed at either end, then waves going in one direction
along the string will be reflected negatively when it hits the end of
the string, because the two wavefronts (incident and reflected) have
to add up to zero at the end of the string. If the end of the string
is allowed to move freely up and down, then a wave will be reflected
positively when it hits the end of the string, because the wavefronts
no longer have to add up to zero at the edge. A similar argument applies
to the two-dimensional case.
The Simulation Speed slider controls how far the waves move
between frames. If you slide this to the left, the applet will go faster
but the motion will be choppier.
The Resolution slider allows you to speed up or slow down the
applet by adjusting the resolution; a higher resolution is slower but
The Damping slider controls how quickly waves die out after
they are emitted from a source. If you slide this to the right, waves
will die out more quickly.
The Brightness slider controls the brightness, just like on
a TV set. This can be used to view faint waves more easily.
Now a list of some of the many types of waves simulated by this applet.
(Actually the applet only simulates two basic types of waves, but you
can interpret the waves as being many different types.)
- Sound waves are longitudinal waves in air or other fluids.
The green areas are high pressure, and the red areas are low pressure.
To simulate sound waves, the "Fixed Edges" checkbox should be unchecked.
On my computer, at the default settings, a wave takes about
four seconds to travel across the screen. In real life, at typical
temperatures, sound waves travel about 340 meters/second or about
1100 feet/sec (760 mph).
- Compression waves are longitudinal waves in solids.
These are similar to sound waves. This applet does not properly
simulate the dispersive effects that would occur in a real
solid. (In this applet, low frequency waves go faster than
high frequency waves, whereas in a solid it is the opposite.)
The green areas are high compression, and the red areas are
low compression. The "Fixed Edges" checkbox should be unchecked.
- Water waves are actually far more complicated
than the simplified wave model used by this applet.
But if we keep the amplitude of the waves small,
we can pretend that the waves represent water waves.
The green areas are where the water is high, and
the red areas are where it is low. To simulate
water waves, the "Fixed Edges" checkbox should
be unchecked, because there are no constraints
on what the water level should be at the edge of
- A membrane is a thin elastic
substance under tension, like a sheet
or a square drum head. The green areas
are where the sheet is higher than the
edges, and the red areas are where the
sheet is lower. The edges are at a fixed
level, so the "Fixed Edges" checkbox
must be checked.
- Electromagnetic waves are
radiation produced by electric
and magnetic fields. Light,
radio waves, and microwaves
are all electromagnetic waves.
The green areas are where the
electric field is in the positive
z direction, and the red areas
are where the electric field
is in the negative z direction.
The magnetic field is not shown.
The "Fixed Edges" checkbox
should be checked to properly
simulate electromagnetic waves.
On my computer, at the default settings, a wave takes about
four seconds to travel across the screen. In real life, electromagnetic
waves travel at about 300 million meters/second or about 186,000
Let me know if you have problems running this applet. I may not be
able to support all the older browsers though. On old versions of netscape,
this applet may stop every so often (with an out of memory error being
reported in the java console). If that happens uncheck the "Alternate
Click here to go to the applet.