-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Molecule count for hydronium and hydroxide ions different at pH = 7 #225
Comments
Thanks @Nancy-Salpepi. Reproduced in 1.5.0-rc.1 and master. I'll investigate, but here's my best guess. Because the slider is continuous, the pH is not exactly 7.00 in the model. It's probably something like 7.005, but we're only displaying 7.00. |
I thought it might be due to rounding, but since the molecule count was equal in all other instances, I thought it was odd for it to be different here. |
Yep, pH is not exactly 7.00 in the model. For example, in this case pH=6.997477692908731. And you can see that the H3O+ and OH- sliders have different values. If I fiddle with the OH- slider a bit, I can make the H30+ and OH- sliders have the same value, and the pH is still not 7.00, it's actually 6.999667798625693. So there's a signicant problems here. We have a continous slider that has a precision that allows us to set pH values that can't be differentiated by 2 decimal place. I'm not sure how to resolve this. Maybe make the sliders snap to one decimal place for the coefficient? @arouinfar thoughts? |
Notes to self: If we want to constrain the slider coefficients to 2 decimal places, then that can be done in either GraphIndicatorDragListener (in |
I went ahead and implemented this approach in the above commit. @arouinfar if you can think of any problems with this, please jump in asap. @Nancy-Salpepi please verify this fix in master. Then assign back to me, so that I can patch the 1.5 branches. |
@Nancy-Salpepi I could easily reproduce the problem before, and I'm unable to now in master. I see from your screenshot that you're using phettest to test master. So I suspect that phettest may not have pulled the latest changes, or you're experiencing caching in your browser. If you think that may be the case and aren't familiar with those issues, ask one of the other QA team to fill you in. In the meantime, please give it a try in 1.6.0-dev.1. Thanks! |
Sorry that was my fault. I was not in incognito mode. I couldn't reproduce the problem in master or in 1.6.0-dev.1 |
No, master is sufficient, thanks. I'll assign this back to me for patching in 1.5. Note to self: While this feature is only used in ph-scale, I think I'll also patch ph-scale-basics, so that they continue to share the same code base. The sha is e7b9bf4. |
Patched in 1.5 branches for ph-scale and ph-scale-basics. Ready for verification in next RC. |
@Nancy-Salpepi this was a really great find and I think the change @pixelzoom made to constrain the values set by the graph indicators was necessary.
Here are some examples that demonstrate the dilution issue on the Micro screen. |
Workaround implemented in the above 3 commits, which I'll need to cherry-pick to 1.5 branches. This workaround is needed only when the graph is set to Concentration. For Quantity, neutral pH corresponds to H3O+ and OH- quantities of 5.0e-8 mol. And 4.9e-8 has no similar problem, as it results in a pH of 6.99. @arouinfar please review in master, and let me know if this looks OK. |
Looks good in master @pixelzoom. I've created an issue to update the Teacher Tips (referenced above). |
Patched in ph-scale 1.5. Not necessary to patch in ph-scale-basics 1.5, because this feature (and code) does not appear in that sim. Ready for verification in the next RC. |
This looks ok in rc.3 |
Test device
iMac
Operating System
10.15.7
Browser
Safari 14.1.1 (also seen on MacBook Air with M1 chip + chrome)
Problem description
phetsims/qa#669
After initially moving OH- slider to maximum quantity of 5.0 mol (pH = 15), the molecule counts for hydroxide and hydronium ions were not equal when pH was returned to 7 using hydroxide slider. This was only seen when slider was used and not when number adjuster in pH panel was manipulated. If the pH was manipulated using the hydroxide slider after the number adjusters were used, molecule counts were equal at pH = 7.
Steps to reproduce
Visuals
https://drive.google.com/file/d/1x5Nrnp-dSAalCpTGHzLpm6uX7MY_fCod/view?usp=sharing
Troubleshooting information:
!!!!! DO NOT EDIT !!!!!
Name: pH Scale
URL: https://phet-dev.colorado.edu/html/ph-scale/1.5.0-rc.1/phet/ph-scale_all_phet.html
Version: 1.5.0-rc.1 2021-07-13 18:33:46 UTC
Features missing: touch
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15
Language: en
Window: 1409x778
Pixel Ratio: 1/1
WebGL: WebGL 1.0
GLSL: WebGL GLSL ES 1.0 (1.0)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 31 uniform: 1024
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 8192x8192
OES_texture_float: true
Dependencies JSON: {}
The text was updated successfully, but these errors were encountered: