2
votes

In dymola, when debugging the nonlinear equation set, there is some information about the solving process like the following, I could see that it is using Newton iteration method, but I don't understand every detail. So I am looking for some material online to show the detailed process about Newton method used in dymola, could anyone give me a recommendation?

singularPressureLoss3.C1.h_vol = 208022
singularPressureLoss3.C2.h_vol = 208022
CondensatePump.h = 207466
singularPressureLoss3.Pm = 811678
singularPressureLoss2.Pm = 811678
nTUWaterHeating1.Ee.P = 1.96559E+06
CondensatePump.Qv = 0.28517
nTUWaterHeating3.Se.h_vol = 380000
nTUWaterHeating1.Ee.h_vol = 380000
nTUWaterHeating1.Se.h_vol = 515000
Dp_Cond_5.Pm = 2.303E+06
CondensatePump1.C2.h_vol = 150161
Drum_2.Cs2.h = 740000
nTUWaterHeating4.HDesF = 621664
nTUWaterHeating4.HeiF = 520603
CondensatePump1.Qv = 0.321957
nTUWaterHeating4.Hep = 654967
nTUWaterHeating4.h = 402000
Drum_2.h = 713039
VolumeCond5.h = 3.154E+06
Condenser.prod.d = 988.273
nTUWaterHeating3.promeF.d = 978.574
nTUWaterHeating1.promeF.d = 953.838
nTUWaterHeating2.promeF.d = 929.357
CondensatePump.pro.d = 988.642
CondensatePump1.pro.d = 903.437
Residual:
{ 2.30783E+06, -0, -0, -2.30783E+06, 0,
  -0, -1.15374E+06, 2.91038E-11, -2.91038E-11, 7.84689E+06,
  0, 0, -26960.5, -622211, -322636,
  -2.93613E+07, 18180, 7.32352E+07, -2983.59, -6000,
  0, 1001.68, -0.700874, -0.772015, -0.0825135,
  5.4358 }

