phetsims / faradays-electromagnetic-lab

"Faraday's Electromagnetic Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 0 forks source link

Behavior of field inside the bar magnet #165

Closed pixelzoom closed 4 months ago

pixelzoom commented 4 months ago

Noticed while investigating quirks in #156 ...

I'm confused by the behavior of the B-field inside the bar magnet. My understanding is that a bar magnet is strongest at its poles, and weaker towards the center. Our sim (Java and HTML5) has the opposite behavior, which you can confirm using the Field Meter.

I investigated to see whether there's a programming bug. But the "internal B-field grid" that was generated using MathCAD clearly shows that the magnet is stronger towards the center, and gets weaker towards the poles. Is it possible that there was an error is how the MathCAD data was generated, and we never noticed?

BarMagnetFieldData.ts contains the MathCAD data. BX_INTERNAL and BY_INTERNAL are the xy components for the field inside the magnet, for one quadrant relative to the magnet's origin, with values in row-major order.

@arouinfar @kathy-phet @ariel-phet thoughts, confirmation, corrections,...?

pixelzoom commented 4 months ago

bFieldOfHorizCylinderNumerical.pdf is the PDF version of the MathCAD model, provided by Mike Dubson during development of the Java version. It says:

Check: B at middle of right edge of magnet should be about 1/2 of B-field at center.

If I understand that correctly, then (for example) if the middle of the right edge is 200G, then the center should be ~100G. That is the opposite of how the sim is behaving. We should confirm with Mike Dubson, but I believe the values for the internal B-field are reversed.

pixelzoom commented 4 months ago

Check: B at middle of right edge of magnet should be about 1/2 of B-field at center.

If I understand that correctly ...

I clearly did not understand, and had it reversed. The statement matches the sim behavior. For example, if the center is 200G, then the middle of the right edge should be ~100G.

That may (?) be correct for a horizontal cylinder, which is what was modeled using MathCAD. But I'm still wondering if that's correct for a bar magnet.

arouinfar commented 4 months ago

I believe the sim is behaving correctly. If you look at the field lines inside of a bar magnet, they are the most dense at the center, meaning the field is strongest there.

image

That said, I would appreciate if @ariel-phet or @kathy-phet could also take a look at this issue.

pixelzoom commented 4 months ago

Discussed with @ariel-phet and he convinced me that the bar magnet is behaving properly. He pointed to the same reference that @arouinfar provided above, http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/elemag.html. So I'm going to close this. @kathy-phet if you'd like to comment, please reopen.