# Solving static flow networks in Simulink: Usual approach?

For anyone with experience with Simulink...
Bit of preamble here, question is at the end. I'm assisting a colleague who
is following the instructions in an old report he's unearthed, to model a noncompressible flow network (liquids in pipes and valves) using Simulink. The method involves introducing 'artificial' compressibility at the network nodes, so that the pressure balance can be calculated using ODEs, ie.
PressureAtNode = integral (flow in - flow out).
The model is taking forever to run, presumably because the amount of compressible material is kept small so that nonexistent dynamics isn't added to the model, this means that the equations are very stiff, and the solver needs to work with extremely small time increments.
My own approach in this situation is simply to calculate the system pressures and flows statically, that's usually pretty easy, just a nonlinear version of ohms law. The resultant models are efficient, and run very fast.
Is there something in Simulink that makes solving the flow network using background integrators the preferred approach? Or would one normally do something a bit more (IMHO) sensible, and do a static solution?
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On Fri, 15 Mar 2013 16:55:42 +0800, Bruce Varley wrote:

I gave up on Simulink a long time ago, because the unwieldiness of your model grows faster with a graphic-based system than with a text-based system, and because it seems that no sooner do you get a model working than they "improve" things and break it.
But if I recall correctly, Simulink does not handle algebraic loops well. My guess is that the method of using artificial compressibility and ODE's is to make the thing work at all under Simulink.
When you're simulating ODE's with Simulink (or anything else, for that matter), the algorithm you choose has a pretty significant effect on both speed and accuracy. I don't know if there's a better way, but any time I doubt the algorithm, or am just having frustrating or oddball problems, I try different algorithms either until I'm happy or I've convinced myself that joy is not to be found.
--
Tim Wescott
Control system and signal processing consulting
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Yep, confirms what I suspected. I have a real problem with introducing dynamics into models just so they'll solve, it hazards fidelity. In the report I mentioned, the actual system is incompressible and static, but the model responses are all perfect exponentials, guess where they come from.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
wrote:

If you're running a simulation just to find a steady state solution, you might try using the TRIM function.
If you're having problems getting an algebraic loop to converge, you can try setting intitial conditons with the IC block.
dave y.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

## Site Timeline

• ### 6th International Conference on Control, Modeling and Computing (CMC 2020) -Ju...

• - newest thread in ⧑ Industrial Control Group
• ### Worse Than Not Having Prices - Misleading and Fraudulent Website IMO

• - the site's last updated thread. Posted in ⏣ General Metalworking
• Share To

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.