The only deterministic solution I found was to implement my own RK45 with adaptive stepsize. It is designed to take discrete and continuous systems (ode and difference equations) and solves with adaptive stepsize until a new sample has to be taken. This method works like a charm - with slow dynamics only the discrete points are sampled for sufficiently small sampling times and fast dynamics yield small integration stepsizes, as expected!
discrete and continuous system
9 次查看(过去 30 天)
显示 更早的评论
I want to simulate a dynamical system (using an ordinary differential equation) and a discrete recursive least squares algorithm. A sequential implementation is of no use, since i want the RLS values influencing the input of the system (adaptive control).
Using only matlab how is this situation best implemented? Since ode45 has an adaptive step-length I cannot be sure, if the discrete sampling points are exactly sampled by the solver. Is there any way how I can get by this? In simulink I know this it is possible to define cont. and disc. blocks, but how is this implemented? Without knowing what is happening I don't want to use this. Also I have my full framework built upon matlab only, so I'd rather not use simulink at all.
Things I've thought of:
Zero-Crossings/Events: as far as I can tell I cannot trigger a function, when a zero crossing occurs, right? I could only terminate the integration and start again afterwards.
Which is equivalent to integrate between time steps using odeXY, sample a step, integrate again,..
Thanks for any comments
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!