Evolving 'Aggregate Equivalent Length of local resistances' within a simulation?
4 views (last 30 days)
I'm currently modelling a hydraulic system that accounts for pressure loss. Thus I wanted to use segmented Pipes LP and especially the input "aggregate equivalent length of local résistances". With my associated Matlab code, i managed to set this input to reflect the reality of my system on stationnary situations. However, my objective now is to build a model effective in Transitional mode. To achieve that, I set the previously mentionned parameter as a formula, using other variables that evolve within the simulation.
As I didn't manage to input variables i created in other parts of my Simscape model in the formula, I decided to build them into my Matlab Workspace with a To Workspace block, in order to use them in my simulation when I run it. The problem I'm faced with, is that now my Segmented Pipes block recognize these variables, but don't accept Timeseries data in the 'Aggregate Equivalent Length of local resistances' parameter.
Can we input in a block parameter a variable created on Simscape rather than sending it to the workspace to re-use it? Or can we set these variables in a way they can be implemented in the 'Aggregate Equivalent Length of local resistances' parameter while still evolving during the simulation?
I don't know if my explanations are clear enough for you to understand my problem.
Yifeng Tang on 5 Oct 2022
Since you have access to the Simscape code of this block, you may make the 'Aggregate Equivalent Length of local resistances' not a parameter but an input. As such, it can be a function of time, or calculated from quantities like flow rate or temperature.
Some Documentation pages on component customization that may be useful: