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

Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: lookang on October 26, 2010, 05:13:59 pm



Title: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on October 26, 2010, 05:13:59 pm
Ejs Open Source Charge Particle in Electric & Magnetic Field Java Applet in 3D
Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
reference:
this is a remix of Charge Trajectories in 3D Electrostatic Fields Model written by Andrew Duffy http://www.compadre.org/osp/items/detail.cfm?ID=9997
with help from Charged particle motion in static Electric/Magnetic field by Fu-Kwun Hwang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1431.0
zoom in and out graphics are taken from creative commons license http://findicons.com/icon/86740/zoom_in?width=16#

this is remixed to support content learning of small part of electromagnetism similar to Escape from Centauri 7 http://gli.lsl.nie.edu.sg/projects_centauri.html.
But the link Escape from Centauri 7 here is about learning to scientist :) the goal is different.
whereas the applet is more suited for inquiry learning for content knowledge with a shorter time frame, perhaps 1.5 hours during practical periods. Here, becoming a scientist is also "achieved" but not as explicit as Escape from Centauri 7.  

[ejsapplet]

This model is created with the following 6 equations., derivation and checked by lookang
dx/dt = vx
dy/dt = vy
dz/dt = vz
dvx/dt = q*(Ex+(vy*Bz-vz*By))/m
dvy/dt = q*(Ey+(vz*Bx-vx*Bz))/m
dvz/dt = q*(Ez+(vx*By-vy*Bx))/m

Newton's 2nd Law F = ma,
because cross product is v^B in x direction is (vy*Bz-vz*By), refer to cross product literature
q*Ex + (vy*Bz-vz*By)*q = m*dvx/dt

because cross product is v^B in y direction is -(vx*Bz-vz*Bx), refer to cross product literature
q*Ey + (vz*Bx-vx*Bz)*q = m*dvy/dt

because cross product is v^B in z direction is (vx*By-vy*Bx), refer to cross product literature
q*Ez + (vx*By-vy*Bx)*q = m*dvz/dt
  

A Charge in Electric and Magnetic Fields by Andrew Duffy
In this simulation, you can investigate a charged particle, and the forces exerted on that charged particle by electric and/or magnetic fields. First, see how the charge behaves when exposed to just an electric field. Then, see how the charge behaves when exposed to just a magnetic field. Finally, if you'd like, turn both fields on and see what happens.

Activities by Andrew Duffy
Start with no initial velocity, and with just the electric field turned on. What does the charged particle do? If you reverse the sign on the charged particle, what happens?
Now, give the charged particle an initial velocity in the x-direction. Try turning on the electric field in just the x-direction, and then in just the y-direction. What do you observe about the motion of the charged particle in these cases? Write down the expression for the force the electric field exerts on the charged particle. Are your observations consistent with this expression?
Once again, start with no initial velocity, and with just the magnetic field turned on. What does the charged particle do? If you reverse the sign on the charged particle, what happens?
Now, give the charged particle an initial velocity in the x-direction. Try turning on the magnetic field in just the x-direction, and then in just the z-direction. What do you observe about the motion of the charged particle in these cases? Write down the expression for the force the magnetic field exerts on the charged particle. Are your observations consistent with this expression?
Finally, turn on both electric and magnetic fields, and see what kind of motions you can get.


Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on October 26, 2010, 05:15:48 pm
zoom in and out graphics from http://findicons.com/icon/86740/zoom_in?width=16#
Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D

changes made:
1 redesign layout to suit my usual design to ease of learning for students who use my design before
2 color scheme B field orange, E field red etc
3 added B and E field visualization arrow and text on (xf,yf,zy) thanks to http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1431.0
4 changes to axes view because (x,y,z) allows for association of motion
5 added new panel for each variable text field text and slider combined for maximum usability to explore infinite options but with slider ease to closest true
6 added F_E and F_B for association of field direction to force
7 adopted a column vector representation consistently
8 added zoom in and out graphics from zoom in and out graphics are taken from creative commons license http://findicons.com/icon/86740/zoom_in?width=16#
9 added time
10 added tips
11 fix a bug of the initial velocity not read by simulation by initialize() the buttons with
vx = vxinit; // added by lookang
vy = vyinit;
vz = vzinit;
idea from http://surendranath.tripod.com/Applets.html
12 need to add Bz and vx only circle
By and vx only circle
Bx and vx only straight line uniform
vx and By and Bz circle
vx and vy and By helix

13 need to add vx and Ey parabola
vx and Ex straight line accelerate motion
vx and Ez  parabola

