NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 21, 2019, 06:04:26 pm

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

 Pages: [1] 2   Go Down
 Author Topic: charged particles and non uniform magnetic field/board:26-1-  (Read 69450 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message on: June 25, 2013, 11:47:00 pm » posted from:MILANO,LOMBARDIA,ITALY

hello I would like to propose a simulation, which I need so much
2D in a magnetic field that increases with the x axis, then has a maximum, and then returns to zero value as a function gaussina. see photo. the particle part in any point of this plane and with the direction to be set. also the speed and mass are to be set and charge.

on the 2D plane in the point x, y have the cmapo varies with xe, remains constant along y. you can set a starting point as the point (xo, yo) where B (tesla) is almost zero and choose the direction of the particle.

You can do the following:
1) Divide the plan, of length x and height y, in vertical strips of known width.
2) manually assign a value of the magnetic field in each strip
3)the field is constant in each vertical strip
4) manually select a point in the plane
5) manually choose a direction in the plane
6) assign charge, mass, velocity, to the particle
7) go the simulation!

then in fig1 explain what must do the program in steps. first step to divide the plane into strips of very great height and thickness of three or more mm and assign the field to each one. the field is constant in each strip but it is different from the strip and the strip. or it can be the same depending on the assignment. second step assign a point and a direction to the particle. third step, run the simulation.

in fig2 explain the graphical method for ottenre the result, in any direction goes away, the particle, the radius of curvature is always perpendicular to the direction of the particle. in the band starting the radius of curvature is constant. the particle is a portion of circumference. Now I draw the tangent line to the curve O | and the radius is perpendicalore to this line so the design and so on.

set the time in ns the lenght in mm velocity m/s field in tesla charge in coulomb mass in kg

the application is scientific to know if the particle at a given velocity and mass passes through the field or bounces back.

thanks
 Immagine.jpg (88.38 KB, 519x763 - viewed 958 times.) Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #1 on: June 26, 2013, 10:39:59 pm » posted from:,,Satellite Provider

The following is a simulation for charged particle in $B_z =B e^{-\frac{x^2}{2*\sigma^2}}$
You can drag the changed particle and change it's velocity (drag red arrow).

Let me know what you need!

Click the eye (image) to display the simulation

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!
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #2 on: June 27, 2013, 02:07:41 am » posted from:MILANO,LOMBARDIA,ITALY

thanks for having responded unfortunately I can not see the simulation there is a problem with your post.

did you see the email I sent you ? in the email there are the drawings fig1 e fig2

thanks so much.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #3 on: June 27, 2013, 07:11:52 pm » posted from:,,Satellite Provider

 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #4 on: June 27, 2013, 08:53:15 pm » posted from:MILANO,LOMBARDIA,ITALY

thanks so much!!! is a simulation of based, but it is what I wanted . Now can we please make additions to the program? thanks again for the simulation.

the user must be able to set
- Mass in kg (typically 5 * 10 ^-26Kg)
- Set the charge of the particle (typically 1.6 * 10 ^ -19 C)
- Set the type of charge of the particle + or -.
- You must have a counter for the time in nanoseconds (ns)
- change speed of simulation (example 1s=8ns or 1s= 20ns or etc...)
- set Speed ​​in m / s (typically between 1'000 and 10'000 m / s)
- Set the Gaussian function manually by entering the value of A and B, which is A = 2 * sigma ^ 2
- Enter the rulers on board page in mm
- You can manually choose the size (x and y) of the working window in mm
- The particle would bounce off the walls, up and down of the page, but go trought left end right. (as a particle in a tube infinite.)

If you set this becomes a simulation fantastic for particles charged.

thanks for the simulation again.
 « Last Edit: June 27, 2013, 09:34:07 pm by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #5 on: June 27, 2013, 11:19:35 pm » posted from:,,Satellite Provider

For a simulation, the scale/unit of physics properties is not fixed.
e.g. the screen width can represent 1cm or 1km. It is depends on how you choose the unit.

