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 sort.

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 it.

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 wave's path.


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:

The Source popup controls the wave sources. It has the following settings:

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 Walls".

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 looks better.

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.)

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 Rendering" box.

Click here to go to the applet.



java@falstad.com