NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
September 23, 2020, 11:11:48 pm

Know the universe as yourself and you can live anywhere in comfort. ...Lao Tzu (570-490 BC)

 Pages: [1]   Go Down
 Author Topic: Ejs Open Source Ripple Tank Interference Model java applet  (Read 50886 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message on: January 08, 2011, 11:20:50 pm » posted from:Singapore,,Singapore

Ejs Open Source Ripple Tank Interference Model java applet a remix from Interference Model: Ripple Tank written by Andrew Duffy http://www.compadre.org/osp/items/detail.cfm?ID=9989

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
• Please feel free to post your ideas about how to use the simulation for better teaching and learning.
• Post questions to be asked to help students to think, to explore.
• Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

Description adapted from the original by Andrew Duffy
Interference in Two Dimensions of 2 source
With this simulation, you can explore the interference pattern that results from the superposition of two sources of waves. The simulation models what happens
a) two speakers, emitting sound waves;
b) two oscillating bobbers or dippers in a water tank, producing water waves;
c) two light sources, so the interference is with two light waves.

In the simulation,
1) red regions (depending on the type of visualization selected) are areas where the net displacement is positive (such as when two peaks overlap)
2) blue regions are areas where the net displacement is negative (such as when two troughs overlap).
3) In the black regions, the net displacement is zero, or close to zero.

To understand this pattern, we use the idea of the path-length difference, S1P - S2P. There is a movable blue-point P in the simulation. The path-length difference (∆L) for this point is the distance the point is from one of the sources minus the distance the point is from the other source, or simply S1P - S2P. These distances are expressed in units of the wavelength λ.
When the sources send out waves that are in phase with one another, the waves will interfere completely constructively when the path-length difference is an integer number of wavelengths, and they will interfere destructively when the path-length difference is an integer number of wavelengths, plus half a wavelength. We can express this in the form of equations.
When the sources are in phase
condition for constructive interference: ∆L = m λ, where m = 0, 1, 2, ...
condition for destructive interference: ∆L = (m + 0.5) λ, where m = 0, 1, 2, ...

