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

Information about this web site => Request for physics Simulations => Topic started by: jirischamberger on December 23, 2010, 02:36:57 am



Title: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on December 23, 2010, 02:36:57 am
Hallo, i am trying to make the simulation based on the Feynman QED (as you can see on the pictures below) in EJS, but to say the true, i dont even know how to start. My goal is : Two mirrrors, which can be changer (straight and concave), the user will click on any place in the mirrors and in the second window he will see the summation of probability amplitudes. Can anybody help me, please ?


Title: Re: Help with simulation "Feynman QED" in EJS
Post by: Fu-Kwun Hwang on January 15, 2011, 10:21:43 pm
Does the following simulation is what you need?

You can drag S,P to different location.
The red segments show the path which is shertest distance (or smallest time value).


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on January 23, 2011, 03:14:09 pm
Yes, that is exatly what I needed. Thank you very much  :) :)


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: ahmedelshfie on January 24, 2011, 08:43:52 am
In my opinion is excellent applet, thanks prof Hwang for the wonderful work  :)


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on February 27, 2011, 07:44:53 pm
I have tried this simulation in a different way : You can drag each point or you can generate (random or Gaussian) the points positions. But I have one problem : Somewhere I do a mistake and I cannot properly display the graphical summation of vectors. Can you help me, please ? Thank you. 


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: Fu-Kwun Hwang on February 27, 2011, 08:47:48 pm
I do not understand what is the problem ?
Could you create snapshot of the image for your simulation (right click mouse and select snapshot) when the problem occurs?
Explain what you want and what you have in the current program.
There is no way to help if I do not understand what is the problem.


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on February 28, 2011, 12:21:28 am
Hi, my problem is that i cannot display properly summation of vectors (and resultant vector). It should be looked like Cornu spiral, i think, but I cannot link vectors to each other (vetor A to B, then to C etc. and finally resultant vector), and I cannot find mistake. Thank you.


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: Fu-Kwun Hwang on February 28, 2011, 08:23:13 am
Quote
d1 = Math.sqrt((x1-x2)*(x1-x2)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x2)*(x4-x2)+(y2-y1)*(y2-y1));
d2 = Math.sqrt((x1-x29)*(x1-x29)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x29)*(x4-x29)+(y2-y1)*(y2-y1));
d3 = Math.sqrt((x1-x26)*(x1-x26)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x26)*(x4-x26)+(y2-y1)*(y2-y1));
d4 = Math.sqrt((x1-x24)*(x1-x24)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x24)*(x4-x24)+(y2-y1)*(y2-y1));
d5 = Math.sqrt((x1-x22)*(x1-x22)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x22)*(x4-x22)+(y2-y1)*(y2-y1));
d6 = Math.sqrt((x1-x23)*(x1-x23)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x23)*(x4-x23)+(y2-y1)*(y2-y1));
d7 = Math.sqrt((x1-x25)*(x1-x25)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x25)*(x4-x25)+(y2-y1)*(y2-y1));
d8 = Math.sqrt((x1-x28)*(x1-x28)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x28)*(x4-x28)+(y2-y1)*(y2-y1));
d9 = Math.sqrt((x1-x32)*(x1-x32)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x32)*(x4-x32)+(y2-y1)*(y2-y1));
d10 = Math.sqrt((x1-x27)*(x1-x27)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x27)*(x4-x27)+(y2-y1)*(y2-y1));
d11 = Math.sqrt((x1-x30)*(x1-x30)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x30)*(x4-x30)+(y2-y1)*(y2-y1));
d12 = Math.sqrt((x1-x31)*(x1-x31)+(y2-y1)*(y2-y1))+ Math.sqrt((x4-x31)*(x4-x31)+(y2-y1)*(y2-y1));
The above is a copy from part of your code. It is very difficult to read or debug your code.
This is not the way to write a program.
You should have defined an array (e.g. d[12]) and do it with a for loop.
Do the same for x,y,phase, ...

You might want to check out my ejs source from the above example  to find out how to do it with a loop.


Title: Want to have a suit fashion beautiful dress? Then, please click <a href=http:/
Post by: linjin on March 03, 2011, 01:59:52 pm
go off work, walk on white streets, windy, but feet from warm feeling, but didn't feel a

bit cold, I really like this pair of ugg boots, good warmth, if you want to buy, to "site"

purchase, price cheap... Wear comfortable...


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on April 24, 2011, 02:55:34 pm
I finally did it. You can change number of path (maximum 100), you can drag Source and Detector, you can drag the points on the mirror. Red ray is the minimum time, green rays are the closest to minimum, you can change lambda. What do you think ?


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on April 24, 2011, 03:00:04 pm
Sorry, i have a problem with attaching files, trying it again...


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: Fu-Kwun Hwang on April 24, 2011, 10:16:13 pm
You will find Upload new EJS jar file check box at the same line of "Post" button (submit button) when you edit the forum message.

Click that checkbox,  select the jar file before you submit the message.
Then, the EJS simulation in the jar file will appear as applet (part of forum message).
Please try it.


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on April 24, 2011, 10:22:37 pm
I am trying it...hope it works.


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: Fu-Kwun Hwang on April 24, 2011, 11:49:17 pm
Let me tried it for you!


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: jirischamberger on April 25, 2011, 12:11:14 am
Thank you. I forgot one notice - distance is in micrometres. Regards


Title: Re: Help with simulation "Feynman QED" in EJS/board:26-101-
Post by: transportation on April 26, 2011, 01:48:37 am
I have tried this simulation in a different way : You can drag each point or you can generate (random or Gaussian) the points positions.
I am impressed by the quality of information on this website. There are a lot of good resources here.
I am sure I will visit this place again soon.