﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4519	Solving equations with a division by zero	anonymous		"I attached two examples which are current not simulating in OpenModelica. I know these examples should work as they are simulating in Dymola and they have been working in a previous version two years ago (when I developed similar models). Please load the system library ElectroMechanicalDrives to investigate the following two examples. 

=== TestElectroMechanicalDrives

When compiling this example the following error message is generated:

{{{
stdout | unknown | <p>DASKR--  AT T (=R1) AND STEPSIZE H (=R2) THE                                    <br>
      In above,  R1 =   0.0000000000000E+00   R2 =   1.6518123698891E-13<br>
DASKR--  NONLINEAR SOLVER FAILED TO CONVERGE                                    <br>
DASKR--  REPEATEDLY OR WITH ABS(H)=HMIN                                         <br>

stdout | error | <p>Simulation process failed. Exited with code 248.</p>
stdout | info | <p>The initialization finished successfully without homotopy method.</p>
stdout | warning | <p>The corrector could not converge.</p>
stdout | warning | <p>can't continue. time = 0.000000</p>
stdout | info | <p>model terminate | Integrator failed. | Simulation terminated at time 0</p>
}}}

When I remove the inertia, the model simulates OK. This I do not understand...

=== TestElectroMechanicalDrives2

When compiling this example the following error message is generated:

{{{
stdout | error | <p>Simulation process failed. Exited with code 1.</p>
stdout | info | <p>The initialization finished successfully without homotopy method.</p>
assert | debug | <p>division by zero at time 0, (a=0) / (b=0), where divisor b expression is: inertia.w</p>
assert | debug | <p>division by zero at time 0, (a=0) / (b=0), where divisor b expression is: inertia.w</p>
assert | debug | <p>division by zero at time 0, (a=0) / (b=0), where divisor b expression is: inertia.w</p>
}}}

This issue seems to be related with speed. If I change the offset of the ramp to 1E-3 the example works fine. 

=== Summary 

The problem seems to be caused by {{{ElectroMechanicalDrives.Components.Rotational.ConstantEfficiency}}}. However, this example should be working and has been working some time ago. As a workaround I wonder if there exists an alternative formulation of the efficiency equations to work with OpenModelica. 

"	defect	assigned	high	Future	Backend				Lennart Ochel
