Passing objects in Simulink
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Ganesh Gaonkar
le 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 .
Voir également
Catégories
En savoir plus sur Gas Models dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!