Could you provide a simple drawing about the ruler? and what is the role for the ruler?

Click the eye (image) to display the simulation

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!
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #6 on: June 28, 2013, 12:11:08 am » posted from:MILANO,LOMBARDIA,ITALY

So thank you you for your attention to me.

then the ruler would need to figure out what size of screen you are viewing in mm (millimetres).

the ruler is in the fig.

It must be similar or as you want( in mm) !!!

regarding sigma could come down to smaller values ​​0.07, to 0.01?

for charge + e - and setting the charge is ok!

lacks the ability to set, the value of the magnetic field B we say tesla
example 0.45 T

I do not understand the speed and the mass, in which units of measurement have been set.
or that represent the values. maybe  m=1 rapresent 5*10^-26Kg and v=1 apresent 1000 m/s?

regarding the particle, I would like once out of the design did not fit more on the screen

you might choose as the unit of measure mm? I saw that in previous simulations could choose the unit in micrometers.

ever you feel like it could also kindly put the counter of nanoseconds

you can not choose the size of the work area, which is where the particle undergoes the strength of the magnetic field, always in mm?

thanks so much professor

 unitatedemasura.jpg (55.63 KB, 548x380 - viewed 806 times.) « Last Edit: June 28, 2013, 12:35:03 am by danielemateriale » Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #7 on: June 28, 2013, 01:23:00 am » posted from:MILANO,LOMBARDIA,ITALY

then the program should look more or less like to be functional. I enclose a photo of the finished program.

we have a work area, a ruler, comment on the unit of measure, a long, fast, 1s = 100ns, slow, 1s = 30ns, or very fast, 1s = 500ns.

you can set the work area in millimeters, both x and y.

you can set the field B in tesla.

in the image there is a error!!! the velocity must be V=v*10'000 m/s and not V=v*1000 m/s because the v range between 0 and 1.

 Formato programma.jpg (106.31 KB, 512x537 - viewed 785 times.) « Last Edit: June 28, 2013, 03:05:26 am by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #8 on: June 28, 2013, 07:46:27 am » posted from:,,Satellite Provider

I modified it with some of your suggestions.

I did not add slider for x,y because you can drag particle to any position with your mouse.
Or do you want numerical value for x and y?

The unit for B is T, for time is us, for m is $10^{-26}$kg, for q is $10^{-19}$C, for v is km/s,
it is cm for the coordinate unit.

You can read the coordinate when you press mouse inside the screen.
I can add ruler if you still need it.

Click the eye (image) to display the simulation

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!

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #9 on: June 28, 2013, 08:01:09 am » posted from:,,Satellite Provider

The above simulation was uploaded again. It should work fine now.
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #10 on: June 28, 2013, 03:46:55 pm » posted from:Bergamo,Lombardia,Italy

thank you so much for taking the time to improve the simulation.

there are things that do not go unfortunately!

- The mass is wrong,must be 10 ^-26Kg, and no, 10 ^ 26kg, must be a mass comparable to that of molecular oxygen, or molecular nitrogen.
- The cursor volocità must reach 20 km / s, starting from zero, as it is now.
- The particle bounces off walls, above and below, and it is ok, but returns in the video, if it comes out right and left, this effect is not good, please eliminate it, is not realistic.
- Can You, please, put the default positively charged particle?

are better numerical values ​​of x and y, you can choose the work area as shown in figure I sent you. to remember is that the particle must bounce up and down and left and raises must go away from the work area and not return inside the area. as in figure.

can you, please, add the direction of B whit a tridimensional axis? thanks

however there is something wrong with simulation with these values. if r = mv / qB, setting values, sigma = 2.5, m = 10 ^ 26Kg, v = 0.20km / s, B = 5T, q =1.6*10^-19 and, by placing the particle in the middle of the screen, is obtained a radius of curvature of 2.5 * 10 ^ 46 m instead on the screen is seen that the radius of curvature is about 2 cm!

