- It is possible. Use add_block() to construct the blocks, but repeating 100 times in one model doesn't sound reasonable.
- Because these elements are connected in series, "For Each Subsystem" block can't be used.
- For your problem, it sounds like Finite Element Analysis. Refer to this article
- https://www.mathworks.com/discovery/finite-element-analysis.html
How can I assamble n identical blocks in a simscape simulation automathically?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ANTÓN
am 15 Dez. 2023
Bearbeitet: Yifeng Tang
am 10 Jan. 2024
Hello,
I am trying to simulate the thermal behaviour of a pipe with high resolution detail, and as such I want to divide my pipe in n segments and simulate the heat transfer through the wall of each segment separately. I tried to use Pipe(TL) from SimscapeFluids_lib/Thermal Liquid/Pipes & Fittings but only one temperature output is available. I tried to modify the code of this element but could not get it.
I decided then to create a new block with a pipe Pipe (TL) from fl_lib/Thermal Liquid/Elements adding all insulation layers and then put n of those elements in series to do the simulations. I would like to know if its possible to do this through code, since n could easily reach values of 100 or so. I've browsed through the documentation but found no reference to this.
The idea is to simulate somthing like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569882/image.png)
With n elements like these emulating the pipe:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569887/image.png)
Thank you.
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 15 Dez. 2023
Weitere Antworten (1)
Yifeng Tang
am 2 Jan. 2024
In addition to @Fangjun Jiang's suggestion on add_block(), I would encourage you to also look into the "composite component" option in Simscape language. You may add multiple simscape blocks and connect them programmatically, and they can appear to be one single Simscape block. You can use for loops to add many components, and use "component array" to make thing manageable.
More details:
2 Kommentare
Yifeng Tang
am 10 Jan. 2024
Bearbeitet: Yifeng Tang
am 10 Jan. 2024
As you start on this route, check out the subsystem2ssc function as well. It builds a composite component from a subsystem model, which can help you start with a template and save some time.
Siehe auch
Kategorien
Mehr zu Foundation and Custom Domains finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!