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

Acting locally and thinking globally. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: Magnetic field generated bar magnet  (Read 17939 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message on: August 13, 2008, 08:43:04 am »

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list

You can drag the magnetic neddle to generate another sets of magnetic field line when the simulation is in pause state (when it finish generate the field line or click pause button).

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
 Logged
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: August 13, 2008, 06:07:21 pm »

my journey:

1. added mbar.gif graphics into folder _data/mbar.gif
so now i can compile it n it works nicely.

question:

can explain is this the Biotâ€“Savart law you used to model the magnetic feild lines?

compare it with the code
Code:
double r2,r3,f;
// caluclate magnetic field at point xp,yp use Biot-Savart Law Fproportional to dlXr/r^3
public double calFx (double xp,double yp) {
f=0;
for(int i=0;i  for(int j=0;j  r2=(xp-xc[j])*(xp-xc[j])+(yp-yc[i])*(yp-yc[i])+zc[i]*zc[i];
r3=r2*Math.sqrt(r2);
f-=(yc[i]*(yp-yc[i])-zc[i]*zc[i])/r3;
}
}
return f;
}
public double calFy (double xp,double yp) {
f=0;
for(int i=0;i  for(int j=0;j  r2=(xp-xc[j])*(xp-xc[j])+(yp-yc[i])*(yp-yc[i])+zc[i]*zc[i];
r3=r2*Math.sqrt(r2);
f+=yc[i]*(xp-xc[j])/r3;
}
}
return f;
}

it looks different, sorry it is difficult to follow, as Biot-Savart Law i don't have a deep understanding

i am usuallly on MSN microsoft messager : lookang , can add me as frd then maybe we can arrange to discuss the applet?
 « Last Edit: August 13, 2008, 06:11:25 pm by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #2 on: August 14, 2008, 11:53:27 pm »

Original form for Biot-Savart Law is
$d\vec{B}=\frac{\mu_0}{4\pi} \frac{I\,d\vec{l}\times\hat{r}} {r^2}$

For the calculation in the code. I use another variable(cst) to represent $\frac{\mu_o\, I}{4\pi}$
And transform $\frac{I\,d\vec{l}\times\hat{r}}{r^2}$ into $\frac{I\,d\vec{l}\times\vec{r}}{r^3}$
Where $\hat{r}= \frac{\vec{r}}{r}$.

$\vec{l}$ is in y-z plane. corresponds to (yc,zc) in the code.
and $\vec{r}$ corresponds to (xp-xc,yp-yc,zc)
Then calculate the cross product for the above two vector.

The integration is done by sum of components from all the coil segments.
 Logged
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #3 on: September 24, 2009, 02:23:56 am » posted from:Fiesso D\'artico,Veneto,Italy

good sharing by W. K. Adams, Co-Director PhET Interactive Simulations University of Colorado, Boulder, USA
http://www.fisica.uniud.it/URDF/mptl14/dtlprogramme.htm

most popular hit
http://www.walter-fendt.de/ph14e/mfbar.htm

Gold mine find written by Wolfgang Christian, Francisco Esquembre, and Anne Cox
 barmagnet.PNG (92.44 KB, 1021x603 - viewed 647 times.) « Last Edit: September 24, 2009, 02:31:57 am by lookang » Logged
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message Reply #4 on: September 28, 2009, 09:00:19 am » posted from:Singapore,,Singapore

there is a remix version here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1210msg4759;topicseen#msg4759
enjoy
 Logged
 Pages: [1]   Go Up
Acting locally and thinking globally. ...Wisdom