Search code examples
matlabdifferential-equationsode45

MatLab ode45 minimal time step


I'm trying to solve differential equations with MatLab and ode45 function. The question is how can I change minimal step size? I want to make it bigger to avoid too small steps. I'm tryin to do it like this:

tspan = [3, 4]; (boundaries of time line)
[t, q] = ode45('dqdt2', tspan, q0);
  • t - time
  • q - solution to find
  • dqdt2 - my file with function
  • q0 - initial conditions

Solution

  • You can't.

    In Matlab, variable step size solvers cannot be given a minimum step size, probably because it doesn't make all that much sense to do so. If you wish to reduce the accuracy of your solution in order to speed up the solution, increase RelTol and AbsTol. With increased tolerance, the solver will generally take larger steps but there will still be no specific minimum step size.