Activities by Andrew Duffy
1 First, press the Play button to start the simulation running. One thing the simulation can help with is in understanding how this interesting pattern is formed, from two sources that put out identical single-frequency waves. Click-and-drag the blue dot P to change its location on the screen. You should observe that, whenever the blue point P is at a position in which there is a large amplitude displacement, that the path-length difference for that point (shown in blue bar at the bottom right) is an integer number of wavelengths (or close to it). In contrast, whenever the blue point P is at a position in which there is generally no displacement (it's always dark there), the path-length difference for that point is an integer number of wavelengths plus half a wavelength (or close to it).

2 Explore different points on the line joining the two sources. In between the sources, along the line joining the sources, you should observe a standing wave, with nodes (zero displacement points) and anti-nodes (maximum displacement points) that are fixed in position. For a node, you should measure a path-length difference that is close to an integer number of wavelengths plus half a wavelength. For the anti-nodes, you should observe a path-length difference that is close to an integer number of wavelengths. Is this what you find? Explain why you will always find an anti-node at the place that is halfway between the two sources.

3 Let's keep exploring what happens along the line joining the two sources, but now place the blue point P on this line, to the right of the source on the right. Adjust the frequency of the waves, or the x-coordinate of one or both of the sources, until the path-length difference is 3 wavelengths. Is constructive interference taking place at the point, or is it destructive interference? What is the distance between the sources (expressed in terms of wavelengths) in this case? Repeat, when the path-length difference is 3.5 wavelengths.

4 The wave speed has a constant value in the simulation. With the wave speed constant, what happens to the wavelength when the frequency is increased? In general, what happens to the pattern when the frequency is increased?

5 In general, what happens to the pattern when the two sources are move closer together?
 Ejs_Open_Source_Ripple_Tank_Interference_Model_java_applet_001.png (54.03 KB, 758x634 - viewed 897 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: February 21, 2019, 08:59:16 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: January 08, 2011, 11:21:29 pm » posted from:Singapore,,Singapore

1 redesign layout and color scheme
2 add v and lambda slider controls
3 add time to show the progress for student to use v to calculate how much the wave move
4 add the 4 types of visualization
5 add the 10 mode of color visualization
6 add legend, suspect buggy but will try to activate it for relation learning to the visualization meaning of color
7 add S1 and S2 y displacement as vertical bar for understanding of phase difference at the sources S1 and S2
8 add y1 and y2 and y1+y2 for the y displacement for understanding of superposition of point P
17Jan2010
9 added coherence and incoherence check-box for exploring what if scenario for exploring in-depth the meaning of incoherence.
incoherence here refer to v=!v2 || f=!f2 || lambda=!lambda2
31January 2011
10 added screen effects (instantaneous patterns and average intensity patterns) of the interference patterns for both coherent and incoherent sources from http://www.cabrillo.edu/~jmccullough/Applets/OSP/Oscillations_and_Waves/waves_interference.jar by Juan M. Aguirregabiria. now it is very easy to visualize the meaning of coherent sources.
10 February 2011
11 add check box to visual true S1, S2 and P bar values
12 add check box for visual instant and average pattern of the end of the screen for relating to future cases of interference as such light waves
14 fix a bug on the S1 and S2 bar with phase is change
15 made the area to display top view of ripple tank bigger to solve the bug of a line showing
16 made some animated gif to others to use here http://weelookang.blogspot.com/2011/01/ejs-open-source-ripple-tank.html
13 February 2011 Sunday
made the screen on the right more obvious by adding BR text "screen on the right"
add hint for activating the side views
30 March 2011
fix bug
the border on top and right corner of ripple tank is due to a fix relationship for the screen effect arrayoutofbound error that i cannot seem to fix
arrange the code inside
04 Jan 2012
reintroduce a side view versus time of the displacement at point P. the displacement-time graphs of S1, S2 and the resultant at any position P
fixed some 0.00 format on the bars of S1 S2 and P
fixed the bug by moving the codes to evolution page instead of fixed relationship, was difficult to find the bug or cause, but i did it!
made hide and show after clicking the check-boxes, a bit neater now, we agree that it could be still useful to be able to fine-control position of S1 and S2, let keep it inside the sim
dded a margin 10%, now can see the maximum and minimum values of 2 and -2 easily.
05 Jan 2012
selectable width now using split panels
 « Last Edit: January 05, 2012, 04:19:49 pm by lookang » Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #2 on: January 09, 2011, 11:23:31 am » posted from:Uberaba,Minas Gerais,Brazil

Nice applet, many days ago born my first baby
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #3 on: January 10, 2011, 09:36:43 pm »

all the best ahmedelshfie. parenting is super tiring especially if you are juggling make applet at home and using free time

Based on a rough idea i had some years ago
http://www.scribd.com/doc/46322449/Weelookang-Conceptual-Design-ProjectV1 p 11
the real difference today is i can make interactive java applet standing on the giants of Open Source Physics community instead of the conceptual paper i did which is pretty much just struck at the an idea stage.

Thanks to Andrew Duffy for his source original codes
and Fu-Kwun Hwang for this fantastic CoP forum
Paco for Easy Java Simulation
Wolfgang for Open Source Physics !

and many others whom i have not met but have learnt for the source codes and simulation!

Other Ripple Tank Inference Simulation
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2074.0 Interference of two point sources in 3D by Fu-Kwun Hwang
 « Last Edit: January 11, 2011, 01:10:47 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #4 on: January 13, 2011, 09:49:21 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

http://www.seab.gov.sg/aLevel/20102011Syllabus/9646_2011.pdf
SECTION lV WAVES Superposition
(d) explain the meaning of the term diffraction.

(e) show an understanding of experiments which demonstrate diffraction including the diffraction of water waves in a ripple tank with both a wide gap and a narrow gap.

(f) show an understanding of the terms interference and coherence.

(g) show an understanding of experiments which demonstrate two-source interference using water, light and microwaves.

may have to finer customized some more the meaning for coherence.

i argue that the best pedagogy method is in this case learning by making
the best way to demonstrate understanding of coherence is to get students to use Ejs to change the codes inside.
hint:
v1 = f1*lambda1
v2 = f2*lambda2
should do it.
when v1 =! v2 & f1=!f1 & lambda1=! lambda2 it will result in phi1=! phi2 in general except for those time of coincidence!

The less pedagogy effective method but more time efficient method is to make it happen in the sim by teacher.

the trade offs of deep pedagogy learning vs efficient time.

 « Last Edit: January 13, 2011, 10:20:10 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #5 on: January 17, 2011, 12:03:39 pm » posted from:,,Malaysia

17Jan2010
9 added coherence and incoherence check-box for exploring what if scenario for exploring in-depth the meaning of incoherence.
incoherence here refer to v=!v2 || f=!f2 || lambda=!lambda2

posting from Kuala Lumpur, Malaysia! Holiday!
 Ejs_Open_Source_Ripple_Tank_Interference_Model_java_applet.png (85.78 KB, 758x634 - viewed 1018 times.) « Last Edit: January 31, 2011, 11:38:16 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #6 on: January 31, 2011, 11:33:40 am » posted from:Singapore,,Singapore

31January 2011
10 added screen effects (instantaneous patterns and average intensity patterns) of the interference patterns for both coherent and incoherent sources from http://www.cabrillo.edu/~jmccullough/Applets/OSP/Oscillations_and_Waves/waves_interference.jar by Juan M. Aguirregabiria. now it is very easy to visualize the meaning of coherent sources.

sick today so at home.

i also found good resources
Like: a lot of possibilities
very complex and realistic

http://www.cabrillo.edu/~jmccullough/Physics/Interference_Wave_Nature.html
collection of good applets
 Ejs_Open_Source_Ripple_Tank_Interference_Model_java_applet_001.png (54.03 KB, 758x634 - viewed 800 times.) « Last Edit: January 31, 2011, 12:02:28 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #7 on: January 04, 2012, 02:16:48 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

a side view versus time of the displacement at point P. as suggested by chee wah, i think the original sim had it already.
fixed some 0.00 format on the bars of S1 S2 and P
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #8 on: January 05, 2012, 10:20:36 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

request by teacher Wed 1/4/2012 3:47 PM

We are wondering if you could include an optional check box to show
(i) the displacement-time graphs of S1, S2 and the resultant at any position
(ii) the intensity-position profile of the resultant wave
working on it, maybe next week can produce
As we explore the EJS, we realize that after some time, it seems that the resultant pattern was not correctly represented. We wonder if there might be a bug there. I have attached a word document for your reference.
i fixed the bug by moving the codes to evolution page instead of fixed relationship, was difficult to find the bug or cause, but i did it!

Also, we found that there may be no need to move the source horizontally, thus would it be possible to remove the slider-bars so as to keep the platform neater.
made hide and show after clicking the check-boxes, a bit neater now, we agree that it could be still useful to be able to fine-control position of S1 and S2, let keep it inside the sim

request by teacher Thu 1/5/2012 9:34 AM
I just managed to run the superposition EJS and would like to request the following changes if possible:

1. Currently in the graph mode, the pattern shifts right to the top and it is difficult to identify the position of P. I wonder if the graphs could be shown individually on the right side of the panel so that the students know which graph corresponds to which source and know which is the resultant wave. I would propose that the size of the pattern should remain the same, if possible.
i added a margin 10%, now can see the maximum and minimum values of 2 and -2 easily.

2. Currently, after running the EJS in the graphical mode and pausing it to show the step function. The graph continues to show the same shape. Clicking the step button causes the graph to shift forward in time, I was a bit confused initially trying to interpret the implication of the graph. I wonder if there is any way to help clarify this by looking at the graph. If not, I suppose the worksheet will need to try explain the meaning of it.

the graph data was currently is set to display only 75 data-points, to save memory.
if i set to infinity, it will slow down as the calculation to display all the infinity point takes a lot of memory.

3. After pausing the EJS, I start to shift point P around. Initially the graph still looks sinusoidal but after some time, the graph shows vertical line corresponds to the particular time paused. As the lines all overlap, I could not figure out what they are the values of the lines. The line does not seem to correspond correctly to the pattern as I shift point P around.

the student-scientist need to understand the graph shows old data, to collect new data on new position of P, click play again to start collect y1+y2 at P.
the values can be read from the bars on the right.

Thanks for the great simulation!
my pleasure

On a side note, for those who downloaded the file *.jar, Windows7 may associate it as a zip file. What my TA did was to change the file extension to jar instead of zip. To view the file extension, you would need to go the folder option/view and unchecked the "hide file extension".
yes agreed.

SMS Thu 1/5/2012 12:16 PM
Hi, my colleague prefers to view the JS without colors. Can this be the default screen? Also it seems that the legend slows down the system a bit. We think there may be no need for the legend, if it affects the computation. Ty.
done

SMS Thu 1/5/2012 12:26 PM
Thanks. Btw, did you experience the program hanging after some time, especially after changing the phase a few times and allowing it to run say around 100 s the EJS starts to slow down till it has no response
i didn't notice it on my computer, i ran for >100 seconds.

fix a useability issue of S12 and S2 draggable on simulation is playing, change to only when paused.

fix an array issue of border top and right white by  changing sum = [number][number]
 *** There are 2 more attached files. You need to login to acces it! « Last Edit: January 05, 2012, 01:57:48 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #9 on: January 05, 2012, 02:59:25 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

As NRF-MOE eduLab001 project,
May I share one computer model on ripple tank that I have designed for learning, for your use and further sharing-scaling up (a MP3 goal) with others interested in physics.
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2067.0
I have also attached the computer model, requires at least version 1.5 of Java (JRE)

1.   http://weelookang.blogspot.com/2011/01/ejs-open-source-ripple-tank.html or
2.   http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2067.0

Many thanks to
1.   Professor Andrew Duffy for his original simulation http://www.compadre.org/osp/items/detail.cfm?ID=9989
2.   Professor Juan M. Aguirregabiria for his simulation http://www.compadre.org/osp/items/detail.cfm?ID=7876
3.   Professor Fu Kwun Hwang for his OSP learning network and  2000+ models
4.   Innova JC , Chee Wah and Soo Kok for useful feedback to customize to their L&T requirements for their research in eduLab.
 « Last Edit: January 06, 2012, 07:52:23 am by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #10 on: January 05, 2012, 03:19:28 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

From a teacher Thu 1/5/2012 4:13 PM.

You are indeed amazing!

Yes, I suppose you are right that we may do away with the intensity graph as it looks pretty good with the current features. I suppose we can design the worksheet to check how students perceive from the pattern the intensity-position graph.
agreed

For the computer hanging of the JS, it seems that I didn't encounter it this time round with the update. We will explore further to see if it gives us problem again.
good

Some observation:
1. In the full screen mode, the graph seems to be occupy about a fifth of the screen. I wonder how it would look like if it occupies say a third? On the other hand, the size looks perfectly fine so long as I do not maximize the EJS.
it is selectable width now using split panels

2. I observe that the bar for S1P and the line S1P are in purple[magenta] while the S1 source is in red. Is it intended to be so?
yes!
i design that source S1 is RED and the path S1P is magenta
see picture

Thanks for the great EJS. We are truly impressed.
thank you! Open source Physics is awesome

Hi Professor Hwang!
you are truly amazing too hahahaha
 rippletank.png (70.38 KB, 758x634 - viewed 4268 times.)  rippletankslplitpanel.PNG (51.46 KB, 751x627 - viewed 3952 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 05, 2012, 04:10:21 pm by lookang » Logged
ahmedelshfie
Ahmed
Hero Member

Offline

Posts: 954

 « Embed this message Reply #11 on: January 06, 2012, 07:39:00 am » posted from:-,-,EGYPT

Nice work lookang, keep it up
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #12 on: January 06, 2012, 12:53:10 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

thanks ahmed

another request from teacher Fri 1/6/2012 1:48 PM

We prefer the previous design but we are wondering if the size of the graph can be made a bit bigger, in compromise of either the wave pattern or the fringe pattern. One suggestion is as shown in the document. You may make other adjustment as you deem necessary.
i set the graph to be width = 450, in full screen view, it looks great. in applet default view, it looks big.
i also made the intensity patterns from width = 100 to 75 each

 feedbackripple.PNG (156.54 KB, 1280x800 - viewed 780 times.)  rippletankfeedback.png (322.73 KB, 874x548 - viewed 676 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 06, 2012, 01:49:27 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #13 on: January 25, 2012, 01:56:01 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

another good request from teacher Wed 1/25/2012 11:45 AM
I was working on the worksheet for superposition and would like to request for the following feature:
1. Instead of S1P - S2P, could it be shown as |S1P - S2P| to show that we are measuring the magnitude. Alternatively we can show S1P - S2P to be negative to indicate that S1P is shorter than S2P. For your consideration, please
done made " |S1P-S2P| = 0.## "

2. Can the distance S1P - S2P, Px and Py be shown to 2 s.f.?
two decimal place can? implemented
2 significant figures could be look like this
1.2E0 = 1.20
9.9E-1 = 0.99
a bit harder to read but it is 2 significant figures:)

3. Also, was wondering if there is a need for the pop up when we first open the EJS? The information provided may be slightly different from the activities that the students would be exploring.
hidden now
 Ejs Open Source Ripple Tank Interference Model java applet.PNG (95.46 KB, 752x630 - viewed 900 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 25, 2012, 02:09:30 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #14 on: January 25, 2012, 02:50:49 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

request Wed 1/25/2012 3:18 PM

It seems that you have yet to change Px and Py to 2 d.p.
done now!

Also, realised that at destructive interference at some position, it shows S1P = 8.47 and S2P = 7.96 but the difference is 0.50(lamda), I suppose it is due to the division and rounding off. Is there a possibility of having this fixed?
yes, i think i see some rounding off error, but i don't know if it is serious bug that need to solve.
seems ok to me when i play with it through the slider
the error seems to be possible when the user drag the point P, i think it is a trade-off between round-off error possible sometimes or disable the drag-gable point P.
 rippletankbug.png (242.64 KB, 751x441 - viewed 760 times.)  ripplebetternow.png (128.11 KB, 1051x634 - viewed 727 times.)  rippletankkroundingofferrorcansolved.png (116.13 KB, 758x634 - viewed 768 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: January 25, 2012, 03:41:28 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #15 on: January 29, 2012, 03:46:58 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

29 Jan 2012 Sunday

added A1 and A2 as input fields to allow amplitude of S1 and S2 to be selectable-changeable variables instead of the usual 1 unit
made the graph lines stroke = 2 and 4 respectively thicker for easier visualization
 *** There are 2 more attached files. You need to login to acces it! « Last Edit: January 29, 2012, 09:27:45 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #16 on: February 16, 2012, 09:55:33 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

discontinued a best version with legend and autoscale.
attached is the source file
 ejsrippletankbest.png (102.28 KB, 664x639 - viewed 711 times.) *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #17 on: March 13, 2012, 09:56:04 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

changes after lesson research with students

made dt = 0.025 from 0.05
add text amplitude interference top view
add legend1 for displacement interference pattern due to a need to deepen understanding from the scalar representation
add legend2 for intensity screen pattern due to a need to deepen understanding from the scalar representation from the equation I proportional to A^2

 rippletankv4.png (77.75 KB, 666x547 - viewed 714 times.) *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #18 on: May 07, 2012, 04:01:49 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

after discussion with teacher.
changes.

added pen paper representation to support transfer of learning to examinations questions in pen paper format.

 rippletank_002.png (98.84 KB, 666x547 - viewed 662 times.) *** There are 2 more attached files. You need to login to acces it! « Last Edit: May 08, 2012, 04:28:23 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #19 on: May 15, 2012, 12:55:36 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

discussion with teacher

Thanks. but the wave fronts drawn by pen look funny.
made  drawing panel x and y squared==true, should look like the real thing

There seems to be additional unnecessary wave fronts appearing at the same time.
reprogram the pen lines
for( ipen=1;ipen if(vd[ipen]==0 && t>=(ipen-1)*(1/f)){ // clever way to assign wavefront
count = ipen; // added by lookang to count waves emitted
tEmitted[ipen] = t;
//  vd[ipen]=4*v; // assign velocity to wavefront
vd[ipen]=4*f*lambda; // assign velocity to wavefront
xs[ipen]=xsource; // assign position
ys[ipen]=ysource;
}
}
for( ipen2=1;ipen2 if(vd2[ipen2]==0 && t>=(phase/(2*pi)+ipen2-1)*(1/f2)&&t>=0){ // clever way to assign wavefront
count2 = ipen2; // added by lookang to count waves emitted
tEmitted2[ipen2] = t;

vd2[ipen2]=4*f2*lambda2; // assign velocity to wavefront

xs2[ipen2]=xsource2; // assign position
ys2[ipen2]=ysource2;
}
}
if (phase>0&&t==0)vd2[1]=0; // needed to fix bug of wave starting when phase not zero

thanks to Prof Hwang codes here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=873.0
and
Ejs Open Source 1 Dimension Doppler Effect Sound Wave Java Applet
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1997.0

 *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #20 on: June 26, 2012, 09:26:51 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

if ((Math.abs(deltaL%(1)) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||(Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
text = " Constructive Inference ";
texthint1correctbackground = java.awt.Color.YELLOW;
hintshow = true;
}
//P.D. = 0.5lambda, phi =0 || P.D. = 0, phi =pi
//else if (Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||Math.abs(deltaL%(1)) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
else if ((Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||((Math.abs(deltaL%(1)) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1))) {
text = " Destructive Inference ";
hintshow = true;
texthint2correctbackground = java.awt.Color.YELLOW;
}
else {
text = "";
hintshow = false;
texthint1correctbackground = new java.awt.Color(255,255,255,255);;
texthint2correctbackground = new java.awt.Color(255,255,255,255);;
}

if (hint==true&&(Math.abs(phase%(2*pi)) < 0.1)){
texthint = "When the sources are in phase, math_failure (math_unknown_error): \\phi =0";
texthint1 = "condition for constructive interference: |S1P-S2P| = m math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
texthint2 = "condition for destructive interference: |S1P-S2P| = (m + 0.5) math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";

}
else if (hint==true&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
texthint = "When the sources are in anti-phase, math_failure (math_unknown_error): \\phi =180 degree";
texthint1 = "condition for constructive interference: |S1P-S2P| = (m + 0.5) math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
texthint2 = "condition for destructive interference: |S1P-S2P| = m  math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
}
else {
texthint = "move the source phase math_failure (math_unknown_error): \\phi into in phase math_failure (math_unknown_error): \\phi =0 or anti-phase math_failure (math_unknown_error): \\phi =180 degree for hints regarding them";
texthint1 = "";
texthint2 = "";
}
 Ejs_Open_Source_Ripple_Tank_Interference_Model_java_applet_2012-06-26_1028.png (149.43 KB, 789x913 - viewed 1327 times.) *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #21 on: July 02, 2012, 04:49:20 pm » posted from:Singapore,,Singapore

Two-source Ripple Tank interference patterns with River Valley High School
Introduction Video on the features of the computer model as a guide to support learning.
Ejs Open Source Ripple Tank Interference Model java applet
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2067.0
this video made as a research response to improve student's experience and learning by supporting teachers in setting the stage, giving the basic features of the inquiry lesson to come, for student centred inquiry with computer model as a tool.
the teacher will play a even bigger role in facilitating learning because the tool adds interactive engagement and visualization that traditional tools cannot support.

.

enjoy!
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #22 on: July 02, 2012, 10:45:07 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

http://youtu.be/XHiDpP-572Y

trying to figure out if tracker can be used to determine useful curriculum learning. seems to be possible to determine the velocity of wave when a length is assumed.
say if S1S2 is 0.3m
since we know the video i n phase sources, by observing the bright light at S1 and S2 happens together.
the centre line, say length is set at 4.659E-1 m from S1 to P where P is a bright interference.
similarly, S2P is roughly 4.734E-1 m
by stepping the video,for simplicity 4 steps result in t = 0.133 s = T.
thus, f = 1/T = 7.52 Hz
the wavelength is determined as 1.097E-1 m as shown
therefore, using v = f.lambda
v = 7.52(1.097E-1)
v = 0.825 m/s
is this correct?

took 3 videos
real setup video taken by lookang

in phase sources video taken by lookang

in anti-phase sources video taken by lookang

 ripple_tank_real_in_phase_2012-06-04_2007.png (513.04 KB, 975x799 - viewed 811 times.) *** There are 2 more attached files. You need to login to acces it! « Last Edit: July 02, 2012, 11:07:40 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #23 on: July 06, 2012, 09:24:06 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

 *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #24 on: June 07, 2013, 01:18:23 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

enjoy!
 2013-06-07_1351.png (108.71 KB, 1280x1024 - viewed 714 times.) Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #25 on: July 08, 2013, 10:52:41 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

bug fixed! redraw using AnalyticCurve
X= "xsource+(x-xsource)*cs-0.1*A1*Math.cos(omega*t-k*(x-xsource))*sc"
Y ="ysource+(x-xsource)*sc+0.1*A1*Math.cos(omega*t-k*(x-xsource))*cs"
the using new feature with new wave form to allow counting of number of wavelength with RVHS tat leong in ripple tank sim plus some bug fixes. made dt smaller 0.01 for smooth graph
http://weelookang.blogspot.sg/2013/03/ripple-tank-model-wee-duffy.html
Ripple Tank Model (Wee, Duffy, Aguirregabiria, Hwang & Lee, 2012) with simplified physics equations modeled, realistic 2D and 3D (shown) visualizations, hints and scientific measurement tools for inquiry activities and data gathering for inquiry learning
https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejs_Ripple_Tank_Interferencewee10.jar
older version  working https://dl.dropbox.com/u/44365627/lookangEJSworkspace/export/ejs_Ripple_Tank_Interferencewee07try.jar
IJC: https://www.dropbox.com/s/dyvzrhuhzecxx7c/RippleTankIJC2013.docx
RVHS: https://www.dropbox.com/s/pnbi0k6ww1zcmv8/RippleTankRVHS.zip
YJC: https://www.dropbox.com/s/khlnwerjoienknh/RippleTankYJC.zip
 ripple_tank_2013-07-08_1154.png (135.56 KB, 1280x1024 - viewed 673 times.) Logged
lookang
Moderator
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #26 on: February 21, 2019, 09:01:29 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE