﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4793	Complex division is not working in MSL simulation example	Christian Kral <dr.christian.kral@…>	Karim Adbdelhak	"I recently implemented a Bode block in the MSL, see https://github.com/modelica/Modelica/issues/2473. Today I improved the Bode model in the MSL order to overcome some numerical and initialization problems.

Now, please consider example {{{Modelica.Electrical.QuasiStationary.SinglePhase.Examples.SeriesBode}}} (on master):
 * The simulation example simulates with no obvious complaints
 * The complex inputs bode.u and bode.divisor look reasonable
 * The division of the two complex inputs, however, is incorrect (see attached file), i.e., {{{divison.y.re = division.y.im = 0}}} ... the results shall NOT be zero

I do not understand where this comes from, as the simple test example

{{{#!mo
model TestComplexDivision
  Modelica.ComplexBlocks.Sources.ComplexConstant complexConst1(k = Complex(1, 1))  annotation(
    Placement(visible = true, transformation(origin = {-70, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.ComplexBlocks.Sources.ComplexConstant complexConst(k = Complex(2, 3))  annotation(
    Placement(visible = true, transformation(origin = {-70, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.ComplexBlocks.ComplexMath.Division division1 annotation(
    Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(complexConst.y, division1.u2) annotation(
    Line(points = {{-58, -30}, {-50, -30}, {-50, -16}, {-42, -16}, {-42, -16}}, color = {85, 170, 255}));
  connect(complexConst1.y, division1.u1) annotation(
    Line(points = {{-58, 10}, {-50, 10}, {-50, -4}, {-42, -4}, {-42, -4}}, color = {85, 170, 255}));

end TestComplexDivision;
}}} 
 
works OK and the division1.y shows the correct result.

So {{{TestComplexDivision}}} works OK, but {{{Modelica.Electrical.QuasiStationary.SinglePhase.Examples.SeriesBode}}} does not work. 

This issue applies to
{{{
OMEdit 1.13.0~dev-106-g36aa34a
Connected to OpenModelica 1.13.0~dev-729-gdbcd957
}}}
on a 64bit Linux machine. "	defect	closed	blocker	1.14.0	Backend		fixed		Lennart Ochel Willi Braun Francesco Casella
