| Control System Toolbox™ | ![]() |
| On this page… |
|---|
You can use the following LTI model formats:
TF
ZPK
SS
FRD
This section shows how to convert models from one format to the other.
Model conversions are performed by tf, ss, zpk, and frd. Given any TF, SS, or ZPK model sys, the syntax for conversion to another model type is
sys = tf(sys) | % Conversion to TF |
sys = zpk(sys) | % Conversion to ZPK |
sys = ss(sys) | % Conversion to SS |
sys = frd(sys,frequency) | % Conversion to FRD |
Notice that FRD models can't be converted to the other model types. In addition, you must also include a vector of frequencies (frequency) as an input argument when converting to an FRD model.
For example, you can convert the state-space model
sys = ss(-2,1,1,3)
to a zero-pole-gain model by typing
zpk(sys)
This command results in
Zero/pole/gain: 3 (s+2.333) ----------- (s+2)
Note that the transfer function of a state-space
model with data
is
![]()
for continuous-time models, and
![]()
for discrete-time models.
Some algorithms operate only on one type of LTI model. For example, the algorithm for zero-order-hold discretization with c2d can only be performed on state-space models. Similarly, commands like tfdata expect one particular type of LTI models (TF). For convenience, such commands automatically convert LTI models to the appropriate or required model type. For example, in
sys = ss(0,1,1,0) [num,den] = tfdata(sys)
tfdata first converts the state-space model sys to an equivalent transfer function in order to return numerator and denominator data.
Conversions to state-space models are not uniquely defined. For this reason, automatic conversions to state space are disabled when the result depends on the choice of state coordinates, for example, in commands like initial or kalman.
When manipulating or converting LTI models, keep in mind that:
The three LTI model types TF, ZPK, and SS, are not equally well-suited for numerical computations. In particular, the accuracy of computations using high-order transfer functions is often poor. Therefore, it is often preferable to work with the state-space representation. In addition, it is often beneficial to balance and scale state-space models. You get this type of balancing automatically when you convert any TF or ZPK model to state space using ss.
Conversions to the transfer function representation using tf may incur a loss of accuracy. As a result, the transfer function poles may noticeably differ from the poles of the original zero-pole-gain or state-space model.
Conversions to state space are not uniquely defined in the SISO case, nor are they guaranteed to produce a minimal realization in the MIMO case. For a given state-space model sys,
ss(tf(sys))
may return a model with different state-space matrices, or even a different number of states in the MIMO case. Therefore, if possible, it is best to avoid converting back and forth between state-space and other model types.
![]() | LTI Properties | Time Delays | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |