phetsims / wave-interference

"Wave Interference" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
19 stars 5 forks source link

Repeatedly manually "pulsing" cuts waves off #417

Open ghost opened 5 years ago

ghost commented 5 years ago

Test Device

MacBook Air

Operating System

macOS 10.14.5

Browser

Chrome 75.0.3770.142

Problem Description

For https://github.com/phetsims/QA/issues/389. If you set the wave generator to the "pulse" setting (instead of the "continuous" setting) and you repeatedly press the button to generate a wave, the waves in the vanguard will disappear mysteriously. This happens for light waves and sound waves. This issue is present in the published version.

Steps to Reproduce

  1. Waves screen.
  2. Pulse setting.
  3. Repeatedly generate waves.

Visuals

issue

Troubleshooting Information !!!!! DO NOT EDIT !!!!! Name: ‪Wave Interference‬ URL: https://phet-dev.colorado.edu/html/wave-interference/2.0.0-dev.7/phet/wave-interference_en_phet.html Version: 2.0.0-dev.7 2019-07-30 22:17:13 UTC Features missing: touch User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Language: en-US Window: 1440x821 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 15 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 80) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
KatieWoe commented 5 years ago

Also appears in sound. Manifests a bit differently in water, as seen here: https://drive.google.com/file/d/1da7VpeZrGrltF-VjkRL3ha8K47aVhdew/view?usp=sharing

samreid commented 5 years ago

This problem is similar to https://github.com/phetsims/wave-interference/issues/417

ghost commented 5 years ago

@samreid, did you paste the wrong URL?

samreid commented 5 years ago

Yes, thanks. The correct URL is https://github.com/phetsims/wave-interference/issues/333

samreid commented 5 years ago

In #333 @ariel-phet said:

Deferring for now, we will reevaluate after 1.0. However, it seems like the action required to cause this bugginess is not pedagogically productive anyhow, so we might just leave as is.

@ariel-phet or @arouinfar do you want to investigate this further at this time?

arouinfar commented 5 years ago

However, it seems like the action required to cause this bugginess is not pedagogically productive anyhow

I would agree that this is true for #333 (vigorously scrubbing the amplitude slider), but I would argue that this case is a bit different. Here, a student may be trying to replicate the continuous wave by well-timed pulses. Having wavefronts disappear from the lattice looks incredibly buggy.

@samreid I would say that it's worth some investigation.

ariel-phet commented 5 years ago

@samreid worthy of some investigation, but not a showstopper (as in if a couple of hours do not yield some good thought of a solution kick it back to me).

samreid commented 5 years ago

The worst case scenario is light at the highest frequency--on the lattice it clears sooner than water or sound at the max frequency. Two straightforward solutions would be:

  1. Increase the number of deltas stored in the temporal mask. It is currently up to 10. Turning it up to 26 makes it so no waves are deleted in the visible area.
  2. Increase the delay before the user can press the pulse button again. It is currently hardcoded to enable the button after exactly one pulse. We could change it so the button enables after 2.5 cycles, or a predetermined amount of time. This development would take an hour or so to change.

We could also combine those strategies, by increasing the button disable time and increasing the temporal mask deltas. First I'll test 26 deltas on iPad Air 2 and see how that impacts the performance.

UPDATE: Allowing 26 deltas on the iPad Air 2 drops performance to 5fps. And after the commit in https://github.com/phetsims/wave-interference/issues/319#issuecomment-458324396 the deltas are never cleared until the reset button is pressed, so the performance can stay at 5fps for a long time. The wave behavior is undecipherable at 5fps, so I don't think we can use this solution.

@ariel-phet any other ideas for dealing with this problem? Want to investigate having the button grayed out longer? Or is it important that the user can immediately start a wave right at the end of the previous wave?

arouinfar commented 5 years ago

UPDATE: Allowing 26 deltas on the iPad Air 2 drops performance to 5fps. And after the commit in #319 (comment) the deltas are never cleared until the reset button is pressed, so the performance can stay at 5fps for a long time. The wave behavior is undecipherable at 5fps, so I don't think we can use this solution.

I'd agree @samreid. Option (1) doesn't sound viable to me.

Option (2) sounds reasonable, but I think it could feel pretty buggy if the disabled time lasts too long. I'm a little hesitant to invest the time on this, and leaning a bit towards deferring. I'd be happy to let @ariel-phet make the final call.

ariel-phet commented 5 years ago

@samreid lets defer - I really think the main use of such a feature is to truly send out "pulses" not necessarily trying to recreate a CW wave.