14  vx Ey and Bz where q*Ey = vx*Bz*q           straight line velocity selector
vx=vy=vz = 0 Ex and Bz many semi circle
vx and Ex and Bz spring like path


Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on October 27, 2010, 08:04:22 am
For 5058 PHYSICS (WITH SPA) ORDINARY LEVEL 2011
21.     Electromagnetism
Content
•      Magnetic effect of a current
•      Applications of the magnetic effect of a current  
•      Force on a current-carrying conductor
•      The d.c. motor
Learning Outcomes:  
Candidates should be able to:
(c)      describe  experiments  to  show  the  force  on  a  current-carrying  conductor,  and  on  a  beam  of
charged particles, in a magnetic field, including the effect of reversing
(i)         the current
(ii)        the direction of the field

same for 5116 SCIENCE (PHYSICS, CHEMISTRY) & 5117 SCIENCE (PHYSICS, BIOLOGY)

For This specific learning outcome, the following Activity / Exercise is suggested by lookang.


A) when velocity of charged particle is parallel to magnetic field ( Newton's 1st law of motion )
1 the simulation can be used to explore force on beam of charged particles q in a magnetic field B.
2 set the vxo = 0.6 m/s, Bx = 1 T, By = 0 T, Bz = 0 T, click on the run button to start the simulation.
3 record the path (trail left behind the particles motion) of the charged particle q.
4 record the quantities x,y,z for displacement, vx,vy,vz for instantaneous velocity and the magnetic force F_Bx, F_By,F_Bz.
5 you should move the perspective in the world view to get a better view of the motion and try to understand the motion is 3D and then 2D if it is possible to simplify.
5 set the vxo = 0.8 m/s, Bx = 1 T, By = 0 T, Bz = 0 T, click on the run button to start the simulation.
6 repeat steps 3 to 5
7 set the vxo = 1.0 m/s, Bx = 1 T, By = 0 T, Bz = 0 T, click on the run button to start the simulation.
8 repeat steps 3 to 5
9 continue to explore more vxo if necessary, and draw observable patterns or trends in path of the charged particle, record down what did you see.
hint: path is straight line, circular motion, parabolic etc?
10 now, change Bx = -1 T instead and repeat steps 2 to 9 with Bx = -1 T to explore what happens when the direction field is reverse.
11 write down what is the generalized rule when a charged particle traveling in a x direction meets a non-zero Bx field.
12 you should explore the other sliders to verify your step 11 if need.

B) when velocity of charged particle is perpendicular to magnetic field ( circular motion due to force is perpendicular to velocity )
1 the simulation can be used to explore force on beam of charged particles q in a magnetic field B.
2 set the vxo = 0.6 m/s, Bx = 0T, By = 2 T, Bz = 0 T, click on the run button to start the simulation.
3 record the path (trail left behind the particles motion) of the charged particle q.
4 record the quantities x,y,z for displacement, vx,vy,vz for instantaneous velocity and the magnetic force F_Bx, F_By,F_Bz.
5 you should move the perspective in the world view to get a better view of the motion and try to understand the motion is 3D and then 2D if it is possible to simplify.
5 set the vxo = 0.8 m/s, Bx = 0 T, By = 2 T, Bz = 0 T, click on the run button to start the simulation.
6 repeat steps 3 to 5
7 set the vxo = 1.0 m/s, Bx = 0 T, By = 2 T, Bz = 0 T, click on the run button to start the simulation.
8 repeat steps 3 to 5
9 continue to explore more vxo if necessary, and draw observable patterns or trends in path of the charged particle, record down what did you see.
hint: path is straight line, circular motion, parabolic etc?
10 now, change By = -2 T instead and repeat steps 2 to 9 with By = -2 T to explore what happens when the direction field is reverse.
11 write down what is the generalized rule when a charged particle traveling in a x direction meets a non-zero By field.
12 you should explore the other sliders to verify your step 11 if need.

C) when velocity of charged particle is perpendicular to magnetic field ( circular motion due to force is perpendicular to velocity )
1 the simulation can be used to explore force on beam of charged particles q in a magnetic field B.
2 set the vxo = 0.6 m/s, Bx = 0T, By = 0 T, Bz = 2 T, click on the run button to start the simulation.
3 record the path (trail left behind the particles motion) of the charged particle q.
4 record the quantities x,y,z for displacement, vx,vy,vz for instantaneous velocity and the magnetic force F_Bx, F_By,F_Bz.
5 you should move the perspective in the world view to get a better view of the motion and try to understand the motion is 3D and then 2D if it is possible to simplify.
5 set the vxo = 0.8 m/s, Bx = 0 T, By = 0 T, Bz = 2 T, click on the run button to start the simulation.
6 repeat steps 3 to 5
7 set the vxo = 1.0 m/s, Bx = 0 T, By = 0 T, Bz = 2 T, click on the run button to start the simulation.
8 repeat steps 3 to 5
9 continue to explore more vxo if necessary, and draw observable patterns or trends in path of the charged particle, record down what did you see.
hint: path is straight line, circular motion, parabolic etc?
10 now, change Bz = -2 T instead and repeat steps 2 to 9 with Bz = -2 T to explore what happens when the direction field is reverse.
11 write down what is the generalized rule when a charged particle traveling in a x direction meets a non-zero Bz field.
12 you should explore the other sliders to verify your step 11 if need.