Jacobian element(1 singularPressureLoss3.C1.h_vol,2)= is 0 [analytic] or -1 [sum=0]
Jacobian element(1 singularPressureLoss3.C1.h_vol,8)= is 0 [analytic] or -2 [sum=0]
Jacobian element(1 singularPressureLoss3.C1.h_vol,9)= is 0 [analytic] or 1 [sum=0]
Jacobian element(1 singularPressureLoss3.C1.h_vol,21)= is 0 [analytic] or -0.000107159 [sum=0]
Jacobian element(1 singularPressureLoss3.C1.h_vol,22)= is 0 [analytic] or -3.92884e-05 [sum=0]
Jacobian element(2 singularPressureLoss3.C2.h_vol,2)= is 0 [analytic] or 1 [sum=0]
Jacobian element(3 CondensatePump.h,8)= is 0 [analytic] or 2 [sum=0]
Jacobian element(3 CondensatePump.h,9)= is 0 [analytic] or -2 [sum=0]
Jacobian element(3 CondensatePump.h,21)= is 0 [analytic] or 0.000214318 [sum=0]
Jacobian element(3 CondensatePump.h,25)= is 0 [analytic] or 0.000107132 [sum=0]
Jacobian element(4 singularPressureLoss3.Pm,1)= is 0 [analytic] or 2 [sum=0]
Jacobian element(4 singularPressureLoss3.Pm,7)= is 0 [analytic] or -2 [sum=0]
Jacobian element(4 singularPressureLoss3.Pm,25)= is 0 [analytic] or -5.27295e-07 [sum=0]
Jacobian element(5 singularPressureLoss2.Pm,1)= is 0 [analytic] or -4 [sum=0]
Jacobian element(5 singularPressureLoss2.Pm,4)= is 0 [analytic] or 2 [sum=0]
Jacobian element(5 singularPressureLoss2.Pm,7)= is 0 [analytic] or 2 [sum=0]
Jacobian element(5 singularPressureLoss2.Pm,22)= is 0 [analytic] or -0.000135014 [sum=0]
Jacobian element(5 singularPressureLoss2.Pm,25)= is 0 [analytic] or 5.27304e-07 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,1)= is 0 [analytic] or 2 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,4)= is 0 [analytic] or -2 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,7)= is 0 [analytic] or -1 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,19)= is 0 [analytic] or 3.53142e-05 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,22)= is 0 [analytic] or 6.75072e-05 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,23)= is 0 [analytic] or -6.06325e-07 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,24)= is 0 [analytic] or -6.67641e-07 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,25)= is 0 [analytic] or -2.63641e-07 [sum=0]
Jacobian element(6 nTUWaterHeating1.Ee.P,26)= is 0 [analytic] or -7.46357e-07 [sum=0]
Jacobian element(7 CondensatePump.Qv,1)= is 0 [analytic] or -0.0625 [sum=0]
Jacobian element(7 CondensatePump.Qv,4)= is 0 [analytic] or -0.0625 [sum=0]
Jacobian element(7 CondensatePump.Qv,8)= is 0 [analytic] or -2264.25 [sum=0]
Jacobian element(7 CondensatePump.Qv,10)= is 0 [analytic] or 7.70543e+07 [sum=0]
Jacobian element(7 CondensatePump.Qv,16)= is 0 [analytic] or 5.34118e+08 [sum=0]
Jacobian element(7 CondensatePump.Qv,17)= is 0 [analytic] or 2.84024e+08 [sum=0]
Jacobian element(7 CondensatePump.Qv,18)= is 0 [analytic] or 5.74129e+07 [sum=0]
Jacobian element(7 CondensatePump.Qv,19)= is 0 [analytic] or -4.66146e+07 [sum=0]
Jacobian element(8 nTUWaterHeating3.Se.h_vol,5)= is 0 [analytic] or -1 [sum=0]
Jacobian element(9 nTUWaterHeating1.Ee.h_vol,3)= is 0 [analytic] or 1 [sum=0]
Jacobian element(10 nTUWaterHeating1.Se.h_vol,6)= is 0 [analytic] or 1 [sum=0]
Jacobian element(11 Dp_Cond_5.Pm,16)= is 0 [analytic] or 0.0132414 [sum=0]
Jacobian element(11 Dp_Cond_5.Pm,17)= is 0 [analytic] or 0.0132414 [sum=0]
Jacobian element(11 Dp_Cond_5.Pm,19)= is 0 [analytic] or -6.47926e-05 [sum=0]
Jacobian element(11 Dp_Cond_5.Pm,20)= is 0 [analytic] or -2 [sum=0]
Jacobian element(12 CondensatePump1.C2.h_vol,14)= is 0 [analytic] or 1 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,10)= is 0 [analytic] or 290.868 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,13)= is 0 [analytic] or -1 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,14)= is 0 [analytic] or -1 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,18)= is 0 [analytic] or 290.868 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,19)= is 0 [analytic] or -0.0636731 [sum=0]
Jacobian element(13 Drum_2.Cs2.h,26)= is 0 [analytic] or 0.000235521 [sum=0]
Jacobian element(14 nTUWaterHeating4.HDesF,15)= is 0 [analytic] or 1 [sum=0]
Jacobian element(14 nTUWaterHeating4.HDesF,16)= is 0 [analytic] or -290.868 [sum=0]
Jacobian element(15 nTUWaterHeating4.HeiF,16)= is 0 [analytic] or 290.868 [sum=0]
Jacobian element(15 nTUWaterHeating4.HeiF,18)= is 0 [analytic] or -290.868 [sum=0]
Jacobian element(16 CondensatePump1.Qv,12)= is 0 [analytic] or -903.437 [sum=0]
Jacobian element(16 CondensatePump1.Qv,14)= is 0 [analytic] or 50001.4 [sum=0]
Jacobian element(16 CondensatePump1.Qv,18)= is 0 [analytic] or -1.45438e+07 [sum=0]
Jacobian element(16 CondensatePump1.Qv,19)= is 0 [analytic] or 3183.75 [sum=0]
Jacobian element(16 CondensatePump1.Qv,26)= is 0 [analytic] or -5.88818 [sum=0]
Jacobian element(17 nTUWaterHeating4.Hep,17)= is 0 [analytic] or -0.0632785 [sum=0]
Jacobian element(17 nTUWaterHeating4.Hep,18)= is 0 [analytic] or -0.063278 [sum=0]
Jacobian element(17 nTUWaterHeating4.Hep,19)= is 0 [analytic] or -0.000239221 [sum=0]
Jacobian element(18 nTUWaterHeating4.h,16)= is 0 [analytic] or -0.0632792 [sum=0]
Jacobian element(19 Drum_2.h,10)= is 0 [analytic] or 0.0632784 [sum=0]
Jacobian element(19 Drum_2.h,13)= is 0 [analytic] or 1 [sum=0]
Jacobian element(19 Drum_2.h,18)= is 0 [analytic] or 0.0632784 [sum=0]
Jacobian element(19 Drum_2.h,19)= is 0 [analytic] or 0.0627446 [sum=0]
Jacobian element(20 VolumeCond5.h,10)= is 0 [analytic] or -9 [sum=0]
Jacobian element(20 VolumeCond5.h,11)= is 0 [analytic] or 290.8 [sum=0]
Jacobian element(21 Condenser.prod.d,7)= is 0 [analytic] or 14.71 [sum=0]
Jacobian element(21 Condenser.prod.d,21)= is 0 [analytic] or 0.999992 [sum=0]
Jacobian element(21 Condenser.prod.d,25)= is 0 [analytic] or -3.8835e-06 [sum=0]
Jacobian element(22 nTUWaterHeating3.promeF.d,22)= is 0 [analytic] or 1 [sum=0]
Jacobian element(23 nTUWaterHeating1.promeF.d,23)= is 0 [analytic] or 1 [sum=0]
Jacobian element(24 nTUWaterHeating2.promeF.d,24)= is 0 [analytic] or 1 [sum=0]
Jacobian element(25 CondensatePump.pro.d,1)= is 0 [analytic] or -3.13126e-05 [sum=0]
Jacobian element(25 CondensatePump.pro.d,4)= is 0 [analytic] or -3.13126e-05 [sum=0]
Jacobian element(25 CondensatePump.pro.d,7)= is 0 [analytic] or 794.339 [sum=0]
Jacobian element(25 CondensatePump.pro.d,10)= is 0 [analytic] or 22226 [sum=0]
Jacobian element(25 CondensatePump.pro.d,16)= is 0 [analytic] or 154064 [sum=0]
Jacobian element(25 CondensatePump.pro.d,17)= is 0 [analytic] or 81925.8 [sum=0]
Jacobian element(25 CondensatePump.pro.d,18)= is 0 [analytic] or 16560.5 [sum=0]
Jacobian element(25 CondensatePump.pro.d,19)= is 0 [analytic] or -13445.8 [sum=0]
Jacobian element(25 CondensatePump.pro.d,25)= is 0 [analytic] or 1 [sum=0]
Jacobian element(26 CondensatePump1.pro.d,12)= is 0 [analytic] or -0.321957 [sum=0]
Jacobian element(26 CondensatePump1.pro.d,19)= is 0 [analytic] or 0.87266 [sum=0]
Jacobian element(26 CondensatePump1.pro.d,26)= is 0 [analytic] or 0.990778 [sum=0]
Residual scale row 1, J_sum=9.60125e+06
Residual scale row 2, J_sum=416046
Residual scale row 3, J_sum=380001
Residual scale row 4, J_sum=5.95454e+06
Residual scale row 5, J_sum=380001
Residual scale row 6, J_sum=515001
Residual scale row 7, J_sum=7.31959e+06
Residual scale row 8, J_sum=833890
Residual scale row 9, J_sum=622957
Residual scale row 10, J_sum=3.86857e+08
Residual scale row 11, J_sum=9.17183e+08
Residual scale row 12, J_sum=1806.49
Residual scale row 13, J_sum=1.45304e+06
Residual scale row 14, J_sum=956263
Residual scale row 15, J_sum=621665
Residual scale row 16, J_sum=1.32481e+09
Residual scale row 17, J_sum=5.2785e+08
Residual scale row 18, J_sum=4.92668e+08
Residual scale row 19, J_sum=8.67177e+07
Residual scale row 20, J_sum=4.806e+06
Residual scale row 21, J_sum=2053.01
Residual scale row 22, J_sum=2247.28
Residual scale row 23, J_sum=1953.09
Residual scale row 24, J_sum=1928.74
Residual scale row 25, J_sum=2010.38
Residual scale row 26, J_sum=2067.51
The non-linear system is difficult to solve, this could either be
due to a dependency between equations, or due to bad start-values.
Variable 17(nTUWaterHeating4.Hep)=654967 has small pivot 8.67901e-11 and is hard to solve,
Variable 18(nTUWaterHeating4.h)=402000 has small pivot 3.89036e-11 and is hard to solve.
Condition estimate of Jacobian matrix 22908577406.43897
Expression nTUWaterHeating4.Ev.Q > 0 became true ( (nTUWaterHeating4.Ev.Q)-(0) = 4.93669 )
Expression Drum_2.Ce1.Q > 0 became true ( (Drum_2.Ce1.Q)-(0) = 4.93669 )
Error: The following error was detected at time: 0
  Water_Ph: Incorrect region number (-1)
  Failed condition: false
1

1 Answers

1
votes

If you can generate C-Code from your Dymola model (provided you have a SourCodeExport license) you can view the details of the implementation and reference to literature in the code by inspecting dsmodel.c

If you do not have a license, you can inspect the code by looking ot dsmodel.c in one of the provided source code FMUs from Dassault in the FMI Cross-Check, see e.g. https://github.com/modelica/fmi-cross-check/blob/master/fmus/2.0/me/c-code/Dymola/2019FD01/Engine1b/Engine1b.fmu (the FMU is a zip-File, see ./sources/dsmodel.c)