How do I run parallel dependent loops?
Show older comments
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 Comments
José-Luis
on 20 May 2013
What does your code look like? Could you give an example? How do you intend to perform parallelization of the tasks?
Rushikesh Kamalapurkar
on 23 May 2013
Answers (1)
Walter Roberson
on 20 May 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.
1 Comment
Rushikesh Kamalapurkar
on 20 May 2013
Categories
Find more on Linear Model Identification 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!