NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Wave and Fluid => Topic started by: Fu-Kwun Hwang on January 20, 2009, 10:46:47 pm



Title: EJS version of Doppler effect (You can hear sound)
Post by: Fu-Kwun Hwang on January 20, 2009, 10:46:47 pm
(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=873.0;attach=3997;image)(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=873.0;attach=3999;image)
This java applet show the Doppler effect.
Click inside the simulation region to select initial position for wave center.
While press down the mouse, drag the mouse to change the velocity for the wave source. (This is a moving point source)

The wave speed and the period of the wave (f=2*π/T) is adjustable by sliders.
If the source speed is smaller than wave speed. An ear gif image will appear in the simulation region(you can drag it to other position).
You will hear a sound click when the wave front pass the ear. (The frequency of the click sound is related to Doppler effect)

You will find wave pattern for shock wave when the source speed is larger than wave speed.
-*-
[ejsapplet]

The following is a flash demo


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: j142 on January 28, 2009, 01:14:51 pm
Can you upload the sound of train or ringing bell instead of clicking sound?

we will be have  experience of frequencies change while we are at railway station.


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: Fu-Kwun Hwang on January 28, 2009, 04:22:59 pm
All the simulations I have created at this web site are ailable for offline use.
The above simulation was created with EJS 4.
You can click "get files for offline use" button and get the jar file.
You will find ejs source code if you unzip the jar file with any UNZIP program.
Load the source with latest EJS 4 and you can switch to any sound file (.wav format) you have.

However, it is still different from the experience in real life. 


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: lookang on September 12, 2011, 10:27:20 pm
dear Prof,

i am wondering, can make a scalarField that is for doppler effect?

i am thinking with a template of your codes, i can try to make
http://www.falstad.com/ripple/ (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=873.0;attach=4439;image)

with many options


currently, my attempt is not working

a summary of the codes is


for (i=0; i < number; i++)
{
 xscalar = xmin+(xmax-xmin)*i/number;
 for (j=0; j < number; j++)
 {
  yscalar = ymin+(ymax-ymin)*j/number;
  d[ i ][ j ]=Math.sqrt((xscalar-x)*(xscalar-x)+(yscalar-y)*(yscalar-y));
//sum [ i ][ j ]= A1*Math.cos(omega*t-k*d[ i ][ j ]);
//sum[ i ][ j ]= A1*Math.cos(omega/4*t);
sum[ i ][ j ]= A1*Math.cos(-k*d [ i ][ j ]);
}
}


Thanks!  :D


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: SidneyR on November 24, 2013, 01:36:30 pm
Dear Professor,

This is very helpful stuff.  I'm curious though - when I downloaded
the Doppler Effect program, there was no ear, and I couldn't hear any
sound.  Is there supposed to be an ear in the download version?

Many thanks,
SidneyReilly


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: lookang on November 26, 2013, 10:15:52 pm
attached is the file u requested


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: lookang on November 26, 2013, 10:18:20 pm
i also have another version that does the same thing but i have edited it to be have inquiry features.
http://weelookang.blogspot.sg/2011/09/ejs-open-source-1-dimension-doppler.html



Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: Fu-Kwun Hwang on November 29, 2013, 08:39:26 am
Dear Professor,

This is very helpful stuff.  I'm curious though - when I downloaded
the Doppler Effect program, there was no ear, and I couldn't hear any
sound.  Is there supposed to be an ear in the download version?

Many thanks,
SidneyReilly


Yes. There is an ear in the simulation. However, I do not know why it was missing in the downloaded version.
It is fixed now.
Please download it again.


Title: Re: EJS version of Doppler effect (You can hear sound)
Post by: Fu-Kwun Hwang on December 04, 2013, 12:01:56 pm
Another version: source velocity, observer velocity,wave velocity can be changed.