zpk DisplayFormat as time constant, how to access the actual Gain, Zeros and Poles

50 ビュー (過去 30 日間)
Hi there.
looking at transforming a transfer funtion into time constant format from polynominal format.
I evenutally came across the option in zpk, to have 'DisplayFormat','timeconstant' which outputs the results as expected.
So the transfer funtion is which is then .
However, when I look at the z,p and k in the values for z, p and k are from , the roots of the num and den.
Anywhy to access the time constants directly, or just have to have work with the roots?
Thanks in advance
Gerard
G = tf([3 6],[1 4 3])
G = 3 s + 6 ------------- s^2 + 4 s + 3 Continuous-time transfer function.
G1 = zpk(G)
G1 = 3 (s+2) ----------- (s+3) (s+1) Continuous-time zero/pole/gain model.
[z,p,k] = zpkdata(G);
G1 = zpk(z,p,k,'DisplayFormat','timeconstant')
G1 = 2 (1+0.5s) ----------------- (1+0.3333s) (1+s) Continuous-time zero/pole/gain model.
  2 件のコメント
Paul
Paul 2023 年 4 月 29 日
Are complex poles/zeros a consideration? If so, what should the time constant be for those?
Gerard Nagle
Gerard Nagle 2023 年 4 月 30 日
To a point, yes they are, but its more indirect and not like in the question above.
Looking at the documentation, it gives that for a Second-Order Factor (Complex Root pair ), that the time constant is given as follows
where , So when using the DisplayName Values, 'timeconstant', you have the following . seems a round about way to get to .
Looking at an example, then and so we get
or as MATLAB would ouput it
G1 = tf(1,[1 3 30])
G1 = 1 -------------- s^2 + 3 s + 30 Continuous-time transfer function.
[z,p,k] = zpkdata(G1);
G3 = zpk(z,p,k,'DisplayFormat','timeconstant')
G3 = 0.033333 ----------------------------------- (1 + 0.5477(0.1826s) + (0.1826s)^2) Continuous-time zero/pole/gain model.
if you use the damp function in MATLAB, then you have the definition of a time constant which is which using the values from the example above gives
damp(G1)
Pole Damping Frequency Time Constant (rad/seconds) (seconds) -1.50e+00 + 5.27e+00i 2.74e-01 5.48e+00 6.67e-01 -1.50e+00 - 5.27e+00i 2.74e-01 5.48e+00 6.67e-01

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2023 年 4 月 29 日
Perhaps I do not understand your question, however in the documentation for the 'time constant' option, the coefficient of s is the time constant, τ. So the time constants are , , and 1.
Given that relation, you can get them directly (albeit with a bit of processing) —
G = tf([3 6],[1 4 3]);
G1 = zpk(G);
[z,p,k] = zpkdata(G);
G1 = zpk(z,p,k,'DisplayFormat','timeconstant')
G1 = 2 (1+0.5s) ----------------- (1+0.3333s) (1+s) Continuous-time zero/pole/gain model.
z_tau = -1./cell2mat(G1.z)
z_tau = 0.5000
p_tau = -1./cell2mat(G1.p)
p_tau = 2×1
0.3333 1.0000
.
  2 件のコメント
Gerard Nagle
Gerard Nagle 2023 年 4 月 30 日
Yes, thanks Star Strider, it was my thoughts too, but I was thinking that if the option for the 'timeconstant' was selected, that it would return the time constants, rather than having to do what you did and work out tau for the zeros and poles.
for example, a suggested output like
[k,z_tau,p_tau] = zpk(z,p,k,'DisplayFormat','timeconstant')
I know I could write s function to do so, but it seems to me that if the option for time cosntas are looked for, they should be outputtes directly, rahter than a work around.
Thanks for your help and expertise Star Strider
Is there a way to suggest enhancements for functions to MATHWORKS?
Star Strider
Star Strider 2023 年 4 月 30 日
As always, my pleasure!
‘Is there a way to suggest enhancements for functions to MATHWORKS?’
Yes! Go here: Contact Support

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by