phetsims/neuron

Concentrations Blow Up in Firefox (win 7)

Closed this issue · 6 comments

Related to phetsims/tasks#485

Test device: Win 7 Laptop, Bates

Operating System: Window 7 64-bit

Browser: Firefox 43.0.4

Problem description: The concentrations continue to blow up instead of returning to equilibrium.

Steps to reproduce: I first noticed this issue when I stimulated the neuron, then selected concentrations. After resetting the sim (with button) I selected the concentrations first and they displayed large numbers of magnitude of 10^100. Then the sim seemed to glitch and the numbers returned to normal. I have not been able to reproduce the issue.

Severity:

Screenshots:
apologies for the poor quality, had to record the screen with my phone. This is after the neuron would have returned to equilibrium, yet the numbers are continuing to blow up. They gained 10^50 orders of magnitude before the simulation returned to normal behavior.
https://drive.google.com/file/d/0B_TAL-jnJOoKOFNuZ2YzVExCS3c/view?usp=sharing

Troubleshooting information (do not edit):
Name: ‪Neuron‬
URL: http://www.colorado.edu/physics/phet/dev/html/neuron/1.0.0-rc.2/neuron_en.html
Version: 1.0.0-rc.2 2016-01-23 00:14:48 UTC
Features missing: touch
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
Language: en-US
Window: 1366x631
Pixel Ratio: 1/1
WebGL: WebGL 1.0
GLSL: WebGL GLSL ES 1.0
Vendor: Mozilla (Mozilla)
Vertex: attribs: 16 varying: 28 uniform: 1024
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 32767x32767
OES_texture_float: true
Dependencies JSON: {"assert":{"sha":"d4909677","branch":"HEAD"},"axon":{"sha":"6f3c2e01","branch":"HEAD"},"babel":{"sha":"db982666","branch":"master"},"brand":{"sha":"c9282935","branch":"HEAD"},"chipper":{"sha":"1d1d5d32","branch":"HEAD"},"dot":{"sha":"7a28b1a9","branch":"HEAD"},"griddle":{"sha":"3adb78bd","branch":"HEAD"},"joist":{"sha":"191b15a4","branch":"HEAD"},"kite":{"sha":"4a947119","branch":"HEAD"},"neuron":{"sha":"d5e13134","branch":"HEAD"},"phet-core":{"sha":"73a034c6","branch":"HEAD"},"phetcommon":{"sha":"d712ace0","branch":"HEAD"},"scenery":{"sha":"47143cdd","branch":"HEAD"},"scenery-phet":{"sha":"a7f975d1","branch":"HEAD"},"sherpa":{"sha":"be8c4fc9","branch":"HEAD"},"sun":{"sha":"64555735","branch":"HEAD"},"tandem":{"sha":"07fbe58c","branch":"HEAD"}}

@jbphet this may be the reason for this issue, and is a reasonable way to reproduce:
http://www.mayoclinic.org/symptoms/hyperkalemia/basics/causes/sym-20050776

😆

I was able to duplicate this, though it took quite a while and I could only do it once. I set up two tabs on Firefox, each running the sim, and did a lot of stimulating the sim and switching back and forth. My reasoning was that perhaps this is a case of a long time step being received by the sim and not handled correctly. However, as I said, I could only get it to happen once. In my case, the concentrations did not return to normal after a while. Also, reset all didn't fix the issue. A reload did.

Screenshots:

neuron-runaway-concentration-values

neuron-runaway-concentration-values-2

After more investigation, I can now duplicate this pretty consistently by starting up the sim, switching to fast forward, checking all the boxes, stimulating the neuron, and then minimizing and maximizing the simulation as the action potential progresses. After a few minutes of doing this, the runaway concentrations will generally occur.

The root cause of this problem was that when long time steps were sent to the simulation model the concentrations could change so much that the code would fail to detect that the concentration value had returned to its nominal value. In other words, overshoot and undershoot were possible. I've done two things to address this.

  1. changed the concentration handling code to detect over or undershoot and set the concentration values to back to nominal
  2. added code to break particular large time step values into multiple smaller time steps

The 2nd of these two also helps with some other issues, such as #109. There is a bit of a performance cost, but this should only kick in when doing lots of things at once (e.g. zooming back and forth during an action potential) so I feel that this is a reasonable tradeoff.

@jbphet I have not been able to reproduce this issue. Resolved