phetsims / masses-and-springs

"Masses and Springs" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 5 forks source link

Why are there some values of thermal energy that cannot be cleared? #322

Closed phet-steele closed 6 years ago

phet-steele commented 6 years ago

I'm seeing this limit in EnergyGraphNode.js that decides whether the user can clear thermal energy:

  model.firstSpring.thermalEnergyProperty.link( function( value ) {
      clearThermalButton.enabled = ( value > 0.001 );
      clearThermalButton.pickable = ( value > 0.001 );
    }

I can't find documentation about why the limit of 0.001 was chosen. This coupled with the ability to zoom in makes the sim look buggy; thermal energy is shown but cannot be cleared:

image

The value of energy in the screenshot must be less than or equal to 0.001. @arouinfar @Denz1994 why is this limit in place? Would js just not work if the check was value > 0?

Denz1994 commented 6 years ago

I don't think there was a specific reason for this. This may have been introduced prior to the refactors to the energyGraphNode. I don't see a good reason to keep it around and it has been replaced with the above suggestion by @phet-steele. Leaving to @arouinfar to close if all seems good.

arouinfar commented 6 years ago

I see no reason to have such a limit. Good find @phet-steele.