phetsims / energy-skate-park-basics

"Energy Skate Park: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/energy-skate-park-basics
GNU General Public License v3.0
2 stars 9 forks source link

Clear thermal button present when energy is there. #439

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago

Device Dell Laptop OS Win 10 Browser Chrome Problem Description Found during https://github.com/phetsims/QA/issues/197 (both versions) and may be related to https://github.com/phetsims/energy-skate-park-basics/issues/281 It is possible to see a tiny amount of thermal energy in the bar graph and pie chart, but not be able to click the clear thermal energy button. Steps to Reproduce

  1. Go to Friction screen
  2. Select the third (wavy) scene
  3. Turn on pie chart and bar graph
  4. Start the skater on the ramp
  5. Periodically dispose of energy.
  6. When skater is stopped, dispose of energy one more time. A bit will be displayed in the charts, but you can't dispose of it.

Screenshots thermal

KatieWoe commented 5 years ago

@samreid on slack:

Please assign to Jesse, but let him know he can reach out to me for help if desired.

jessegreenberg commented 5 years ago

Also related to https://github.com/phetsims/energy-skate-park-basics/issues/307. The thermal and total energy bar have showSmallValuesAsZero false

        if ( showSmallValuesAsZero ) {
          answer = result > 1 ? Math.floor( result ) :
                   result < 1 ? 0 :
                   1;
        }
        else {
          answer = result > 1 ? Math.floor( result ) :
                   result < 1E-6 ? 0 :
                   1;
        }

The skater doesn't actually stop, continues to oscillate forever and all of the energy is very small, but this code is keeping thermal and total energies visible.

Maybe we could totally stop the skater in this case? Or we could adjust 1E-6 as the cutoff? Or maybe this is pedagogically useful?

jessegreenberg commented 5 years ago

Code comment says

For thermal and total energy, make sure they are big enough to be visible, see #307. For kinetic and potential, they must go to zero at the endpoints to reach learning goals like "The kinetic energy is zero at the top of the trajectory (turning point)

jessegreenberg commented 5 years ago

Here is a comment about why the thresholding is added for thermal and total, but not potential and kinetic https://github.com/phetsims/energy-skate-park-basics/issues/307#issuecomment-62442189

jessegreenberg commented 5 years ago

Skater has this Property:

// @public - Enable the "Clear Thermal" buttons but only if the thermal energy exceeds a tiny threshold, so there aren't visual "false positives", see #306
this.allowClearingThermalEnergyProperty

And the threshold is 1E-2.

jessegreenberg commented 5 years ago

So also related to https://github.com/phetsims/energy-skate-park-basics/issues/306

jessegreenberg commented 5 years ago

Ah, so for thermal energy to be visible on the graph the value / 30 needs to be larger than 1E-6. For the button to be enabled, thermal energy needs to be larger than 1E-2. If these match, then the button will be enabled when thermal energy is visible.

jessegreenberg commented 5 years ago

The threshold for enabling the clear thermal energy button now matches the threshold for showing the thermal energy in the bar graph. @KatieWoe can you please make sure this is fixed in master?

KatieWoe commented 5 years ago

@jessegreenberg unable to see energy in the bar graph when button in on. However, I think I'm still seeing something very tiny in the pie chart. pie

jessegreenberg commented 5 years ago

Thanks @KatieWoe, handled for both the PieChartNode and WebGLPieChartNode. Can this issue be closed?

KatieWoe commented 5 years ago

Looks good on master now.

jessegreenberg commented 5 years ago

Thanks!