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

50 Ansichten (letzte 30 Tage)
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 Kommentare
Paul
Paul am 29 Apr. 2023
Are complex poles/zeros a consideration? If so, what should the time constant be for those?
Gerard Nagle
Gerard Nagle am 30 Apr. 2023
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Star Strider
Star Strider am 29 Apr. 2023
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 Kommentare
Gerard Nagle
Gerard Nagle am 30 Apr. 2023
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 am 30 Apr. 2023
As always, my pleasure!
‘Is there a way to suggest enhancements for functions to MATHWORKS?’
Yes! Go here: Contact Support

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by