Passing objects in Simulink
9 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Ganesh Gaonkar
on 16 Mar 2015
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 .
See Also
Categories
Find more on Thermodynamics and Heat Transfer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!