Thank you very much professor of patience

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #11 on: June 28, 2013, 04:45:46 pm » posted from:Taipei,T'ai-pei,Taiwan

Sorry! The unit for the mass is $10^{-26}$kg.
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #12 on: June 28, 2013, 04:59:56 pm » posted from:Bergamo,Lombardia,Italy

there is nothing to forgive, you are doing so much for me.

I'm a materials scientist and expert autodesk inventor (3D modeling software), an expert in simulations with magnetic fields in 2D with PERMAG, and expert at using of software for the structural dimensioning, so if you need anything in particular has the my email and free as you are doing.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #13 on: June 28, 2013, 05:53:50 pm » posted from:,,Satellite Provider

I modify the code so that the velocity can be adjust to 20km/s, however, you better to change the time step to smaller value.

The unit for change has been change to e (1.6*10^{-19})\$

The program will change the scale if the particle come out right/left.
The bounce off the wall (above/below) kept the same.

Click the eye (image) to display the simulation

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!
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #14 on: June 28, 2013, 08:28:13 pm » posted from:Bergamo,Lombardia,Italy

thanks

I discovered that the unit of measure of the point xy is the decimeter.

i have found that deltax=1 corrispond 1=100micrometres

you could do so to be able to save changes to the default settings? eg if I set sigma = 2.4 then I should be able to save the change that I would see when I press the reset.

enter the rulers in centimeters or decimetres for both x and y thanks

I'd like to have the possibility to set the height of the work area, not just the scale with a slider that starts from 1 centimeter up to 20 centimeters

 « Last Edit: June 28, 2013, 09:59:34 pm by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #15 on: June 28, 2013, 08:53:30 pm » posted from:,,Satellite Provider

Save the state of a simulation is a build in function for simulation created with EJS.

You can download the jar file and double click it to run it.

Right click in the simulation region, and you will find menu to save the state of your simulations (you can save as many as you like).
You can load the state , and the simulation will be back to when it was saved.

Quote
I'd like to have the possibility to set the height of the work area, not just the scale with a slider that starts from 1 centimeter up to 20 centimeters

Would you like the range for width/height to be entered with numerical value instead of changed with slider?
What about the range for the wall ?(for particle to bounce up and down).

 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #16 on: June 28, 2013, 09:08:33 pm » posted from:Bergamo,Lombardia,Italy

then for height work area is the image

there was something wrong with the unit size and I found that the program a unit corresponds to 1 = 100 micrometers!!

I have to use a workspace much larger unfortunately.

you could make a work area, height, between 1 and 30 cm?

i need a work area of (1500) unit up (positive y) and -1500 unit (negative y)

the value of sigma must be bigger in the slider from 0.01 to ??. i must have zero from y=-5cm (500 unit left) to y=5cm (500 unit right)

if i cant see the form of gaussian funtcion is not important is important the work area:)

the value x=1=100um is must be write for the user

the programm work correctly but the work area is too small.
 Senza titolo-1.jpg (106.81 KB, 542x556 - viewed 812 times.) « Last Edit: June 28, 2013, 10:36:56 pm by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #17 on: June 28, 2013, 11:36:06 pm » posted from:,,Satellite Provider

Another slider was added to change the y-scale. Slider for x-scale was moved to the top.
You can enter value for x,y coordinate.

Click the eye (image) to display the simulation

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!
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #18 on: June 28, 2013, 11:44:33 pm » posted from:Bergamo,Lombardia,Italy

thanks
 « Last Edit: June 29, 2013, 12:18:20 am by danielemateriale » Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #19 on: June 28, 2013, 11:50:50 pm » posted from:Bergamo,Lombardia,Italy

guardare il prossimo messaggio per favore

 « Last Edit: June 29, 2013, 12:28:16 am by danielemateriale » Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #20 on: June 29, 2013, 12:00:29 am » posted from:Bergamo,Lombardia,Italy

thanks for the time spend to me.

sorry but i cant see the time at large value of x e y. can you put the time in the middle of screen?

