Opened 9 years ago
Last modified 9 years ago
#3770 closed defect
event clocks error — at Initial Version
Reported by: | Niklas Worschech | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | blocker | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Modelica_Synchronous, synchronous features, cpp runtime | Cc: | Rüdiger Franke, Bernhard Thiele, Volker Waurich, Martin.Otter@… |
Description
For the following model from the cpp runtime tests suite, it appears a wrong clock equation is generated.
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