Why should I use operation blocks instead of a quicker function block in simulink?
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
- I am newbie with this, I´m just testing with the simulink features and when trying to make some operations , find it more difficult to use simple operation blocks instead of a simulink function block which could encompass all this with code and gives me straight away the output, any drawback in doing so? Btw ,i am doing just a differential equation which could be done with matlab too, and the same question regarding to matlab, why using operation blocks instead some code? . My final aim is to simulate a 3 in series reactors and then a distillation column and thats a bunch of differential equations with simple operations ,so whats is more convenient for that?. Thanks in advance.
- Drop some pics of what i am adressing to:
- Could use function blocks, but what is the negative side of doing this?
- Instead of that i find cumbersome:
0 commentaires
Réponses (1)
Jim Riggs
le 10 Nov 2022
It references some limitations on Matlab function blocks being able to represent model states. In particular, the Matlab function is only able to model discrete states (using persistent variables) - i.e. no continuous states. This is because callback methods are not allowed (see the link, above)
I tried both of your model architectures, and my experience is that the one using the Matlab function block runs much slower - it takes almost double the time that the first one does. ( ~0.5 seconds compared to 0.28 seconds).
0 commentaires
Voir également
Catégories
En savoir plus sur General Applications dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!