Is time linear inside an ode45 function?

1 次查看(过去 30 天)
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.

采纳的回答

Stephen23
Stephen23 2018-7-29
编辑:Stephen23 2018-7-29
"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 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by