﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3284	"Problem with ""when+reinit"" when using vectors"	Henning Kiel	somebody	"The following model implements the bouncing ball model with
1) scalars
2) array of arbitrary length (e.g. 1)

Though both models flatten to the same code (except for the ""[1]"" where appropriate) the model result is different!


{{{
model reinit_test
  parameter Integer n = 1;
  parameter Real g = 9.81;
  parameter Real e = 0.9;
  Real v[n](start = 10 * (0:n - 1));
  Real h[n](each start = 10);
  Boolean flying;
  Real v_(start = 0);
  Real h_(start = 10);
  Boolean flying_;
equation
  der(h) = v;
  der(v) = if flying then -g * ones(n) else zeros(n);
  flying = not (h[1] <= 0 and v[1] <= 0);
  when h[1] < 0 then
    reinit(v, -e * pre(v));
  end when;
  der(h_) = v_;
  der(v_) = if flying_ then -g else 0;
  flying_ = not (h_ <= 0 and v_ <= 0);
  when h_ < 0 then
    reinit(v_, -e * pre(v_));
  end when;
  annotation(experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.002));
end reinit_test;
}}}
"	defect	closed	high	1.19.0	Backend	trunk	fixed		
