phetsims / wave-on-a-string

"Wave on a String" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/wave-on-a-string
GNU General Public License v3.0
7 stars 8 forks source link

Mode switching while paused is inconsistent #86

Closed jonathanolson closed 9 years ago

jonathanolson commented 9 years ago

I'd like to hear opinions on the desired behavior, as the current behavior is a bit tricky. Notably:

  1. Moving the wrench while paused will unpause, while pressing the pulse button queues up a pulse.
  2. Pausing at manual -> oscillate -> pulse will keep the bar for oscillate/pulse at places it can't reach. Thereafter, any switching between oscillate/pulse keeps the position, but switching to manual moves the wrench (and any changes thereafter) to 0, but doesn't move the bead.
  3. Pausing at manual -> pulse will move the bar to 0 without moving the bead.
  4. Pausing at pulse -> other modes will keep the bar/wrench position, UNTIL you have first visited manual, THEN gone back to pulse (in which case it resets the bar/wrench position to 0, without moving the bead).
  5. Pausing at oscillate -> other modes seems to keep bar/wrench position, UNTIL you have visited BOTH manual and pulse (resets bar/wrench position to 0, without moving the bead), UNLESS you go oscillate -> manual -> oscillate -> pulse, in which case the next switch to manual will break it.

So I'd like to know:

  1. Do we keep the "unpause on wrench drag", "stay paused on pulse button press"?
  2. When moving between modes, do we keep the bar/wrench positioned at the same place? If not, do we move to 0 AND move the bead? Or...?
arouinfar commented 9 years ago

To answer your questions:

1) I think the unpause behavior should be consistent. If a user drags the wrench or presses the pulse button, I would imagine they are trying to make the system go. If that's the case, then the sim should unpause for both wrench drags and pulse button presses.

2) It makes sense to me to have the bar/wrench always positioned at the same place. If that's not possible, then returning to 0 and moving the bead would also work. I think we should avoid situations where the bead becomes detached from the object, as it could make the sim appear broken.

While playing with the sim I also noticed an issue similar to those you described when switching between the end options while paused. While in Loose End or No End mode, pause the sim while the beads are displaced from the center line. Switching to the Fixed End mode will not return the bead to the clamp until play is pressed. This happens while using either the wrench, oscillator, or pulse generator.

screen shot 2014-09-03 at 9 56 00 am screen shot 2014-09-03 at 9 56 12 am

jonathanolson commented 9 years ago

Implemented as requested, looks good. closing.

jonathanolson commented 9 years ago

Did not fix the "Fixed End" case, reopening. Sorry!

arouinfar commented 9 years ago

During my interviews yesterday, both students noticed that the position of the wrench/oscillator/pulse generator moves when switching between modes. It's a bit hard to notice that when going from the oscillator to one of the other modes that the object is placed where the oscillator left off, as the oscillator can be moving a bit fast. One student seemed to think this behavior was a bug, which could be problematic. It might be worthwhile to consider having the object and first bead return the zero point when switching between modes to avoid this issue. What do you think, @ariel-phet and @jonathanolson?

patricialoeblein commented 9 years ago

I like the idea of having the position reset to zero when the mode is changed. This is the behavior of Energy Skate Park Basics http://www.colorado.edu/physics/phet/dev/html/energy-skate-park-basics/1.0.0-dev.60/energy-skate-park-basics_en.html

jonathanolson commented 9 years ago

When the sim is paused, should switching from oscillate to manual and back remove all of the oscillator's state (it will start at 0 and thus at a different phase than before)?

Should switching to manual from oscillate (especially while paused) move to the zero position?

ariel-phet commented 9 years ago

If we make this change, the string should be totally zeroed out when switching modes, even if the sim is paused. So yes, remove all the oscillator's state. Seems like it would be a good change.

We did see a student do some sophisticated behaviors by allowing the oscillator to go through just a full wavelength oscillation, pause, then switch to manual mode, so that he could watch the action of a nicely formed wave (of just one wavelength) move along the string. I suppose the best of all worlds would be to figure out a way turn the oscillator on and off. For instance, put an "on off" toggle switch next to the oscillator (default on) so that when you switch to oscillate you could turn the oscillator on and off (and form simple waves of one wavelength for instance).

Anyhow, we could leave a discussion of that added feature (toggle switch) to when we work on the basics version. It would be good to get this sim published.