APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Problems handling simultaneous events. post and replies

Return to the Problems handling simultaneous events. thread
Login to post to this thread

EjsS 5.2 seems to have difficulty handling simultaneous events. - August 10, 2016 at 1:50
Stephen Salser
8 Posts

I created separate events for collisions of particles with the left and right walls.

The events are handled properly when the events are non simultaneous, but when a right wall and left wall collision happen simultaneously, only the right wall even is handled.

These are both Positive Crossing events, and I have tried both Secant and Bisection methods.

Is there a elegant fix to this problem?


Replies to EjsS 5.2 seems to have difficulty handling simultaneous events.

Re: EjsS 5.2 seems to have difficulty handling simultaneous events. - August 10 2016 2:36
lookang Avatar
lookang
220 Posts

i agree that EJSS has that issue, to overcome it introduce a very slight difference in the launch position that will result in slightly different in timing of events of colliding with either one of the 4 walls.


OSP@SG blog
OSP@SG Digital Library


Re: EjsS 5.2 seems to have difficulty handling simultaneous events. - August 10 2016 6:21
Wolfgang
141 Posts

Use state events rather than positive crossing events if there is the possibility of multiple events occurring almost simultaneously.  A positive crossing event will not reset until the error function again exceeds the event tolerance.  In other words, a zero crossing event has a dead zone after the event triggers and multiple zero crossings that occur within the tolerance will not be detected.  Properly written state events do not have this dead zone.



Re: Re: EjsS 5.2 seems to have difficulty handling simultaneous events. - August 11 2016 1:41
Stephen Salser
8 Posts

Thank you so much for the insight.  I had some difficulty understanding the wording in the manual, but now it makes much more sense.



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book