I have been modelling and simulating a number of simple district heating networks in Dymola and am quite often faced with an error during initialisation.
The system we are simulating consists of
The figure below is a heavily simplified version of the network (same error occuring here)
The consumer model looks as follows:
And the producer:

During initialisation, the following error occurs:
ERROR: Failed to solve non-linear system using Newton solver.
To get more information: Turn on Simulation/Setup/Debug/Nonlinear solver diagnostics/Details
Solution to systems of equations not found at time = 0
Nonlinear system of equations number = 3
Infinity-norm of residue = 118280
Iteration is not making good progress.
Accumulated number of residue calc.: 389
Accumulated number of symbolic Jacobian calc.: 5
Last values of solution vector:
L.PI.gainPID.y = 0
Last values of residual vector:
{ -118280 }
Trying to solve non-linear system using global homotopy-method.
... loading "data" from "C:/Users/Sim1/Desktop/Keith Dymola Files/GrazReininghaus_UseCase/PythonScriptsforTranslation/Reininghaus.txt"
ERROR: Failed to solve non-linear system using Newton solver.
To get more information: Turn on Simulation/Setup/Debug/Nonlinear solver diagnostics/Details
Solution to systems of equations not found at time = 0
Nonlinear system of equations number = 1
Infinity-norm of residue = 2.22814E+018
Iteration is not making good progress.
Accumulated number of residue calc.: 101
Accumulated number of symbolic Jacobian calc.: 9
Last values of solution vector:
M.port_a.m_flow = 0.000485868
N.valveLinear.dp = -55.8243
O.valveLinear.dp = -135.618
P.valveLinear.dp = 550.474
I.port_a.m_flow = 3.20321E-010
C.port_a.m_flow = 2.19343E-011
D.port_a.m_flow = 0.00208272
E.valveLinear.dp = 371.552
L.port_a.m_flow = -7.10982E-012
J.valveLinear.dp = 243.085
K.port_a.m_flow = 1.924E-005
Last values of residual vector:
{ 6.60393E+013, -1.14781E+018, -1.05438E+018, -2.58754E+016, -111988,
-1.56817E+010, 16024.9, 3.14411E+007, 3.99781E+008, 3.14412E+007,
-15012.9 }
Error: could not solve simplified initialization for homotopy method.
Error: could not solve simplified initialization for homotopy method.
FixInitials:Init
The components A,B,C e.t.c are the consumers in the network. I am using the Radau IIa 5th order solver with tol=1e-06. The PI controller in the consumer valves inittype is to integrate only with integrtor state and the PI in the producer is initialised with an output value. I have tried playing around with all sorts of nominal values for mass flows and pressure drops in the network, a well as initial values in the PI controllerrs but the same form ERROR is always returned. The model passes the error check but always fails at initialisation.
I would like to know if anybody has had experience in debugging such nonlinear systems, and if so, a few tips in how to initialise these models would be a great help with the debugging process.
Ok so for anybody who is interested, I managed to simulate my network in the end. It turns out the initialisation problem was arising in the "first order" block within the consumer which takes the measured heat flow signal in the heat exchanger and passes it to the PI. The default init type for this component was "noinit", however by changing it to take in an initial guess value (nominal consumer load worked in this case), the initialisation sections passed. I guess this problem occured in this example as my consumer nominal loads were quite a bit higher than in previous examples and therefore the initial value was outside of the suitable range without specifying it manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With