Question

Is there a way to create an input/output port in Simulink (some workaround)? The port would be a bus and some signals are set from outside the block while some signals are set by the block. Here is an example:

Given the following bus:

Flow (scalar)
Composition (vector)
Enthalpy (scalar)

I would like Flow to be set from outside the block (there's a pump downstream which sets this value). Composition and Enthalpy are computed by the block.

My solution so far: Make Flow an input into the block and with direct feedthrough set it on the outport. I don't find this solution intuitive because from a graphical point of view the outflow becomes an input into the block (which is true from a math point of view - but I would like to make the Simulink diagram intuitive). I've seen in Modelica the possiblity to create input/output ports (RealPort) and the signal could be read or written by the block. I would need such a feature in Simulink.

Was it helpful?

Solution

It sounds like you need to use Simscape and SimHydraulics, which do excatly what Modelica does, but within Simulink. Each physical domain is represented with through and across variables, which are flow rate and pressure for the hydraulic domain. However, that's extra $$/££/€€ and a new modelling paradigm (you don't think in terms of inputs and outputs anymore)...

If you stay with Simulink blocks, there isn't much else you can do above what you've already done, although I assume you mean the flow is set on the input, not the output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top