From: li min on
Hi,
My question is how to define a segmented pipeline block with simscape language in Pneumatic domain ?
You know the number of segments used is variable and depends on the user input so the number of equations and variables is variable. How can I deal with it ? Can I use matrix or arrays with variable dimensions in simscape language? such as Array[n] , n equals the number of the segments.

Best wishes,

li min
From: li min on
Does anyone has a good idea?

"li min" <limingph(a)gmail.com> wrote in message <ho05dk$egf$1(a)fred.mathworks.com>...
> Hi,
> My question is how to define a segmented pipeline block with simscape language in Pneumatic domain ?
> You know the number of segments used is variable and depends on the user input so the number of equations and variables is variable. How can I deal with it ? Can I use matrix or arrays with variable dimensions in simscape language? such as Array[n] , n equals the number of the segments.
>
> Best wishes,
>
> li min
From: Arnaud Miege on
"li min" <limingph(a)gmail.com> wrote in message <ho05dk$egf$1(a)fred.mathworks.com>...
> Hi,
> My question is how to define a segmented pipeline block with simscape language in Pneumatic domain ?
> You know the number of segments used is variable and depends on the user input so the number of equations and variables is variable. How can I deal with it ? Can I use matrix or arrays with variable dimensions in simscape language? such as Array[n] , n equals the number of the segments.
>
> Best wishes,
>
> li min

You can't. If you look at the segmented pipeline in SimHydraulics, it is built using foundation blocks from the Simscape library:
http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/hydro/ref/segmentedpipeline.html

I would suggest you use the same approach and built your segmented pipeline model from scratch using the blocks in the foundation library, rather than the language. It might be possible to automate the model creation using things like add_line, add_block, etc... so that the user could specify the number of segments, but that's more involved. I would try manually first with a small number of segments, and make sure that's correct before trying to automate the process.

HTH,

Arnaud