phetsims / resistance-in-a-wire

"Resistance in a Wire" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/resistance-in-a-wire
GNU General Public License v3.0
1 stars 4 forks source link

Rounding error found in visual sim #125

Closed terracoda closed 6 years ago

terracoda commented 6 years ago

As noted in issue #122,

While exploring edge cases with extreme slider values, I was able to see a zero value for Resistance even though a zero value is not actually possible since the sliders for resistivity, length and area do not have zero values.

This edge case happens when Length is at minimum, and Area is at maximum, and the user explores the Resistivity slider. Values for Resistance range only from 0 to 0.01 ohm, so for a good portion of the resistivity slide, Resistance shows as "resistance = 0.00"

In the description, we might need to say "near zero" rather than zero, and I am not sure exactly how we should fix the visual sim, or if we need to.

@emily-phet or @ariel-phet, could one of comment and assign to appropriate designer?

ariel-phet commented 6 years ago

@terracoda I think we could easily solve this issue by adding a third decimal place when the value of the resistance is less than 1.00. The sim already handles 4 digits (Length and Resistivity maximum, and Area minimum gives 2000 ohm resistance). We are playing a little fast and loose with significant digits but nobody seems to have minded. This seems like a simple change that could be made.

If this is an acceptable solution, please just assign over to @jessegreenberg.

terracoda commented 6 years ago

@ariel-phet, if this solution means Resistance won't ever register as 0.000, that sounds good to me.

I will assign to @jessegreenberg. We can then see if an an extra zero will impact the visual layout.

terracoda commented 6 years ago

@jessegreenberg, please add a third decimal point when resistance is less than 1.00.

terracoda commented 6 years ago

@jessegreenberg, please re-assign to me if you have any design questions. I am un-assigning myself.

jessegreenberg commented 6 years ago

Change made in the above commit. @terracoda can you review on phettest? It is still possible for 0.000 to show up when R is smallest.

jessegreenberg commented 6 years ago

If we add a fourth decimal place then there will always be a value in the readout.

terracoda commented 6 years ago

@ariel-phet and @emily-phet, it looks like we have just enough visual space for another decimal place. I think it would be ideal if the fourth decimal place was also restricted - only added when resistance becomes less than 0.001.

Here's an example edge case: the lowest 7 values for Resistivity where Length is at minimum and Area is at maximum produce values for Resistance lower than 0.000.

screen shot 2018-02-07 at 22 04 28 screen shot 2018-02-07 at 21 54 42

Should another decimal place be added?

ariel-phet commented 6 years ago

As I mentioned, we don't seem to be sticking to pedantically to significant digit rules, and you can get a 4 digit resistance like 1990. So I think adding a 4th decimal in the less than 0.001 case is fine

An argument could be made for the resistance being "effectively" zero, which would be the other way to go when resistance is very small. But in this case, 0.0001 ohms is a perfectly measurable resistance, so I see no reason not to display it.

jessegreenberg commented 6 years ago

Thanks @ariel-phet and @terracoda, changed in the above commit. Closing.