Error in using 'frestimate' for MIMO system

조회 수: 4 (최근 30일)
Siddhesh Rane
Siddhesh Rane 2020년 6월 26일
댓글: Walter Roberson 2020년 6월 26일
I am using frestimate for finding frequency response function of a non-linear system which has multiple inputs and multiple outputs,
Picture above shows the simulink model, I have selected 1 input (out of 2) and 1 output (output), I get following error after using
[sysest,simout] = frestimate(mdl,getlinio(mdl),in);
Error using frestimate>LocalRunSimulation (line 1165)
State derivatives returned by S-function 'System_Model' in 'Non_Linear_Model_FRF/Validation
Setup/S-Function' during flag=1 call must be a real vector of length 13
Error in frestimate (line 255)
[simout{ctexp},err] = LocalRunSimulation(parammgr,SimulationPackage,ctexp); -
Show complete stack trace

답변 (1개)

Walter Roberson
Walter Roberson 2020년 6월 26일
Your S function Validation Setup has 13 outputs. The model derivatives for it must return 13 values, one for each of those 13 outputs.
It looks to me as if your S function is probably a Level 1 S function that is being passed u and flag and is expected to detect the various flag states to decide what it is doing.
  댓글 수: 4
Siddhesh Rane
Siddhesh Rane 2020년 6월 26일
I changed it to real-positive values (0.6), which did not solve the problem. I am not able to understand from error message if the problem is with non-real values or length of the output vector. Because I am selecting only 1 input and 1 output.
Walter Roberson
Walter Roberson 2020년 6월 26일
After the assignment to sys, add in lines:
assert(length(sys) == 13, 'derivatives are wrong length')
assert(all(isfinite(sys)), 'derivatives are not all finite')
assert(all(imag(sys) == 0), 'derivatives are not all real')

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by