How initial condition of input in Matlab Function in algebraic loop?

1 回表示 (過去 30 日間)
fikana cantri
fikana cantri 2019 年 5 月 21 日
コメント済み: fikana cantri 2019 年 5 月 25 日
there is a matlab function in simulink that applies algebraic loops. I do not understand how the initial conditions of the input even though the input can be from output, which is where the mathematical process of output also requires input. Does the input have to have initial conditions or not? but in this matlab function is not initialized.
one of the contents of fcn as follows:
function [calc_flux,output] = fcn(frame,input)
output=log(1+1000)
a=output-input

採用された回答

Raj
Raj 2019 年 5 月 23 日
1) "Does the input have to have initial conditions or not?" Definitely yes. Without Initial condition how will the algebraic loop start right?
2) "but in this matlab function is not initialized." - If you open your memory block you will see an option of setting "Initial Condition". This value is used for the first cycle of computation. The next cycle uses the output of first cycle and so on.
3) Use of memory blocks for algebraic loops is not recommended. See here.
Hope this helps!!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by