confusing ode suits for solving discontinuous odes
9 views (last 30 days)
Hi all! when I use ode suits with event option to deal with the problem about discontinuous odes, here is a ball bouncing on the ground, why are the points of the solution not evenly distributed.
Below is my code.
y0 = [1;0];
Mischa Kim on 15 Jan 2021
Edited: Mischa Kim on 15 Jan 2021
Hi, this is because the integrator, ode45, adjusts the integration step size. Broadly speaking where the dynamics is more complex the integrator typically decreases the step size (e.g. when the ball hits the ground), when the dynamics is less complex the integrator tries to increase step size and thereby reduce compute time. See the documentation here for more information. If equally spaced data points are important to you, you can adjust the tspan vector accordingly.