This java applet demonstrates standing electromagnetic waves in a 3-d rectangular box, or cavity resonator.
At the top of the applet on the left you will see the cavity, oscillating in one of its modes. The color green means that an electric field component is present and is pointing in the positive or negative y direction.
Below the cavity you will see a series of grids showing each normal mode's contribution to the vibration. The TE modes (modes with the electric field vector perpendicular to the z axis) are shown on top and TM modes (modes with the magnetic field vector perpendicular to the z axis) are shown on the bottom. Move the mouse over a grid square to see what mode it represents.
Each element of the grid has a color which indicates the presence or absence of that mode. Black means the mode is not present; green means the mode is present with a positive coefficient, and red means it is present with a negative coefficient. In addition, each mode may have a phase shift, which indicates that its oscillatory cycle leads or lags others with the same frequency. This is indicated by a vertical blue line.
A phase shift is normally hard to detect. If the applet is stopped, then by altering the phase of a mode you can see the mode oscillate. If the applet is running it is much harder to tell, except in a case which will be explained later.
You can add or remove a mode by clicking on it. If you click and drag up and down you can fine-tune the magnitude of the mode. If you drag left and right you can alter the phase shift.
Double-clicking on a mode will clear all other modes and just set that one.
For performance reasons, only 10 modes can be active at a time.
The Show Electric Field popup will let you select which field is shown: the electric field, the magnetic field, or both. You can also view the currents or charge in the walls.
The Show Field popup controls how the field is displayed. The choices are:
The Show Field popup also controls how you can view the current; in that case, think "current vector" when you see "field" in the above directions. There is only one way to view the charge, however; green means positive charge and red means negative.
The Slice popup allows you to look at planar slices of the cavity rather than looking at the contents of the entire cavity. If the popup is set to No Slicing, you view the entire cavity. Otherwise you will see the cavity sliced in one of three directions. The location of the slice can be adjusted by dragging the line running along the sides of cavity near the slice.
The Mouse popup controls what happens when you click on the cavity. If you set it to Adjust Angle or Adjust Zoom, you can adjust the orientation or size of the 3-d view by clicking and dragging on the cavity.
The Stopped checkbox can be used to stop the applet for a moment.
The Stop Oscillation checkbox can be used to stop the oscillation for a moment; this is useful when "Show Particles" is selected. The particles keep moving, to illustrate the field lines, but the oscillation of the electric and magnetic fields stops so the field lines are easier to follow.
The Show Spectrum checkbox can be used to show or hide the spectrum of mode frequencies. Each mode is represented on the spectrum by a vertical line. Higher frequencies are on the right. In some cases, multiple modes will have the same frequency. This is called degeneracy. When that happens, the line for that frequency will be taller than normal. The more modes have the same frequency, the taller the line.
The Show Sides checkbox shows the field on the sides of the cavity rather than inside.
The Alternate Rendering checkbox is used to speed up rendering, but it actually slows things down on some machines. Also for large windows and low resolutions it is usually slower. (Internally, it uses the MemoryImageSource class instead of drawing a bunch of rectangles.)
The Oscillation Speed slider controls the speed of oscillation.
The Particle Speed slider controls the speed of the particles.
The Number of Particles slider controls the number of particles.
The Brightness slider can be used just like the brightness on a TV, to brighten dim areas of the cavity.
The Image Resolution slider can be used to generate a higher quality image. If you move it to the right, it will increase the resolution of the image, but it will also slow things down, so be careful.
The Width and Height sliders will adjust the width or height of the cavity. This changes the frequency spectrum. The depth can't be changed.
The Clear button clears all modes.
The Reset Particles button resets the particle positions to some random state.
Normally each mode has a different frequency. However in some cases, several modes can have the same frequency. This is called degeneracy. The presence or absence of degeneracy depends on the dimensions of the cavity. By default the width, height, and depth are equal, which means it is a cube. In this case, all the m,n,p modes are degenerate, because they have the same frequency as the n,m,p modes, and the m,p,n modes, and the p,n,m modes, and so on. If the width, height, and depth are not all equal, there often is no degeneracy. There may be some, if two or more of the cavity dimensions have a ratio equal to an integer or a simple fraction. The width and height slider ranges from 1/2 to 3, so if either slider is set to one of those extremes, there will be degeneracy.
When two or more modes have the same frequency, each one is shown in yellow.
The interesting thing about degenerate modes is that if you combine them, you get a new mode that oscillates with simple harmonic motion, just like any other mode. Since both modes are oscillating at the same rate, you can't tell them apart. If one of the modes has a phase shift relative to the other one, then the wave will change shape at a rate equal to the frequency of the modes.