File Exchange

image thumbnail

Bouncing-Ball: Tutorial for ode45 events.

version 1.4.0.0 (105 KB) by Matthew Kelly
Tutorial for event detection in Matlab - simulation of ball bouncing over hilly terrain.

22 Downloads

Updated 22 Aug 2017

GitHub view license on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Simulation of a ball bouncing over hilly terrain in 2D. Designed as a tutorial for event detection in Matlab.

Cite As

Matthew Kelly (2019). Bouncing-Ball: Tutorial for ode45 events. (https://www.github.com/MatthewPeterKelly/Bouncing_Ball_Matlab), GitHub. Retrieved .

Comments and Ratings (7)

E. Cheynet

Hi Mohamed, the code for the interactive graphics was written by Jira Doke at Mathworks, which he provides in the comments on the bottom of Pick of the Week page:
http://blogs.mathworks.com/pick/2016/03/04/bouncing-ball-animation-using-events-with-ode/

Is it possible to send me the updated code with the interactive part demonstrated in the video here http://blogs.mathworks.com/pick/2016/03/04/bouncing-ball-animation-using-events-with-ode/?

My email is moh_hesh@hotmail.com
Thank you, much appreciated!

Thanks! I made the ground a set of smooth analytic functions so that the root-solving in the event detection would behave nicely, and so I didn't have to worry about the domain of the function. That being said, as long as ground height is a valid smooth function it the code should run fine.

I could imagine a new implementation of the groundHeight() function that uses a cubic spline to interpolate a set of discrete data, rather than using sine waves. I don't have time to code it up now, but I'm happy to look at pull requests to the GitHub repo if you end up adding that feature.

Zhehua

Excellent! Why not update the function 'groundHeight' so that you can deal with discrete data of ground?(I'm looking forward to an 'interpolation' of every kind of ground :D).

LY Cao

Matthew Sheen

Updates

1.4.0.0

still playing with the photo...

1.3.0.0

still playing with matlab's automatic cropping of the upload image...

1.2.0.0

made file name better. Added photo.

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux