Skip to content
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

Instruction in Example Guide may describe wrong behavior #135

Closed
KatieWoe opened this issue Jul 20, 2022 · 3 comments
Closed

Instruction in Example Guide may describe wrong behavior #135

KatieWoe opened this issue Jul 20, 2022 · 3 comments
Assignees
Labels
type:bug Something isn't working

Comments

@KatieWoe
Copy link

Device
Dell
OS
Win 11
Browser
Chrome
Problem Description
For phetsims/qa#820
Under the section for Mass Properties under the mystery screen, it says this:

To set the mass, use the massProperty. When customizing the mass, the volume will remain constant and the material/density will be updated.

However, the volume seems to change and the density is kept constant instead. I'm not sure if this is an issue with the guide or with the behavior, so assigning @arouinfar as well as @jonathanolson.

Visuals
instructionswrong
volumedown

@KatieWoe KatieWoe added the type:bug Something isn't working label Jul 20, 2022
@arouinfar
Copy link
Contributor

@jonathanolson this isn't the intended behavior, and the Examples doc is consistent with the phetioDocumentation of the massProperty which states:

Current mass of the block. Changing the mass will result in changes to the material (and therefore density), but the volume will remain the same.

@arouinfar arouinfar removed their assignment Jul 21, 2022
@jonathanolson
Copy link
Contributor

My impression was the intended behavior is for the volume to update when mass is changed (especially for phet-io changes). Is that the desired behavior for this?

Work for #101 notes the desire to change the volume, and the Mystery screen has the option adjustMassWithVolume set to true.

If that's not the desired behavior, it might be a significant amount of work.

@arouinfar
Copy link
Contributor

Thanks @jonathanolson, I was mistaken. I've updated examples.md to describe the correct behavior.

Due to the changes made in #138 to set volumeProperty.rangeProperty to [1, 10] L, if users aren't careful when setting massProperty they could create a situation where volumeProperty becomes out of range causing the sim to reload.

For example:

  1. Set customDensityProperty to 10000 kg/m^3
  2. Set massProperty to 1000 kg
  3. The required volume is 100 L, which is out of range.
    image
  4. When the sim reloads, the massProperty becomes 100 kg which corresponds to the maximum allowed volume (10 L).

It seems like Studio otherwise restores the state correctly, so users are unlikely to lose their work. I think we made the right call in #138, so I added further clarification to examples.md for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants