﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2901	wrong initial conditions obtained in initial equation section	Michael Wetter	Lennart Ochel	"The attached plot shows results from the model 
Buildings.HeatTransfer.Examples.ConductorSteadyStateTransient
with the assertEquality block configured so that its parameter startTime is 864000 and hence the block does not stop the simulation.

The figure shows on top the results from Dymola and on the bottom the result from the nightly built of OpenModelica and the trunk of https://github.com/lbl-srg/modelica-buildings (sha=42288ed91ac7ec992846335505403fe808fcfa86)

The section
{{{
initial equation 
  // The initialization is only done for materials that store energy.
    if not material.steadyState then
      if steadyStateInitial then
        if material.phasechange then
          der(u) = zeros(nSta);
        else
          der(T) = zeros(nSta);
        end if;
      else
        for i in 1:nSta loop
          T[i] = T_a_start+(T_b_start-T_a_start) * UA *
            sum(1/(if (k==1 or k==nSta+1) then UAnSta2 else UAnSta) for k in 1:i);
        end for;
      end if;
    end if;
}}}
seems to be processed incorrectly in OpenModelica. OpenModelica obtains the correct values T_a_start=T_b_start=293.15, but then computes wrong initial values for T. The expected result is that T[:]=293.15 at t=0.
"	defect	closed	normal	1.9.4	Backend	trunk	fixed		
