Hover over the menu bar to pick a physics animation.

After many tries at obtaining a sustained sound wave in a digital gas, I have come to the conclusion that I must have continuous repelling force between particles. So this will have a short range repelling force between particles rather than hard sphere collisions. The force function I choose is:

`bb "F(r)"=f((bb "r"-bb "r'")sigma^n/|bb "r"-bb "r'"|^(n+1))\ \ \ (1)`

where `bb "r" and bb "r'"` are the particle locations, f is a force constant (Newtons), `sigma` is a scaling length, and `n` is an integer. Equation 1 indicates that a particle at `bb "r"` will be accelerated away from a particle at `bb "r'"` along the direction `bb "r"-bb "r'"`. A simple modification of equation 1 causes it to have a longer range attractive force as well as the repulsive force:`bb "F(r)"=f((bb "r"-bb "r'")sigma^n/|bb "r"-bb "r'"|^(n+1)-sigma^(n/2)/|bb "r"-bb "r'"|^((n/2)+1))\ \ \ (2)`

Including attractive forces as in equation 2 can be selected by clicking the checkbox "Include Attractive Forces".I provide two options to initiate waves:

1. Initial sinusoidal displacement in the x direction of the particles from their nominal spacings.

2. A piston at the left end of the chamber that moves sinusoidally.

Both options have sliders that permit the learner to adjust the parameters.
**The options are selected by the radio buttons on the left of the sliders.**

In addition to the forces between particles in equation 1 or 2, boundary forces are required to keep the particles from escaping the chamber. These are in the form of very narrow force fields at each boundary. For example, at the left end of the chamber the force on a particle at x location `x_p` is:

`bb "F"=f_B bb hat "x" (x_p/a)^2`

If `x_p` is less than `a` and `bb "F"=0` if `x_p` is greater than a. Here `f_B` is a force and a is a short scaling length.Let me explain the Fourier transform and the FFT. A Fourier transform results in the spatial frequency spectrum of the density bins. If a waveform exists on the density bins then the FFT will find the frequency components of the waveform. An equation for a one dimensional discrete Fourier transform of the function `f(x)` is:

`F(k)=int_0^Lf(x)exp(i kx)dx`

where `i=sqrt(-1)`. Therefore `F(k)` usually includes both real and imaginary parts. Here, however, only the magnitude of `F(k)` will be used. The FFT spectrum is an array that has the same number of elements as the number of density bins. It also includes positive spatial frequency components as the first half of the array and negative frequency components as the second half. In the case of the Initial Displacement we have a learner selectable n cycles low frequency sinusoidal wave superimposed on the natural frequency associated with the planes initial planes of the particles along the x direction. Under initial conditions this leads to arrays of FFT peaks centered at 64 and -64 cycles separated from each other by the "Amplitude Cycles". This is expected because frequency modulation always results in components equal to the sum and differences of the original carrier (high) frequency and the modulation frequency. Since the wave is mostly a standing wave, we also expect the negative frequencies of the same amplitude as the positive frequencies.With builtin pressure, I expected to see sustained waves but, as you can see from the Perticle Displacement plot and FFT, the waves die out within just a few cycles. This was not the case for the one dimensional wave. My conclusion is that there is something about a real gas that is not being emulated by this digital gas even though this gas has what I would call a standing pressure. The reason I wanted to try a continuous repelling force can be seen when examining how waves that are induced on a guitar string. A slack string cannot sustain a wave. A wave requires that the string has builtin tension. This tension is modified when the string is picked or strummed. That results in a 2 dimensional distortion of the string, some particle displacement along its length and much larger particle displacement perpendicular to its un-picked length. The wave that ensues does die out after many cycles. But, for the string, the rate of amplitude decrease is determined by a combination of air drag and the imperfect elastic resilience of the string. As for the digital gas, I suspect that the reason the wave dies out is that the original motion in the x direction gets transferred to the y and z directions. But the same transfer must happen when a acoustic speaker is located at the left end of a long room. But for this sound wave, the wave is reflected off of the side walls and travels, a bit distorted, to the right end of the long room. Why doesn't my digital sound wave behave in the same way? One thing we have not taken into consideration is that a single ear doesn't detect direction of sound, just the variation of the pressure at its location. By the ideal gas law pressure, `P` is given by the equation:

`P=2/3 n E_("average")`

where `n` is particle density in a volume element at location `(x,y,z)` and `E_("average")` is the average kinetic energy in the same volume element. I have plotted pressure at various locations inside the chamber and it results in initial waves as well but they die out quickly. An equivalent consideration is the fact that the induced wavelength, `lambda`, is considerably longer than the height and depth of the chamber. That means that the diffraction half angle is `theta=tan^-1(lambda/H)` which is nearly `pi/2` radians for most of my parameters. So the wave spreads due to diffraction and thereby becomes jumbled. In order to reduce this spreading I would have to decrease the wavelength or increase `H` and `D`. Both of these changes will slow the calculation greatly.Canvas 1: 3D Animation of Particles

Canvas 2:Particle Density Plotted Vs x Position

Canvas 3:Fourier Transform (FFT) of Particle Density