When is subsystem reference a better choice than model reference?

조회 수: 366 (최근 30일)
svanimisetti
svanimisetti 2021년 2월 20일
댓글: Walter Roberson 2024년 8월 20일
I am trying to understand the difference between "model reference" and "subsystem reference". I came across this documentation page, but no matter how many use-cases I reviewed, I never seem to end up with a "subsystem reference". From the flow chart shown in that page, the only way conclude with "subsystem reference" is when the block does not have a defined interface, or is not re-used or does not change. These are the antithesis of arguments for any creating any type of subsystems. Can someone comment on practical situations when a "subsystem reference" will be useful over "model reference"? Are there computational costs associated with "model reference"? I am inclined to believe that in practical cases in the industry, "subsystem references" are rarely used.

채택된 답변

Jonas
Jonas 2021년 2월 22일
편집: Jonas 2021년 2월 22일
Subsystem References is new functionality to Simulink, it is only supported since R2019b. So industry will only slowly evolve to using the functionality.
I will try to explain use-cases for using Subsystem Reference, and contrast it with Model Reference. Both are saved into their own .slx file, and are referenced by a parent model. The difference is that with Model Reference, the signal interfaces are fixed, such as data types and signal dimensions. With a Subsystem Reference, these interfaces do not need to be fixed. Look at this documentation page. You can use a Subsystem Reference in multiple instances where one instance receives a scalar while another instance receives a vector signal. This is similar to using a library block: the same library block can be used for different instances with different signal dimensions or data types. A Model Reference only accepts signals of a fixed data type and dimensions.
Besides this, a Model Reference can have its own Configuration Parameters and Model Workspace, while a Subsystem does not have it and inherits this from the parent model.
I would say that a Subsystem Reference is more closely related to a library subsystem, with the advantage that:
  • The subsystem is inside its own .slx file, which can be versioned through GIT. This means a different team member can develop this subsystem reference inside the .slx file without disturbing other systems. If you do this with a library, the whole library will be affected.
  • A subsystem reference can be tested and developed inside a harness.
In a model-based design project, I would say typically a Model Reference is used for:
  • A controller
  • A plant model
which are then referenced in harnesses for:
  • Code generation
  • Real-time prototyping
  • Simulation
while Subsystem References are used for:
  • Speed controller subsystem inside the controller
  • Position estimator subsystem inside the controller
  • ...
  • Induction motor model inside the plant model
  • Synchronous motor model inside the plant model
  • ...
This link also provides a comparison overview.
  댓글 수: 7
wu lei
wu lei 2023년 6월 7일
@Jonasthank you very much for your help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by