Why FixedStep is not really fixed in simulink?

1 回表示 (過去 30 日間)
Armin Mashhadi
Armin Mashhadi 2020 年 5 月 14 日
コメント済み: Armin Mashhadi 2020 年 5 月 17 日
Hi ,
I was trying to sum outputs of two simulink models. For that, I choosed FixedStep = 0.05 for both,
But results shows two different time array ! So we can not sum up them.
Here is code (Simulink files are attached):
x = [-0.8506 ,-0.4860 ,1.2459,...
-0.07146 ,46.7021 ,2.60395]; %Parameter #1 for simulink
un = zeros (1,12) ; % Parameter #2 for simulink
Duration = [0 150];
options = simset('FixedStep','0.05','SrcWorkspace','current','DstWorkspace','current','solver','ode45','ReturnWorkspaceOutputs','on');
a = sim('VL_u1',Duration,options);
b = sim('VL_u2',Duration,options);

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 5 月 14 日
It conflicts with your solver specification. ode45 is a variable-step solver.
FixedStep - Fixed step size [ positive scalar ]
FixedStep applies only to the fixed-step solvers. If there are discrete
components, the default is the fundamental sample time; otherwise, the
default is one-fiftieth of the simulation interval.
  1 件のコメント
Armin Mashhadi
Armin Mashhadi 2020 年 5 月 17 日
Thanks a lot ,
Got it !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by