|
I am modeling a box falling down to the ground, hitting the ground, and bouncing back up. I am using the events function with a ode15s solver to analyze the problem.
I use the event function to detect the moment the box hits the ground. When contact (i.e. height above the ground is zero), I switch to a different function to calculate the velocities after impact. I'm basically following the ballode example.
Everything works fine when the box is horizontal and falls flat on the ground. However, if I drop the box at a angle (i.e. tilted 30 deg), things don't work so well. I can detect the first impact, which occurs on the front of the box first since it's tilted in that direction. The box hits the ground, bounces back up, and also rotates just like it should. However, when it's time for the other side of the box to hit the ground due to rotation, it just goes right through the floor. The events function is unable to detect the impact!
I'm guessing the box is rotating too fast and I'm basically skipping over the time step in which the height of the back corners is zero. I tried reducing the time step to detect the second collision but it doesn't work. The thing is that I also don't want to use a very small time step for the entire simulation because I'm also making a movie of the simulation. I don't want it to go into slow motion after the collision. Does anyone know how to fix this problem without messing with the video?
|