Why should I use operation blocks instead of a quicker function block in simulink?
조회 수: 17 (최근 30일)
이전 댓글 표시
- 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
답변 (1개)
Jim Riggs
2022년 11월 10일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!