Real Time ODE Solver
Show older comments
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!
Answers (1)
Kaustubha Govind
on 9 Mar 2012
0 votes
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.
Categories
Find more on Model Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!