Real Time ODE Solver

5 次查看(过去 30 天)
Frank
Frank 2012-2-17
Hello to all,
I searched the community for this particular topic and got lost in seemingly "related issues but not quite the answer".
How can I model a set of differential equations in real-time in Matlab? With "real-time" I mean, how can I acertain that the solution values are displayed every 10 seconds in real life, for one integration step? A bit of background info: I want to model electrical components which feed into a grid simulation on a different computer. To make sure that the next simulation works, I have to make absolutely sure that values are provided by my equations every 10 seconds.
There seems to be a Simulink coder with this type of "real-time" functionality, but I was curious if there any alternatives. Is this Simulink coder the best and most accurate approach? Or should I try something simpler, like messing around with the system clock functions?
Thank you very much for your help!

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2012-3-9
None of the operating systems that MATLAB is supported on (Windows, Mac, Linux) are real-time operating systems, so there is no absolute guarantee that you will receive a value every 10 seconds, but if your equations are relatively quick and can be computed in well within 10 seconds, you can try the MATLAB Central submission: Simulink® Real Time Execution to slow down the execution of the Simulink engine to match that of the system clock. Again, remember that this does not give you a "hard" real-time system.
The usual products that we recommend for real-time processing of Simulink models are xPC Target and Real-Time Windows Target.

Community Treasure Hunt

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

Start Hunting!

Translated by