Reduce block diagrams symbolically

조회 수: 15 (최근 30일)
Aleem Andrew
Aleem Andrew 2021년 2월 6일
답변: Paul 2021년 2월 6일
Can the code below be modified to find the transfer function in terms of symbolic functions g1 to g5 instead of numeric functions? I tried passing symbolic arrays as arguments to tf but I get an error message stating that the values of num and den must be numeric arrays. Is there a way to write code similar to the code below but with g1, g2, g3, g4, and g5 being passed as symbolic arguments?
g1 = tf(1,[1 0 0]);
num2 = 50; den2 = [1 1];
g2 = tf(num2,den2);
g3 = tf(2,[1,0]); g4 = tf([1 0],1);
g5 = tf(2,[1]);
sys1 = parallel(g4,-g5);
sys2 = feedback(g2,g3,-1);
sys4 = series(sys2,sys1);
sys5 = series(sys4,g1);
sys6 = feedback(sys5,[1])
answer = minreal(sys6)

답변 (1개)

Paul
Paul 2021년 2월 6일
Assuming you want final result in terms of the gi(s):
syms g1(s) g2(s) g3(s) g4(s) g5(s)
symsys1 = g4(s)-g5(s);
symsys2 = g2(s)/(1 + g3(s)*g2(s));
symsys4 = symsys2*symsys1;
symsys5 = symsys4*g1(s);
symsys6 = symsys5/(1 + symsys5);
symsys6 = simplify(symsys6,50);
[num,den] = numden(symsys6);
symsys6 = num/den;
symsys6
symsys6 =
(g1(s)*g2(s)*g4(s) - g1(s)*g2(s)*g5(s))/(g2(s)*g3(s) + g1(s)*g2(s)*g4(s) - g1(s)*g2(s)*g5(s) + 1)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by