Is time linear inside an ode45 function?
1 view (last 30 days)
Show older comments
Is time within a function being solved using ode45 linear, or are time steps able to be repeated?
I am trying to control a stepper motor, but am noticing that one or two time steps will repeat every so often, causing my program to go crazy. For example, time will be linear (1,2,3,4), then it will go back a time step and repeat so that there are then 2 values for 3 and 4.
0 Comments
Accepted Answer
Stephen23
on 29 Jul 2018
Edited: Stephen23
on 29 Jul 2018
"Is time within a function being solved using ode45 linear"
Time is linear in the sense that the difference between 1 and 2 is the same as the difference between 2 and 3. But I suspect you are actually asking if the times where the ODE function is evaluated are linearly spaced, in which case the answer is "no": the time step size used for calculating the function changes with the behavior of the function (stiffness, etc) and the user/default options. These sample steps are definitely not linearly spaced!
"or are time steps able to be repeated?"
I don't see anything in the documentation that excludes that possibility.
0 Comments
More Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!