1

我要建模的是一个周期性的时变实变量,下面的代码无法模拟。有人有建议吗?

class try
discrete Real x(start = 1);
algorithm
when sample(0,4) then 
   x :=  1; // reinit(x, 1) also does not work
end when;
equation
      der(x) = 1;
end try;

所有错误信息如下:
Translation 18:32:29 0:0-0:0 Internal error Transformation Module failed!
翻译 18:32:29 0:0-0:0 内部错误 BackendDAETransform.reduceIndexDummyDer 失败!
翻译 18:32:29 0:0-0:0 内部错误 BackendDAETransform.selectDummyState: no state to select
Symbolic 18:32:29 10:3-10:13 模型结构奇异,错误发现排序方程 0.0 = 1.0; 对于变量

4

1 回答 1

2

问题是,如果您希望变量 x 在采样时间间隔之间继续,您必须删除离散关键字,这将正常工作:

class try
 Real x(start = 1);
algorithm 
when sample(0,4) then
   reinit(x, 1);
end when;
equation 
      der(x) = 1;
end try;

曹,马可

于 2012-09-12T12:23:48.003 回答