Customize Model Display
Configure Transfer Function Display Variable
This example shows how to configure the MATLAB® command-window display of transfer function (tf
)
models.
You can use the same steps to configure the display variable of transfer function
models in factorized form (zpk
models).
By default, tf
and zpk
models are
displayed in terms of s
in continuous time and
z
in discrete time. Use the Variable
property change the display variable to 'p'
(equivalent to
's'
), 'q'
(equivalent to
'z'
), 'z^-1'
, or
'q^-1'
.
Create the discrete-time transfer function
with a sample time of 1 s.
H = tf([1 -1],[1 -3 2],0.1)
H = z - 1 ------------- z^2 - 3 z + 2 Sample time: 0.1 seconds Discrete-time transfer function.
The default display variable is
z
.Change the display variable to
q^-1
.H.Variable = 'q^-1'
H = q^-1 - q^-2 ------------------- 1 - 3 q^-1 + 2 q^-2 Sample time: 0.1 seconds Discrete-time transfer function.
When you change the
Variable
property, the software computes new coefficients and displays the transfer function in terms of the new variable. Thenum
andden
properties are automatically updated with the new coefficients.
Tip
Alternatively, you can directly create the same transfer function expressed in
terms of 'q^-1'
.
H = tf([0 1 -1],[1 -3 2],0.1,'Variable','q^-1');
For the inverse variables 'z^-1'
and
'q^-1'
, tf
interprets the numerator
and denominator arrays as coefficients of ascending powers of
'z^-1'
or 'q^-1'
.
Configure Display Format of Transfer Function in Factorized Form
This example shows how to configure the display of transfer function models in
factorized form (zpk
models).
You can configure the display of the factorized numerator and denominator polynomials to highlight:
The numerator and denominator roots
The natural frequencies and damping ratios of each root
The time constants and damping ratios of each root
See the DisplayFormat
property on the zpk
reference page for more
information about these quantities.
Create a
zpk
model having a zero at s = 5, a pole at s = –10, and a pair of complex poles at s = –3 ± 5i.H = zpk(5,[-10,-3-5*i,-3+5*i],10)
H = 10 (s-5) ---------------------- (s+10) (s^2 + 6s + 34) Continuous-time zero/pole/gain model.
The default display format,
'roots'
, displays the standard factorization of the numerator and denominator polynomials.Configure the display format to display the natural frequency of each polynomial root.
H.DisplayFormat = 'frequency'
H = -0.14706 (1-s/5) ------------------------------------------- (1+s/10) (1 + 1.029(s/5.831) + (s/5.831)^2) Continuous-time zero/pole/gain model.
You can read the natural frequencies and damping ratios for each pole and zero from the display as follows:
Factors corresponding to real roots are displayed as (1 – s/ω0). The variable ω0 is the natural frequency of the root. For example, the natural frequency of the zero of
H
is 5.Factors corresponding to complex pairs of roots are displayed as 1 – 2ζ(s/ω0) + (s/ω0)2. The variable ω0 is the natural frequency, and ζ is the damping ratio of the root. For example, the natural frequency of the complex pole pair is 5.831, and the damping ratio is 1.029/2.
Configure the display format to display the time constant of each pole and zero.
H.DisplayFormat = 'time constant'
H = -0.14706 (1-0.2s) ------------------------------------------- (1+0.1s) (1 + 1.029(0.1715s) + (0.1715s)^2) Continuous-time zero/pole/gain model.
You can read the time constants and damping ratios from the display as follows:
Factors corresponding to real roots are displayed as (τs). The variable τ is the time constant of the root. For example, the time constant of the zero of
H
is 0.2.Factors corresponding to complex pairs of roots are displayed as 1 – 2ζ(τs) + (τs)2. The variable τ is the time constant, and ζ is the damping ratio of the root. For example, the time constant of the complex pole pair is 0.1715, and the damping ratio is 1.029/2.