phetsims / beers-law-lab

"Beer's Law Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/beers-law-lab
GNU General Public License v3.0
2 stars 9 forks source link

add a readout display for the Solute #148

Closed pixelzoom closed 8 years ago

pixelzoom commented 8 years ago

Migrating this issue from https://github.com/phetsims/concentration/issues/47, where @kathy-phet said:

We are looking to add the following features to increase flexibility for lab use and for younger grade level. I suggest making all of these as behaviors that are designed into master and part of our published sim, and accessible through query parameters.

  • [ ] Add a readout display for the Solute added (in g) ...
pixelzoom commented 8 years ago

In https://github.com/phetsims/concentration/issues/47#issuecomment-177034062, @ariel-phet described the priority:

ideally complete next week. This would be top priority, with the understanding that it is bumping function builder priority for next week. I think we could hand a link that is tested, but not yet published on the website.

pixelzoom commented 8 years ago

In https://github.com/phetsims/concentration/issues/47#issuecomment-177034062, @ariel-phet wrote:

For the Solute display, I have some thoughts, but you and I should discuss, and then probably get some opinions from Amy H.

pixelzoom commented 8 years ago

Model changes: • Requires the same model changes as noted in https://github.com/phetsims/beers-law-lab/issues/149#issuecomment-177326987. • See beaker for computation of grams.

View changes: • Put "Solute Amount: XX g" above the "Remove Solute" button. OK to reduce width of Evaporation control if needed.

pixelzoom commented 8 years ago

@ariel-phet will discuss with @amyh-phet whether this feature should always be visible, or hidden behind a query parameter.

The query parameter would be showSoluteAmount.

pixelzoom commented 8 years ago

Question for @kathy-phet and @ariel-phet .... The current plan is for this feature to apply only to the "Concentration" screen. Is there anything related that needs to be changed in the "Beer's Law" screen? Ie, if I enabled this feature when running the Beer's Law Lab sim, will there be anything inconsistent between the "Concentration" and "Beer's Law" screens if only the Concentration screen displays solute amount in grams?

pixelzoom commented 8 years ago

@ariel-phet How do you want this feature delivered? As a 1.3.1 maintenance release (more work for me), or as a new 1.4 release branch (requires a complete RC test)? ... keeping in mind that recent PhET-iO changes are not in the 1.3 maintenance branch.

pixelzoom commented 8 years ago

@ariel-phet How many decimal places in the displayed value?

ariel-phet commented 8 years ago

In beaker the grams of solute were given as a whole number, so I would think we should round to the nearest whole number for this change request

pixelzoom commented 8 years ago

@ariel-phet Is there anything related to this feature that needs to appear in the PhET-iO data stream? Or is this something that's only visible to the user?

ariel-phet commented 8 years ago

@pixelzoom - my instincts would say that knowing the amount of solute added would be useful in PhET-iO.

I think if the moles of solute is already available for iO that would be fine so long as the grams per mole we were using were was clear. (so it could be easily calculated by the end iO user). But some sort of availability of the amount of solute added at different points seems important. For instance isn't the fact that the solution is saturated somehow reported in the iO data stream?

pixelzoom commented 8 years ago

beers-law-lab-api.js updated in https://github.com/phetsims/together/commit/25cb5d85621cdef7d69e4201e0a80f0d1580efb2, added 2 new Properties:

• soluteGramsProperty (for this issue) • percentConcentrationProperty (for #149)

pixelzoom commented 8 years ago

Dev version is available here:

http://www.colorado.edu/physics/phet/dev/html/beers-law-lab/1.4.0-dev.1/beers-law-lab_en.html

The query parameter is soluteAmountVisible. It's a boolean query parameter, and follows the convention used by other PhET boolean query parameter. That is, if you provide the query parameter, it's true, if you don't then it's false. If you soluteAmountVisible=false, that's still going to show the feature. (If you want this behavior changed, create a chipper issue. Otherwise I'm going to follow PhET convention.)

To demonstrate this feature:

http://www.colorado.edu/physics/phet/dev/html/beers-law-lab/1.4.0-dev.1/beers-law-lab_en.html? soluteAmountVisible

Assigned to @ariel-phet for initial feedback.

We should have a chemist review the correctness of the values. I copied what was done in Beaker, and I'm not qualified to verify the correctness of the values.

pixelzoom commented 8 years ago

Btw... On some browsers, the "Solute Amount: X g" string jitters around a little as it's updated. Nothing I can do about that. In order to properly handle i18n order, this is a single string that must be updated as the value changes.

ariel-phet commented 8 years ago

Looking good. @amyh-phet liked the placement of the the readout. Said the only tweak she would consider is making the words "Solute Amount:" bold, but she was not sure. She definitely felt putting it in a panel would be too heavy handed.

@amyh-phet also said values are included in the teacher tips (we should probably match these):

conc

pixelzoom commented 8 years ago

The values I used from the Beaker sim match the teacher tips, but only to 1 decimal place. Do you want 3 decimal places?

pixelzoom commented 8 years ago

@ariel-phet says that if this is what's in the teacher tips, then these are the values that we should have in the model. I will use these exact values, to 3 decimal places.

pixelzoom commented 8 years ago

Other decisions: • leave font as is for now, consistent with everything else on the screen • keep this feature hidden behind query parameter

pixelzoom commented 8 years ago

Values for molar mass have been changed as specified in https://github.com/phetsims/beers-law-lab/issues/148#issuecomment-178091606.

@amyh-phet please test that the displayed values look correct in this dev version (note showSoluteAmount query parameter to enable this feature):

http://www.colorado.edu/physics/phet/dev/html/beers-law-lab/1.4.0-dev.2/beers-law-lab_en.html?showSoluteAmount

amyh-phet commented 8 years ago

@pixelzoom Displayed values for solute amount are correct for the concentrations and volumes displayed on screen. Verified for drink mix and nickel (II) chloride. Can test other solutions if needed.

pixelzoom commented 8 years ago

I verified that the sim builds with grunt --brand=phet-io and runs with ?togetherEvents.log=console&phet-io-standalone.

@samreid I'll need your assistance to verify that concentrationScreen.model.solution.soluteGramsProperty looks correct in the data stream. Please contact me when you have time, or feel free to verify without me if you have time when I'm unavailable.

pixelzoom commented 8 years ago

@samreid Never mind, I consulted with @jbphet on the data stream. soluteGramsProperty is present (in the console) and looks correct.

pixelzoom commented 8 years ago

All work completed for this issue.

pixelzoom commented 8 years ago

Verified by @phet-steele in https://github.com/phetsims/tasks/issues/532#issuecomment-193459903. Closing.