Passing objects in Simulink
조회 수: 9 (최근 30일)
이전 댓글 표시
Dear Matlab Community,
I've been struggling with this one for quite some time now, I would like to know if something like the following is possible in Simulink.
I'm building a model of a thermal power plant in Simulink. Currently, individual system components require as an input different signals for thermodynamic properties like pressure, temperature, flow rate, enthalpy, etc. For such an elaborate model, it's quite cumbersome to work with multiple input signals and to constantly use matlab functions to invoke third party thermodynamic libraries.
Lately I've been looking into matlab classes, and found that it might be usefull to assign the separate properties above (pressure, temperature, etc.) to a custom class and to put any thermodynamic relations in the methods of the class. This obviously works fine in the matlab workspace environment but, unfortunately, Simulink signals cannot not work with class objects.
I'm wondering if there is any way similar to do this: to pass single entities in simulink from component to component, containing both properties and methods relating the properties. To this purpose, I've been looking into creating custom System Objects and Data Classes, but have not been successful thus far. Am I searching in the right direction, or is there no way this could ever work?
Looking forward to any responses,
Kind regards, Pim
댓글 수: 0
답변 (1개)
Ganesh Gaonkar
2015년 3월 16일
I think you are searching in right direction. System object may be able to help your requirement as they also support having one system object as private or public property of another object as mentioned here . This way, you should be able to have your thermodynamic properties defined for different components across different object and should be able to access them .
참고 항목
카테고리
Help Center 및 File Exchange에서 Thermodynamics and Heat Transfer에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!