﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4767	Number of intervals is influencing whether simulation run is successful	Christian Kral <dr.christian.kral@…>	Willi Braun	"Please consider the attached example of a controlled DC machine that I am using in my classes. One of my students ran into a problem when simulating this model. 

=== Simulation setting 1 (as attached)
 
{{{
experiment(StartTime = 0, StopTime = 1.5, Tolerance = 1e-06, Interval = 0.00075)
}}}

The simulation fails with the error message:
{{{
LOG_SUCCESS | info | <p>The initialization finished successfully without homotopy method.</p>
assert | debug | <p>Simulation terminated due to too many, i.e. 20, event iterations.<br>
This could either indicate an inconsistent system or an undersized limit of event iterations.<br>
The limit of event iterations can be specified using the runtime flag '–mei=&lt;value&gt;'.</p>
stdout | error | <p>Simulation process failed. Exited with code 255.</p>
}}}

I follow the suggestion and set {{{-mei=1000}}}: This results in:

{{{
stdout | error | <p>Simulation process failed. Exited with code 255.</p>
}}} 

=== Simulation setting 2

{{{
experiment(StartTime = 0, StopTime = 1.5, Tolerance = 1e-06, Interval = 7.5e-05)
}}}

The simulation runs fine with some warnings, however. 

{{{
LOG_SUCCESS | info | <p>The initialization finished successfully without homotopy method.</p>
LOG_NLS_V | warning | <p>Warning: maximal number of iteration reached but no root found</p>
}}}

Simulations results are displayed correctly and the simulation looks OK.

=== Conclusions

I already experienced a couple times, that the actual number of intervals heavily influences the success of a simulation run. This makes it very difficult in a teaching situation to identify the problem and find a proper solution. The attached model now represents a reproducible case of the described issue.

This issue occurred at version 1.12.0 (on Windows machine). I double checked the issue right now at version
{{{
OMEdit 1.13.0~dev-101-ga45068d
Connected to OpenModelica 1.13.0~dev-632-g450ec7c
}}}
on a Linux 64bit machine. 
"	defect	assigned	high	Future	Run-time	v1.13.0-dev-nightly			ssuer@…
