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

Use a gradient B-field to verify the flux model. #167

Closed pixelzoom closed 1 month ago

pixelzoom commented 1 month ago

Related to https://github.com/phetsims/faradays-electromagnetic-lab/issues/156 (new flux model) ...

(This was originally put in https://github.com/phetsims/faradays-electromagnetic-lab/issues/66 by mistake on 5/1/24, so I'm moving it here.)

Notes from 5/1/24 meeting with @arouinfar and @ariel-phet.

@ariel-phet said that he had a hard time convincing himself that #156 was correct by just playing with the sim. He had this idea for inspecting flux, which I'll try to summarize here:

I'll need to give some thought to the best way to do this.

pixelzoom commented 1 month ago

(This comment was originally in #66 on 5/10/24.)

In https://github.com/phetsims/faradays-electromagnetic-lab/commit/9c1861fe137e90a7b533df01d76197033f28e613, I added a query parameter for setting up the constant Bx or gradient Bx field that @ariel-phet suggested in https://github.com/phetsims/faradays-electromagnetic-lab/issues/66#issuecomment-2089265340.

The query parameter is gradientField, documented as:

  // Ignores the magnet model and sets up a static gradient B-field, where all field vectors are (Bx,0), and Bx varies
  // linearly over a range. The value for this query parameter is the range of Bx from positions x=100 to x=650.
  // These positions will be noted by yellow vertical lines. By is always 0.
  //
  // This is useful for calibrating the sim, and verifying behavior of the pickup coil. This query parameter affects
  // all screens, even though it is only useful in the Pickup Coil and Transformer screens.
  //
  // Examples:
  // gradientField=300,300 creates a constant B-field with (Bx,By) = (300,0) everywhere.
  // gradientField=0,300 create a gradient B-field, where Bx changes linearly from 0 to 300, and By is 0 everywhere.
  //

Below is a screenshot showing gradientField=0,300. The vertical yellow lines show the x-range over which the gradient occurs.

I'll need to meet with @ariel-phet to talk more about how he envisions using this.

screenshot_3291
pixelzoom commented 1 month ago

@ariel-phet and I met yesterday to review the behavior of the pickup coil using the gradientField query parameter, described in https://github.com/phetsims/faradays-electromagnetic-lab/issues/66#issuecomment-2105392854.

Running with ?dev&gradientField=... and opening the "Pickup Coil debugger" panel in the Pickup Coil screen...

With gradientField=300,300 (constant-strength field)... We changed the number of loops and loop area, and verified that the flux (Φ) shown in the panel behaved as expected.

With gradientField=0,300 (left-to-right gradient field)... We turned on "Lock to Axis", and moved the bar magnet as far to the left (out of the way) as possible. We slowly dragged the pickup coil left and right, and verified that flux changed as expected. We repeated with various settings for number of loops and loop area.

pixelzoom commented 1 month ago

@arouinfar Do you want to take this for a spin?

arouinfar commented 1 month ago

Thanks @pixelzoom this was helpful in reviewing #156, closing.