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

1 view (last 30 days)
Jan Westman
Jan Westman on 25 Sep 2021
Commented: Jan Westman on 26 Sep 2021
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!

Accepted Answer

Paul on 26 Sep 2021
Parameterize Instances of a Reusable Referenced Model might be useful doc page, if I understand the question correctily.
Jan Westman
Jan Westman on 26 Sep 2021
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

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!