Using local solvers in Simulink

I am trying to use multiple solvers in Simulink, I use model referencing but it seems like simulink only allows to change the solvers of the top model and not the referenced models.
Does anybody know a way to use local solvers for each model reference ?
thank you for your time

Answers (3)

Sebastian Castro
Sebastian Castro on 6 Oct 2015
You should be able to go into each of those models and access their configuration parameters separately. Is that not working? If so, why not?
- Sebastian
Walten
Walten on 6 Oct 2015
Edited: Walten on 6 Oct 2015
Thank you for answering, I need to test your answer but I only will be able to do so at the end of the week. If i remember correctly when i tried to do this I had to use the reference configuration of the top model for all models else it wouldnt work. Maybe i was wrong, I am new to Matlab and simulink. Would you please try to set individual configs for multiple model blocks, maybe I'm doing something wrong! The example that i want it to work on is this example : example Thank you for your time, Walten

1 Comment

Ah yes, in that case you're on the right track. When you're setting up models for concurrent execution, they all share the same reference configuration set. In this case, you don't set the sample time in the same way. You want to use the following menus:
- Sebastian

Sign in to comment.

Walten
Walten on 6 Oct 2015
Edited: Walten on 6 Oct 2015
thank you again for the fast reply, I'm doing research for my bachelor thesis and what i am trying to achieve is use multiple CPU in simulink: divide the simulink model using the model block in the parts that can be run in parallel and then assign each model block to a single task/CPU for computation.
I thought concurrent execution in simulink would allow me to do that, but it seems its only to simulate it on a target hardware (honestly i don't understand what it does exactly), but when i run the simulation it only uses 1 CPU. I read somewhere that in order for it to work i would have to use the realtime option and create executable files.
Do you maybe know if this is correct or if using multiple core just isnt achievable in the simulink graphical interface? I can do it with a matlab scipt but the whole point for me is to make it easy for a scientist with no programming language to do it inside simulink and focus on the experiment rather than coding the model.
Again thanks for your time and the fast reply

4 Comments

First off: Please respond using comments and not a new answer. It's difficult to keep track of.
Secondly: Yes, Simulink itself will not execute on multiple cores. You can set up this concurrent execution to simulate the effects of multiple cores, but the multicore execution itself won't happen until you generate code.
To get actual multicore performance, you can do one of two things:
  • Generate code from the configured model. This will give you a separate function for each different rate in the model. It is then up to you to use these generated functions and do the scheduling/multicore work yourself.
  • Use Simulink Real-Time on a multicore machine, which will automatically assign each task to a separate core.
- Sebastian
thank you again I have now time to test everything you suggested and will post the result i got. Thank you very much!
hi again, I did some research. I wanted to use the Real-time approach that you mentionned, but it seems that you can only use real time on a Target hardware and not your own PC, is this correct? If yes why isnt mathwork allowing me to use my own Cpu cores in parallel in a simple way, without programming knowledge?
I have a problem choosing the type of solver in Simulink. Whenever I want to run the model does not work and ask me to change the type and variables of solver or ode and I have other frequently without reaching the solution please help

Sign in to comment.

Categories

Products

Asked:

on 14 Sep 2015

Commented:

on 7 Oct 2018

Community Treasure Hunt

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

Start Hunting!