﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1048	delay gives wrong result for discrete signals (from MathCore)	krsta	Willi Braun	"When using delay on discrete signals, the delay-signal is no longer discrete, the interpolation does not take events into consideration.

Test example:

{{{
model delaytest
  Integer n;
  Integer n2;
  Integer n3;
  parameter Real delayMax=10;
equation 
  when sample(0,0.1) then
    n = pre(n) + 1;
  end when;
  n2 = integer(delay(n,0.34));
  n3 = integer(delay(n,1.0/(n2+0.01),delayMax));
end delaytest;
}}}

Note that n2 and n3 does not have discrete jumps as n does.

Please add this example to the testsuite once it is working. 

''Implementation note: I guess that in order to get this to work, the delay function must identlify when an event occurs and force an extra emit to occur.''"	defect	closed	critical	1.9.1	Run-time		fixed		krsta Willi Braun
