MATLAB Answers

Unique Block Parameters for Multiple Instances of the Same Referenced Subsystem or Custom Library Subsystem?

조회 수: 14(최근 30일)
Jan Westman
Jan Westman 2021년 9월 25일 22:53
댓글: Jan Westman 2021년 9월 26일 18:17
Hi All,
I'm hoping to do some hierarchical modeling of power systems using Specialized Power Systems library. Unfortunately, it seems that physical signals (i.e. Simscape signals) cannot cross Referenced Model boundaries, so that leaves Referenced Subsystems or Custom Libraries (as far as I know). I know that you could use controlled V/I sources and V/I measurements to somewhat make conversions to Simulink signals, but I don't want to create algebraic loops or introduce delays to break them. My question is:
Is there a way to programmatically change and save the block parameters of a single instance of a Referenced Subsystem without updating all instances of the same Referenced Subsystem? For custom libraries: is there a way to do the same with an instance of a library subsystem without affecting the link to the library (as in preventing the need to restore the original block parameters or push an update to the library subsystem block parameters)?
I guess another way to say this: is there a way to create model block structure dependency without also creating model block parameter dependency?
My goal is to be able to develop a single model file (say for a battery energy storage system) and then place multiple instances of the model in the top level model and modify the block parameters to achieve different model output behavior (say energy storage capacities). Later, if a structural change was made to the model file (say a new control loop is added), then that would propagate to model instances.
I'd like to avoid creating separate Referenced Subsystems or separate Library Subsystems for each model with different block parameters if that's possible.
Thanks in advance!

채택된 답변

Paul
Paul 2021년 9월 26일 14:51
Parameterize Instances of a Reusable Referenced Model might be useful doc page, if I understand the question correctily.
  댓글 수: 4
Jan Westman
Jan Westman 2021년 9월 26일 18:17
I forgot that the mask parameters themselves can be named variables so I think you're right and a better approach would be to modify the dialog box parameters upon instantiation to reference different variables in a workspace.
To the point about Simscape to Simulink signal conversion - I should have been more specific. I seems that Specialized Power Systems (SPS) signals are treated differently than the base Simscape Electrical (SE) signals and so you would first need to convert from SPS to SE and then from SE to simulink. However, the SPS to SE conversion requires using low pass filtering to break the algebraic loop created by the blocks that you use to do that conversion: Current-Voltage Simscape Interface

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by