Open samreid opened 1 month ago
Has this always been broken? I've bisected back to March 18 and it is still buggy.
@AgustinVallejo @samreid and I discussed this, and we can see that the contact force vector is very eratic while dragging with a mouse. We think this is because we are incomplete about how we are writing our force diagram. We don't show the pointer contraint force arrow. But p2 is still including the pointer force's contact force as part of the main contact force. This makes the diagram unbalanced, AND quite flickery.
To proceed, here are some ideas:
Let's see if we can use some sort of average/median of the contact force interpolated property. That will get rid of some of the noise from rapid acceleration/deceleration from the mouse/keyboard input.
Here is a patch of some logging I was doing to try to understand how InterpolatedProperty works.
I don't really understand how we have 10 or so model runs in between steps, but then all the previous values are ignored when calculated the actual value based on a ratio. The ratio is only from the most recent section, so basically, all other items since last draw are ignored. Perhaps most of the time that is fine, but for the force arrows, I think it would be good to figure out some sort of average, and the ratio only applies to the very last value.
I don't really understand how we have 10 or so model runs in between steps
Not sure if this is related, but when working on https://github.com/phetsims/buoyancy/issues/64, I logged the flickering values, corresponding to this vertical forces, and they seem to be periodical. I'm wondering if having multiple model runs between steps could be causing small inconsistencies between forces.
The following is a chatgpt made chart with a subset of the logging:
Period is exactly 11, so this theory is growing on me.
Before starting on https://github.com/phetsims/density-buoyancy-common/issues/111, I observed the force display on the block is haywire. Here is a video:
https://github.com/phetsims/buoyancy/assets/679486/0a0cb19c-ef0c-46b5-bd2d-305c7a99bd11
This is a new problem and looks serious so I will prioritize this issue on the project board.