slider y must reach 1500 (positive value), because x or y = 1 = 100um yet
so I have to be able to read on the screen y = 1500 y = -1500

the value of sigma must reach 300 from 0.01

then the view of the Gaussian function could be enlarged with the increase of the work area?

thanks
 « Last Edit: June 29, 2013, 01:16:12 am by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #21 on: June 29, 2013, 06:47:14 am » posted from:,,Satellite Provider

1. The message for time has been moved to the center.
2. You can enter scale by enter numerical value, so you can change the range for x and y to any value you want. (how ever you need to adjust other parameters so that the scale make sense).
3. The max value can be change to 300 only when scale is set to larger than 20.
(from 0.01 to 300 is a very large ratio, it does not make sense for large sigma with small range).
4. The yscale for Gaussian function change according to bounce wall in the y-direction.

Click the eye (image) to display the simulation

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!

-*-

The unit for the x,y coordinate is 10^{-4}m.

For the default setting: m=$10^{-26}$kg, q=$1.6*10^{-19}$C, v=0.2 km/s, B=1 T
$r\approx \frac{m v}{qB}=\frac{10^{-26} 0.2*10^3}{1.6*10^{-19}*1}=\frac{0.2}{1.6}10^{-4}=0.12*10^{-4}$ (m)
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #22 on: June 29, 2013, 03:46:58 pm » posted from:MILANO,LOMBARDIA,ITALY

sorry professor but the r=1.25*10^-5 m is =0.125*10^-4 with default

so we have 0.0125 mm=12.5um

-26+19+3=-4 so we have  0.2/1.6*10^-4

on the screen i have a r (with default) of 0.125 unit arbitrary

if we have 1 arbitrary unit= 100um(micrometres) we have:

so we have 1/0.125=100um/x  implies x=12.5um

thanks
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #23 on: June 29, 2013, 03:59:48 pm » posted from:,,Satellite Provider

You are right. I made a mistake.
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #24 on: June 29, 2013, 04:05:02 pm » posted from:MILANO,LOMBARDIA,ITALY

thanks for the time

but i can't on the last version of the programm

I can not get up the wall to the values ​​of y = 1500

i put the value on the ywall=1500 but

the wall does not move up

 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #25 on: June 29, 2013, 04:17:55 pm » posted from:MILANO,LOMBARDIA,ITALY

I believe that the slides prevent the wall to get up. I would say to eliminate them and keep only the numerical values ​​of x and y. in my opinion

thanks
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #26 on: June 29, 2013, 05:45:57 pm » posted from:MILANO,LOMBARDIA,ITALY

Yes, I'm almost certain that the problem is on the slides of x and y that prevent the wall to get up.

thanks
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #27 on: June 29, 2013, 07:42:47 pm » posted from:,,Satellite Provider

I made a mistake in the code. It should work fine now. (It is updated)
 Logged
danielemateriale
Jr. Member

Offline

Posts: 48

 « Embed this message Reply #28 on: June 29, 2013, 08:12:33 pm » posted from:MILANO,LOMBARDIA,ITALY

then first of all thanks for simulation

simulation now works correctly but there would be so many parameters you can tweak.

1. time step is expected to reach 0.500 us, from 0.01us, because the simulation is too slow at high value of scale eg 600
2. the length of the black mark that represents the trajectory should be more long, it tends to disappear with the advance of the particle. at 600 scale
3. the scale of 600, sigma must reach a maximum of 3000 and not 9000, as it is now, because the fixing of parameters is too difficult
4. the dimension of velocity vector shoud be became largest if the scale increase. but not big only a bit

thanks
 « Last Edit: June 29, 2013, 08:19:48 pm by danielemateriale » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3083

 « Embed this message Reply #29 on: June 29, 2013, 08:53:29 pm » posted from:,,Satellite Provider

Normally, I did not design simulation with scale changed with so much.
Because a lot of parameters need to be adjusted at the same time. And it is very difficult for new user (novice).

The code has been modified according to your new request.

Click the eye (image) to display the simulation

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