confusing ode suits for solving discontinuous odes
조회 수: 10 (최근 30일)
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 2021년 1월 15일
편집: Mischa Kim 님. 2021년 1월 15일
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.