How do I run parallel dependent loops?
Afficher commentaires plus anciens
I have a simulation that has two parts. A control loop and an identification loop. The control loop runs at a high sampling rate. The identification loop is computationally intensive. The information generated by the identification loop is helpful but not necessary for the control loop to run.
Ideally, I would like to have a simulation where the identification loop sends information to the control loop whenever its done computing. The control loop uses whichever latest identification information it has.
Is there a way I can do this?
2 commentaires
José-Luis
le 20 Mai 2013
What does your code look like? Could you give an example? How do you intend to perform parallelization of the tasks?
Rushikesh Kamalapurkar
le 23 Mai 2013
Réponses (1)
Walter Roberson
le 20 Mai 2013
1 vote
If you were to use smpd then you could use labsend() to send values from the identification worker to the control worker.
The traditional structure would be to construct the control loop as a BytesAvailableFcn callback or timer callback (as appropriate) that would interrupt the main computation as necessary, and would draw upon the current values of variables stored by the identification loop. You would, I figure, need at least two buffers of the variables, one being read from and one being written to.
Catégories
En savoir plus sur Linear Model Identification dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!