This example shows how choice of model type can affect numerical accuracy when interconnecting models.
You can represent block diagram components with any model type. However, certain connection operations yield better numerical accuracy for models in
For example, interconnect two models in series using different model types to see how different representations introduce numerical inaccuracies.
Load the models
Cd. These models are ninth-order and second-order discrete-time transfer functions, respectively.
load numdemo Pd Cd
Compute the open-loop transfer function
L = Pd*Cd using the
Ltf = Pd*Cd; Lzp = zpk(Pd)*Cd; Lss = ss(Pd)*Cd; w = logspace(-1,3,100); Lfrd = frd(Pd,w)*Cd;
Plot the magnitude of the frequency response to compare the four representations.
tf representation has lost low-frequency dynamics that other representations preserve.