Passing objects in Simulink

조회 수: 9 (최근 30일)
Pim Nederstigt
Pim Nederstigt 2015년 3월 15일
댓글: Pim Nederstigt 2015년 4월 16일
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

답변 (1개)

Ganesh Gaonkar
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 .
  댓글 수: 1
Pim Nederstigt
Pim Nederstigt 2015년 4월 16일
Dear Ganesh,
Firstly thank you for your reply.
I've been intensively looking into system objects lately, and I'm making some real progress. Though, there is one thing that I can't get quite done.
Let's say that a thermodynamic library is called by various Simulink System Blocks during simulation. I've defined an other system object within the MATLAB workspace which contains the settings for this library to be used during simulation. This way, if required, one can change the thermodynamic library to be used without redefining separate parameters within each of the Simulink blocks.
You mentioned that a system object (in simulink?) supports having one system object (from the workspace) as private or public property (which is exactly what I would like to have at this point).
Though, I cannot quite get this to work. How would one implement this sort of thing?
Kind regards, Pim

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Thermodynamics and Heat Transfer에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by