How to implement improper transfer function (s + 0.1) in simulink?
조회 수: 3 (최근 30일)
이전 댓글 표시
i have used the matlab guide of solving improper fractions in simulink which is as follows.
num=[1 0.1];
den=1;
[r,p,k]=residue(num,den);
sys1 = tf(r(1),[1,-p(1)])
sysk1 = k(1)*s;
sysk2 = k(2);
But it shows this error.
Solving_ImproperFun_simulink
Index exceeds the number of array elements (0).
Error in Solving_ImproperFun_simulink (line 4)
sys1 = tf(r(1),[1,-p(1)])
댓글 수: 0
답변 (2개)
Walter Roberson
2019년 4월 4일
Try it at the MATLAB level. You will see that r and p both come out empty, so indexing them at location 1 will not work.
Why not go directly to
sys1 = tf(num, den);
댓글 수: 3
Walter Roberson
2019년 4월 4일
You cannot import a transfer function. You would not be able to import a transfer function even if your original code had worked.
You cannot use the Transfer Function block in Simulink for this because that block requires that the denominator be at least as high a degree as the numerator.
You can use a State Space block: https://www.mathworks.com/help/simulink/slref/statespace.html . And you can use MATLAB ahead of time to work out what the matrices should be.
You can also use tf() inside a MATLAB Function Block. It is possible that you might need to coder.external() it, and you might not be able to use it with any Rapid Acceleration turned on.
Elio Sánchez G.
2019년 6월 30일
You have to sum 2 signals: dr/dt + r (where "r" is the input signal). Just use three blocks: derivative, sum and gain.
댓글 수: 1
Sina Dehbari
2020년 5월 7일
Dear Elio,
Could you send a picture of blokcs? I don't know how connect them
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!