Rise Above Question:
in B and C, how is the path of the charged particle different?
what can be concluded about the effect of reversing the effect of Bx.
what can be concluded about the effect of reversing the effect of By.
what can be concluded about the effect of reversing the effect of Bz.

Challenging question:
in A, B, and C the charged particle is assumed to be +1 C, what is the effect of changing q = - 1 C ?
hint: F = v^B.q where ^ is cross product.
in A, B, and C the charged particle is assumed to be +1 kg, what is the effect of changing m = + 2 kg ?
hint: Newton's 2nd Law: Fnet = m.a
set the vxo = 0 m/s, observe the resultant nmotion of q. Why did the q not move?
suggest a method to set q into motion despite when t =0 s, vxo = 0 m/s.
hint: need to explore another kind of field, called electric field!
Enjoy!


Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on October 27, 2010, 10:18:22 am
9646 H2 PHYSICS (2011) Physics Higher 1 2011 8866 only (e)
15.        Electromagnetism
Content
•           Force on a current-carrying conductor
•           Force on a moving charge
•           Magnetic fields due to currents
•           Force between current-carrying conductors
Learning Outcomes
Candidates should be able to:
(e)        predict the direction of the force on a charge moving in a magnetic field.
(f)         recall and solve problems using F = v.B.q.sinθ.
(g)        describe  and  analyze  deflections  of  beams  of  charged  particles  by  uniform  electric  and uniform magnetic fields.
(h)        explain  how  electric  and  magnetic  fields  can  be  used  in  velocity  selection  for  charged particles.

assume vyo = 0 m/s, vzo = 0 m/s
E
explore when vxo = 0 m/s
1 the simulation can be used to explore F_B force on beam of charged particles q in a magnetic field B.
2 set the vxo = 0 m/s, Bx = 1 T, By = 0 T, Bz = 0 T, click on the run button to start the simulation.
3 record the path (trail left behind the particles motion) of the charged particle q.
hint: it is stationary? record it
4 try other values of Bx, then follow by By, then follow by Bz.
hint: it is stationary? record it
what can be concluded about the relationship of v to F_B ?


E1 explore when vxo = 1 m/s
1 set the vxo = 1 m/s, Bx = 1 T, By = 0 T, Bz = 0 T , (optional) click on the run button to start the simulation.
2 record the direction of F_B (view the applet, as well as the column F_Bx, F_By and F_Bz to make sense)
3 try other values of Bx, then follow by By, then follow by Bz.
4 record your data systematically in a table

E2 explore when vxo = -1 m/s
1 set the vxo = -1 m/s, Bx = 1 T, By = 0 T, Bz = 0 T , (optional) click on the run button to start the simulation.
2 record the direction of F_B (view the applet, as well as the column F_Bx, F_By and F_Bz to make sense)
3 try other values of Bx, then follow by By, then follow by Bz.
4 record your data systematically in a table

E3 to scaffold the learning, verify this hypothesis that claims
F_B = v^B*q for advanced learners
or
using left hand rule, F_B (thumb) B (index finger) and i (middle finger) in 90 degree angle to each other, can be used to predict the direction of the F_B. for normal learners.
hint: direction of +i is the same as +q, because i = d(N.q)/dt
discuss with your classmates to verify this relationship.

E4 Extend this hypothesis to vxo = 0 m/s, vyo = 1 m/s, vzo = 0 m/s
vary the values of Bx = 1 T, By = 0 T, Bz = 0 T
                         Bx = 0 T, By = 1 T, Bz = 0 T
                         Bx = 0 T, By = 0 T, Bz = 1 T
can F_B = v^B*q or left hand rule, F_B (thumb) B (index finger) and i (middle finger) still predict the direction of the force?
record down the data your observed

E5 Extend this hypothesis to vxo = 0 m/s, vyo = 0 m/s, vzo = 1 m/s
vary the values of Bx = 1 T, By = 0 T, Bz = 0 T
                         Bx = 0 T, By = 1 T, Bz = 0 T
                         Bx = 0 T, By = 0 T, Bz = 1 T
