phetsims / capacitor-lab-basics

"Capacitor Lab: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

Lots of time may elapse when previewing the sim in Studio #290

Closed arouinfar closed 3 years ago

arouinfar commented 3 years ago

Discovered during #249

Steps to reproduce

  1. Open the sim in Studio
  2. Maximize capacitance (2 mm separation, 400 mm^2 area) to maximize the decay time
  3. Charge capacitor to 1.5 V
  4. Move switch to the light bulb
  5. When the left side of the halo reaches the center of the capacitor, click "Preview Sim". (The exact halo size doesn't seem to be important, but this is a handy visual reference point.) Screen Shot 2021-04-29 at 5 11 43 PM
  6. It takes a second or two for the previewed sim to load, but when it does, it seems like time was still elapsing in the model and the halo is now very small. (Because of https://github.com/phetsims/scenery-phet/issues/676 I can't actually confirm that time is elapsing in the sim.) Screen Shot 2021-04-29 at 5 11 46 PM
  7. Switch back to the Studio browser tab and notice that the halo is essentially the same size as as when pressing "Preview Sim".
jonathanolson commented 3 years ago

Doesn't look like elapsed time (https://github.com/phetsims/scenery-phet/issues/676 has been addressed it seems). Something else is going on

jonathanolson commented 3 years ago

phet.joist.sim.screens[2].model.circuit.capacitor.plateVoltageProperty.value is 0.768879966097508 for the in-studio sim, and 0.1281466610162513 for the previewed sim.

jonathanolson commented 3 years ago

I believe this should be fixed by the above commit, can you verify?

arouinfar commented 3 years ago

Looks great, thanks @jonathanolson!