phetsims / collision-lab

"Collision Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

Questions on Change in Momentum #85

Closed brandonLi8 closed 4 years ago

brandonLi8 commented 4 years ago

1D screens are being implemented in #82, and I'm getting closer to implementing the change in momentum feature (or at least i'm thinking about it).

I have several questions:

image

(1) In the design doc, there is a picture of the momentum vectors and they are purple. However, it also states Color matches momentum, but thicker. Are the vectors supposed to be purple or yellow?

(2) In the design doc, it states Change in momentum is instantaneous at the moment of collision, but isn’t around forever (not a persistent force). The image only shows them at the instant the collision occurs. I'm assuming they pop up for longer than just one frame, and the Balls will bounce off and separate before they are removed. Do the dotted lines stay in the position of where the Ball first collided or follow the center x-coordinate of the Ball?

(3) Where is the "Change in Momentum" text positioned? One way would be to position its centerX at the average of the tails of the momentum vectors.

(3) Do the momentum vectors pop up only on ball to ball collisions or with ball to wall collisions as well?

(4) In the design doc: "While “change in momentum” is the correct term, MD wonders if there would be issues with implicitly defining the time frame to the instant of the collision. Would the initial and final state be clear to students?" Has this been addressed?

arouinfar commented 4 years ago

Discussed in the 6/4/20 design meeting.

(1) In the design doc, there is a picture of the momentum vectors and they are purple. However, it also states Color matches momentum, but thicker. Are the vectors supposed to be purple or yellow?

Same color as momentum, but still need to figure out the best color for momentum, in general.

(2) In the design doc, it states Change in momentum is instantaneous at the moment of collision, but isn’t around forever (not a persistent force). The image only shows them at the instant the collision occurs. I'm assuming they pop up for longer than just one frame, and the Balls will bounce off and separate before they are removed. Do the dotted lines stay in the position of where the Ball first collided or follow the center x-coordinate of the Ball?

The dotted lines and vectors travel with the balls. The Change in Momentum representation will be visible for a short period of time before fading away. Let's start with 1 s, but create a query parameter so it can be easily be tuned by the team.

(3) Where is the "Change in Momentum" text positioned? One way would be to position its centerX at the average of the tails of the momentum vectors.

Center the Change in Momentum string over the collision point.

(3) Do the momentum vectors pop up only on ball to ball collisions or with ball to wall collisions as well?

It only appears for ball-ball collisions. This representation is only available on the Intro screen, which does not have a reflecting border.

(4) In the design doc: "While “change in momentum” is the correct term, MD wonders if there would be issues with implicitly defining the time frame to the instant of the collision. Would the initial and final state be clear to students?" Has this been addressed?

We'll learn more about this during user interviews. For now, let's continue as planned.

brandonLi8 commented 4 years ago

In the commits above, I added a prototype (needs cleanup, possibly a change in class hierarchy) for the Change in Momentum Vectors.

Here is a preview: ezgif-2-e76cc11c4527


As requested, I have added two query parameters:

changeInMomentumVisiblePeriod (default 0.5 seconds) is the amount of time the change in momentum vector is fully visible (opacity = 1.0) after a collision.

changeInMomentumFadePeriod (default 0.5 seconds) is the amount of time the change in momentum vectors linearly fade in opacity to 0 after the changeInMomentumVisiblePeriod has passed.

Some other features

brandonLi8 commented 4 years ago

There are also issues with reversing. In the commit above, I attempted to fix the most basic reversing case, but reversing past multiple collisions doesn't work. We might want to not show change in momentum vectors when reversing or think about what should happen when the sim is reversing.

Edit: I forgot that there are only 2 balls in Intro and there isn't a reflecting border, so there is no way for there to be multiple collisions without manipulating a ball, which clears the "Change in momentum"

brandonLi8 commented 4 years ago

Thinking about it, I don't think should track the state of the change in momentum vector across multiple collisions since the user could change the position of the ball (via drag) while rewinding. Imo, the change in momentum vectors should be invisible when reversing except for on the exact point the Balls collide. The change in momentum vector of a ball should also be "cleared" when a user drags on that ball (or manipulates it in any way, similar to how paths clear on all user interactions with a ball). @arouinfar thoughts?

Edit: I forgot that there are only 2 balls in Intro and there isn't a reflecting border, so there is no way for there to be multiple collisions without manipulating a ball, which clears the "Change in momentum"

brandonLi8 commented 4 years ago

I went ahead and finished the implementation, including the "Change in Momentum" text.

I also went ahead and cleared both of the change in momentum vectors on user interaction, as I felt this was the most natural interaction.

The text, lines, and arrows all fade with the same opacity.

At this point, I think this is ready for review in master.

brandonLi8 commented 4 years ago

Spoke with @arouinfar on 6/25/20 and we decided to set the elapsed time to 0 when the user manipulates any of the balls in all screens. This eliminates weird behavior when the sim is stepped backwards with change in momentum visible.

brandonLi8 commented 4 years ago

Done in the commit above. Closing.