Updates state based on an event (collision).
(self, state)
| 38 | return self.t0, state |
| 39 | |
| 40 | def state_update(self, state): |
| 41 | """Updates state based on an event (collision).""" |
| 42 | pos, vel, log_radius = state |
| 43 | pos = ( |
| 44 | pos + 1e-7 |
| 45 | ) # need to add a small eps so as not to trigger the event function immediately. |
| 46 | vel = -vel * (1 - self.absorption) |
| 47 | return (pos, vel, log_radius) |
| 48 | |
| 49 | def get_collision_times(self, nbounces=1): |
| 50 |
no outgoing calls
no test coverage detected