Opened 8 years ago

Last modified 8 years ago

#4222 accepted defect

Previously simulating models do not work any more

Reported by: Christian Kral <dr.christian.kral@…> Owned by: lochel
Priority: blocker Milestone: Future
Component: Initialization Version:
Keywords: PhotoVoltaics Cc:

Description

We are currently developing the PhotoVoltaics Modelica library on GitHub. Please consider https://github.com/christiankral/PhotoVoltaics/tree/c79bd0d93cfc9b5b2eae2a6f2ea991d781419195

The model PhotoVoltaics.Examples.SimpleModuleShadow was compiling in a previous model of the OpenModelcia but it does not work any more in the actual Nightly Build

OMEdit 1.12.0~dev-129-g0ee4ed0
Connected to OpenModelica 1.12.0~dev-242-g7d151a2
Linux Mint 18.1

The actual error message after compiling the model is

stdout | OMEditInfo | <p>/tmp/OpenModelica_christian/OMEdit/PhotoVoltaics.Examples.SimpleModuleShadow -port=46358 -logFormat=xmltcp -override=startTime=0,stopTime=1,stepSize=0.001,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=PhotoVoltaics.Examples.SimpleModuleShadow_res.mat -jacobian=coloredNumerical -w -lv=LOG_STATS</p>
LOG_NLS | warning | <p>nonlinear system 1329 fails: at t=0</p>
LOG_NLS_V | warning | <p>proper start-values for some of the following iteration variables might help</p>
LOG_NLS_V | warning | <p>[1] Real module.cell[46].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[2] Real module.cell[45].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[3] Real module.cell[44].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[4] Real module.cell[43].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[5] Real module.cell[42].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[6] Real module.cell[41].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[7] Real module.cell[40].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[8] Real module.cell[39].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[9] Real module.cell[38].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[10] Real module.cell[37].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[11] Real module.cell[36].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[12] Real module.cell[35].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[13] Real module.cell[34].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[14] Real module.cell[33].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[15] Real module.diode[3].v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[16] Real module.cell[31].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[17] Real module.cell[30].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[18] Real module.cell[29].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[19] Real module.cell[28].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[20] Real module.cell[27].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[21] Real module.cell[26].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[22] Real module.cell[25].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[23] Real module.cell[24].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[24] Real module.cell[23].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[25] Real module.cell[22].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[26] Real module.cell[21].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[27] Real module.cell[20].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[28] Real module.cell[19].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[29] Real module.cell[18].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[30] Real module.cell[17].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[31] Real module.cell[16].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[32] Real module.cell[15].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[33] Real module.cell[14].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[34] Real module.cell[13].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[35] Real module.cell[12].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[36] Real module.cell[11].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[37] Real module.cell[10].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[38] Real module.cell[9].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[39] Real module.cell[8].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[40] Real module.cell[7].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[41] Real module.cell[6].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[42] Real module.cell[5].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[43] Real module.cell[4].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[44] Real module.cell[3].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[45] Real module.cell[2].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[46] Real module.cell[1].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[47] Real module.cell[48].v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[48] Real module.diode[1].i(start=1e-11, nominal=1)</p>
LOG_NLS_V | warning | <p>[49] Real module.cell[1].diode.i(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[50] Real module.cell[37].diode.i(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[51] Real module.cell[22].diode.i(start=0, nominal=1)</p>
assert | debug | <p>Solving non-linear system 1329 failed at time=0.<br>
For more information please use -lv LOG_NLS.</p>
assert | info | <p>simulation terminated by an assertion at initialization</p>
stdout | error | <p>Simulation process failed. Exited with code 255.</p>

I tried to propose more "exact" start values to the model, especially for module.cell[#].diode.v(start=0, nominal=1), but this did not help either.

Attachments (4)

SimpleModuleShadow.png (21.6 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Comparison of OpenModelica and Dymola
JModelica.png (16.6 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Simulation result determined by JModelica
OpenModelica_Newton.png (16.1 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
OpenModelica 1.12.0~dev-319-gfacdc24 with Newton solver
OpenModelica_Dymola_newInitialConditions.png (18.1 KB) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
New initial conditions, comparison of OpenModelica and Dymola simulation results

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by adeas31

  • Component changed from OMEdit to Initialization
  • Owner changed from adeas31 to lochel
  • Status changed from new to assigned

comment:2 Changed 8 years ago by lochel

  • Keywords PhotoVoltaics added
  • Status changed from assigned to accepted

I can confirm that the default nonlinear solver fails during initialization. Two of the other available nonlinear solvers (kinsol and newton) seem to be able to solve the system. At least no error message occurs. Can you please verify the result with one of these options? (e.g. command line flag: -nls=kinsol)

comment:3 follow-up: Changed 8 years ago by Christian Kral <dr.christian.kral@…>

The simulation result based on the Newton solver shows a significant deviation from Dymola (see attachment). The Dymola seems valid as the result is equal to the simulation result creatad by JModelica.

The Kinsol solver causes a simulation crash with an error message:

LOG_NLS | warning | <p>kinsols line search did not convergence. Try without.<br>

LOG_NLS | warning | <p>initial guess was too far away from the solution. Try again.<br>

LOG_NLS | warning | <p>initial guess was too far away from the solution. Try again.<br>

LOG_NLS | warning | <p>initial guess was too far away from the solution. Try again.<br>

LOG_NLS | warning | <p>kinsols matrix need new factorization. Try again.<br>

stdout | error | <p>Process crashed</p>
stdout | error | <p>Process crashed<br>
Simulation process failed. Exited with code 7.</p>

In the investigated example, when changing the parameter record from

parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData 

to

parameter PhotoVoltaics.Records. moduleData 

then none of the non-linear solvers work, unfortunately...

All the investigations are done with

OMEdit 1.12.0~dev-131-g800e4b3
Connected to OpenModelica 1.12.0~dev-267-g1d7cd43
Linux Mint 18.1 64bit

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Comparison of OpenModelica and Dymola

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Simulation result determined by JModelica

comment:4 in reply to: ↑ 3 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

Investigate this case:

In the investigated example, when changing the parameter record from

parameter PhotoVoltaics.Records.SHARP_NU_S5_E3E moduleData 

to

parameter PhotoVoltaics.Records. moduleData

parameter PhotoVoltaics.Records.TSM_200_DC01A moduleData 

then none of the non-linear solvers work, unfortunately...

comment:5 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

I re-investigated this issue with version

OMEdit 1.12.0~dev-154-g354a8d1
Connected to OpenModelica 1.12.0~dev-319-gfacdc24
Linux Mint 18.1 64bit

I simulated the model again with Newton solver. However, the Netwon solver now entirely messed up the results (see attachment OpenModelica_Newton.png)

Then I changed the start values for the iteration of the non-linear system according to https://github.com/christiankral/PhotoVoltaics/issues/3
In this case both Newton and Kinsol solved the system correctly (see attachment OpenModelica_Dymola_newInitialConditions.png)

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

OpenModelica 1.12.0~dev-319-gfacdc24 with Newton solver

Changed 8 years ago by Christian Kral <dr.christian.kral@…>

New initial conditions, comparison of OpenModelica and Dymola simulation results

comment:6 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

I also tried to switch to a different parameter record as described in ticket:4222#comment:4. Now the simulation also works with record TSM_200_DC01A, which causes some more non-linear equations than the original configuration.

Note: See TracTickets for help on using tickets.