﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3770	clocked equations problem	Niklas Worschech	Rüdiger Franke	"For the following model from the cpp runtime tests suite, it appears a wrong clock equation is generated.

{{{#!mo
model SolverMethod ""Continuous PI controller in a clocked partition;
  see Modelica 3.3 spec, section 16.8.3 Associating a Solver to a Partition""
  parameter Real Ti = 200/1000, k = 2;
  parameter Real ref = 1;
  Real x(start = 0, fixed = true);
  Real xd(start = 0);
  Real vd, e, u;
equation
  // controller
  vd = sample(x, Clock(Clock(50,1000), solverMethod = ""ImplicitEuler""));
  e = ref-vd;
  der(xd) = e/Ti;
  u = k*(e + xd);
  // physical model
  0.2*der(x) = hold(u);
end SolverMethod;
}}}

For the variable xd this equation is generated:

xd = DIVISION(e, Ti) * interval() + previous(xd)

I think this equation is not correct, because xd starts with an incorrect value. It starts with 0.25 but it should start with 0


"	defect	closed	blocker	Future	Backend		fixed	Modelica_Synchronous, synchronous features, cpp runtime	Rüdiger Franke Bernhard Thiele Volker Waurich Martin.Otter@…
