Factorization in zeros and poles of symbolic transfer functions
18 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
thank you for entering in this page.
I would like to get the analytic expression of the transfer function of a system. The system has one input and 8 outputs (which are the states actually).
I have only the state space representation, but I am asked to get the analytic expression of the 8 transfer functions.
In order to do that, I defined the symbolic variables s, Kp, Kd, where these last two are the parameters of the system. So I computed by hands the inverse of the transition matrix = s*I - A and I defined it in Matlab in function of the symbolic variables. It becomes:
syms s Kp Kd
phi_inv_sym = [s -1 0 0 0 0 0 0;
2*Kp s+2*Kd -Kp -Kd 0 0 0 0;
0 0 s -1 0 0 0 0;
-Kp -Kd 2*Kp s+2*Kd -Kp -Kd 0 0;
0 0 0 0 s -1 0 0;
0 0 -Kp -Kd 2*Kp s+2*Kd -Kp -Kd;
0 0 0 0 0 0 s -1;
0 0 0 0 -Kp -Kd Kp s+Kd] % sI-A symbolic matrix
B = [0 1 0 0 0 0 0 0]'
C = eye(8);
D = zeros(8,1);
Then, I invert the s*I - A and compute the symbolic transfer function as H = C*phi*B+D:
phi_sym = inv(phi_inv_sym) % symbolic transition matrix
H_sym = C*phi_sym*B+D % TRANSFER FUNCTIONS
[num,den] = numden(H_sym(1));
NUM = coeffs(num,s)
DEN = coeffs(den,s)
So, in this way I am able to get the transfer functions.
Now, I would really like to have a decomposition of numerator and denominator that highlights zeros and poles. Of course, the command zpk doesn't work, but I read on the documentation of the Symbolic Math Toolbox that there are some commands that should work.
For example, I tried to use:
solve(num==0,s)
In order to find at least the real roots, but the result is not what I expected:
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 1)
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 2)
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 3)
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 4)
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 5)
root(z^6 + 5*Kd*z^5 + z^4*(5*Kp + 6*Kd^2) + z^3*(Kd^3 + 12*Kd*Kp) + z^2*(3*Kd^2*Kp + 6*Kp^2) + 3*Kd*Kp^2*z + Kp^3, z, 6)
I don't understand why it doesn't find at least the real roots (I know that there should be real roots).
Moreover, I tried to use another command:
F = factor(num,s,'FactorMode','rational')
And, again, it gives me the expression of the numerator without decomposing it in simple fractions.
Please do you know if there is an alternative way? Maybe not with a simple command but changing variables?
Thank you in advance
6 件のコメント
Ameer Hamza
2020 年 10 月 14 日
Yes, as I mentioned in my answer, for the symbolic coefficient finding a general factorization can be quite complicated and may not be possible. Using numeric values is the only solution.
Walter Roberson
2020 年 10 月 14 日
It has been proven that polynomials of degree 5 or higher do not necessarily have solutions that are algebraic numbers... no closed form solution. Some of them do, but most do not.
For any given polynomial with numeric coefficients, there are techniques to find numeric approximations to the roots to any desired finite precision, but those techniques do not work for symbolic coefficients.
回答 (2 件)
Joeyao Chou
2023 年 5 月 20 日
編集済み: Joeyao Chou
2023 年 5 月 20 日
I've seen several research paper on this topic, and those algorithm usually developed in MATLAB.
But sadly the code seems not open to public. I want this feature on MATLAB or Sympy, too.
Symbolic factorization methodology for multistage amplifier transfer functions
Simplified symbolic transfer function factorization using combined artificial bee colony and simulated annealing
For example, nested miller compensation circuit,

Complete exact transfer function has 40 items.

The author proposed a algorithm to first neglecting those negligible items to 8 itmes
Then, if 10% displacement of poles/zeros can be tolerated, above transfer function can be (partial) factorized to

Or, if 20% displacement of poles/zeros can be tolerated, above transfer function can be fully factorized to

Finally we can have a nice clean clear transfer function which can intuitively guide our design.
Again. But sadly the code seems not open to public. I want this feature on MATLAB or Sympy, too.
0 件のコメント
Ameer Hamza
2020 年 10 月 14 日
Factoring a general 6 order polynomial will all symbolic components can be quite complicated. The symbolic toolbox does not seem to find a solution for a general case. You can substitute some numeric values to get results. For example, try this
solve(subs(num, [Kp Kd], [1 2])==0); % Kp=1, Kd=2
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!