﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4500	Reinit of variables	jal.panchal@…	Jal Panchal	"I faced a problem while using reinit in my code and I have extracted the essential parts into the code below

{{{
model erraticWhenCondition
  Modelica.Blocks.Sources.Sine sine1(amplitude = 1, freqHz = 0.5)  annotation(
    Placement(visible = true, transformation(origin = {-58, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Real x (start = 1);
  Real y,z,a,b;

  equation
  when sine1.y < 0.8 then
      reinit(x, 1);
  end when;
  
  when sine1.y > -0.8 then
     reinit(x ,-1);
  end when;
  
  x = 1;
  
  y = x;
  z = x*1;
  a = x*(-1);
  b = x*2;
end erraticWhenCondition;
}}}

What I observed was, x is switching between -1 and 1 correctly, so is y and z. But a and b get constant values of -1 and 2.

So either such an equation should raise an error or the calculation must be done rightly for a and b."	defect	new	high	Future	Backend	v1.12.0		reinit , when	
