[Simscape] Are there ways to build segmented/discretised models with n as a block/mask parameter

1 次查看(过去 30 天)
Hello everyone, we are working a lot with Simscape's thermal liquid domain and pipe models. Often, we discretise pipes in 5 to 100 segements (some kind of mixing pot model), but have to manually build up all variants.
We'd appreciate an otion, to build up a model and repeat certain parts via mask parameters. E.g. take standard pipe, enter length 10 m and n=5, another one shall be 80 m an n=20 --> similar to Modelica world.
We'd like to avoid building custom domains or coding in general, since most of our library components are entirely built from foundation library.

采纳的回答

Sebastian Castro
Sebastian Castro 2015-10-13
编辑:Sebastian Castro 2015-12-25
I've personally done this with the new Two-Phase Fluid domain in Simscape, which is basically the same thing.
To make a long story short, you have to program it yourself. The general workflow is:
  1. Create a masked subsystem where the number of segments N is a parameter.
  2. Whenever N changes, you need to run a script in the mask's initialization commands that modifies the inside of the block.
  3. You should first decide which blocks comprise your "segment". For example, the simplest case would be to connect Pipe (TL) blocks in series.
  4. In the MATLAB script, you'd have to come up with a way to connect N number of blocks together. To do this, functions like add_block, add_line, and get_param / set_param will be crucial.
I know you said you didn't want any coding, but that would be the way to go in Simscape. Happy to help if you want to further pursue this approach.
- Sebastian
  1 个评论
Andreas
Andreas 2015-10-15
Hi Sebastian,
thanks for your answer - I thought it would get that complicated.
At first, we will keep our current library (multiple versions with different discretisation numbers, switching blocks via "configurable subsystem"), but maybe we'll go to your workflow in future.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Foundation and Custom Domains 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by