Thread Subject: detecting collisions with events function

Subject: detecting collisions with events function

From: ill will

Date: 8 Dec, 2008 16:34:02

Message: 1 of 1

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?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
events ill will 8 Dec, 2008 11:35:04
collision ill will 8 Dec, 2008 11:35:04
ballode ill will 8 Dec, 2008 11:35:04
detect ill will 8 Dec, 2008 11:35:04
ode15s ill will 8 Dec, 2008 11:35:04
rssFeed for this Thread

Contact us at files@mathworks.com