工作,我嘗試用Dymola的編譯如下代碼:採樣功能並不在Dymola的
class abc
import Modelica.SIunits;
parameter SIunits.Time delta_t=0.5;
constant Real a[:]={4,2,6,-1,3,5,7,4,-3,-6};
Real x;
Integer j(start=1);
Integer k=size(a, 1);
algorithm
when {(sample(0, delta_t) and j < k),j == 1} then
x := a[j];
j := j + 1;
end when;
end abc;
和time = 0
變量j
開始與2
。但它應該從j = 1
開始。
有沒有人有這個問題的想法?
可以使用向量'{(sample(0,delta_t)和j
matth
2013-02-19 09:14:41
@matth不,條件j == 1在時間= 0時不_become_真,這是真的,因爲「j == 1和pre(j == 1)= false」。 – Willi 2013-02-19 13:06:08