How can I generate a reference model from a model built with Simscape blocks?
Show older comments
I have a subsystem built with Simscape blocks (electrical and thermal components). I need to create a protected model of this such subsystem. The process that I am following is:
- Treat the subsystem like an atomic unit
- Generate a Reference Model
- Convert Reference Model into protected model
However when I tried to convert the subsystem in a reference model I got the following message: The selected subsystem exposes Simscape connection ports, which model reference does not support. To reference a Simscape physical model, ensure it exists entirely within a single subsystem.
In that sense, I would like to know if is there a particular procedure to convert a subsystem built with Simscape blocks into a Reference Model and then a protected model?
Thanks
Answers (1)
Sabin
on 21 Dec 2022
0 votes
An alternative solution would be to use subsystem2ssc function to generate a ssc file corresponding to your Simscape subsystem. Then you can use ssc_protect to generate a protected file. In this way you can share the generated sscp file and use it in a Simscape Component block. I hope this helps.
2 Comments
Doug Turner
on 16 Feb 2023
So... You are saying that there is no way to create a Simscape Reference model? I assume the only way to do it would be to convert every physical to a Simulink signal. At that point, a Reference model has been created. If you want to connect them, then one would have to convert Simulink back to a physical signal when jumping to another Reference model. Is this correct?
Daniel
on 29 Mar 2023
You can use the converters, however these will cost you significant simulation time. The best appoach is to use subsystem2ssc as mentioned. One that is that you will have an .ssc file which you can use anywhere, reference it anywhere you wish. With ssc_protect you will create a protected version of the .ssc file, which can also be used anywhere, however you will no longer be able to see the code. With these file you can have physical connections. However, there is a significant disadvantage which I have not yet solved - if your system contains any subsystems, a separate .ssc file will be created for each of your subsystems. It is very incovenient if you are trying to share a single protected file. If your model is simple enough then you can have only one subsystem which you protect.
Categories
Find more on Composite Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!