can F_B = v^B*q or left hand rule, F_B (thumb) B (index finger) and i (middle finger) still predict the direction of the force?
record down the data your observed

E6 q is negative
with reference to activity E1, explore when vxo = 1 m/s
1 set the vxo = 1 m/s, Bx = 1 T, By = 0 T, Bz = 0 T , (optional) click on the run button to start the simulation.
1.5 change q to -1 C
2 record the direction of F_B (view the applet, as well as the column F_Bx, F_By and F_Bz to make sense)
3 try other values of Bx, then follow by By, then follow by Bz.
4 record your data systematically in a table
what can be concluded about the effect of q on the direction of F_B ?
how does the left hand rule stand up to this new data?
discuss how to rationalize this especially with respect to i = d(N.q)/dt
discuss with your classmates to make sense of this new data on the relationship: left hand rule, F_B (thumb) B (index finger) and i (middle finger).




Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on November 08, 2010, 03:00:30 pm
interesting.
i have not encounter this before until today.
http://demonstrations.wolfram.com/ChargedParticleInUniformElectricAndMagneticFields/ (http://demonstrations.wolfram.com/ChargedParticleInUniformElectricAndMagneticFields/HTMLImages/index.en/popup_6.jpg)
think the commercial software also has the same idea of open source.
the simulations are not bad, the codes seems to be mathematical based as well.

downloading the player now to check it out.

guess the main difference is teacher can make free sims on easy java simulation to benefit humankind, improve learning in classroom, improve own pedagogical understanding, professional develop and learn.


Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on January 06, 2011, 01:28:53 pm
i received an email about the equations for this simulation.

hi lookang,
this is joshi from India.
A very happy and full of physics new year. Hope you are doing well in life.
I am in a calculation phase of a simulation - 'motion of charge in magnetic field'. so you know that in a complex situation, such as injecting a particle into magnetic field at some angle theta, will make the particle to follow helical trajectory.
since u know that it is better to give liberty to user to orient magnetic field along any direction (i.e. not restricting it along x,y,z - axes). The same is true for velocity also.
Now all references i have referred derive equation of helix considering z-axis as its center axis for sake of simplicity and not any arbitrary axis.
So can u derive/give me a general equation of a helix (with center axis being any 3D line)?
take it as a first challenge (from my side) for our brainstorming friendship.............
chintan joshi

my reply is
The equations are as above in the first post
This model is created with the following 6 equations., derivation and checked by lookang
dx/dt = vx
dy/dt = vy
dz/dt = vz
dvx/dt = q*(Ex+(vy*Bz-vz*By))/m
dvy/dt = q*(Ey+(vz*Bx-vx*Bz))/m
dvz/dt = q*(Ez+(vx*By-vy*Bx))/m


Title: Re: Ejs Open Source Motion of Charge Particle in Electric & Magnetic Field in 3D
Post by: lookang on January 07, 2011, 01:24:31 pm
i received an email about the equations for this simulation.

thanks for reply but still i am not answered.

can u tell me the equation of a helix with pitch b, radius a and its axis along the vector (p,q,r)?

- joshi


my answer is
to get a helix
set vx and By to perform circular motion
add vy for the uniform motion

i did not work out the equation for infinite cases like what you are asking for.
i just tell the simulation what to do and step increase in dt.

maybe i don't know the answer to your question.


Title: Solution for Charge Particle in Electric & Magnetic Field in 3D
Post by: Fu-Kwun Hwang on January 07, 2011, 03:58:20 pm
I think what joshi want is a solution to the above equations.
May be joshi was not using EJS or joshi did not know how to solve it.
 
It will be difficult to find a solution without know the form for the electric field E and magnetic field B.

It is relatively easy for inject a particle into a uniform magnetic field region.

You will find partial circular motion.
Assume the velocity $\vec{v}$ has component parallel to magnetic field $\vec{v_p}$  and perpendicular to component $\vec{v_n}$
i.e. $\vec{v}=\vec{v_p}+\vec{v_n}$
There is no force along the magnetic field, so it will move with constant speed along the direction of magnetic field with speed $v_p$
The velocity component perpendicular to magnetic field will cause particle to move in a circular orbit, which satusfy the following condition
 $m \frac{v_n^2}{r}= q v_n B$. i.e. $r= \frac{m v_n}{qB}$.

If the charged particle is in a uniform magnetic initially, then it will move with helix orbit.
However, if a charged is moving from a region where there is no magnetic field, and enter a region with uniform magnetic field.
The charged particle will exit the magnetic field within one resolution of circular motion.
Please check out Electron in magnetic field  (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=179.0)