MATLAB Answers


"Glitches" in transfer function

Asked by Marko
on 16 Jul 2019
Latest activity Commented on by Star Strider
on 16 Jul 2019
Hi all,
I was developing a certain model which includes a lot of transfer functions, which are mainly 2x2 matrices. There is a fair deal of multiplication and division of these transfer function as well. I have noticed that in some of them I have sort of "glitches" which I have no idea how to avoid and correct. Have you seen similar behaviour or, even better, you have a solution for it? Below is the what I obtain when I draw the transfer function with "bodeplot" command


Star Strider
on 16 Jul 2019
You apparently have a zero at that frequency, likely located away from the imaginary axis.
on 16 Jul 2019
Thanks for your reply! I know that I have a resonant point around this frequency so this might be the reason eventually. Apart fromt that, do you think this could also be caused by numerical imprecision? The transfer function is given as below... :/
1.746e05 s^66 + 9.314e11 s^65 + 2.236e18 s^64 + 3.181e24 s^63 + 2.972e30 s^62 + 1.905e36 s^61 + 8.486e41 s^60
+ 2.597e47 s^59 + 5.231e52 s^58 + 6.295e57 s^57 + 3.517e62 s^56 + 1.604e66 s^55 + 4.001e69 s^54
+ 7.157e72 s^53 + 1.019e76 s^52 + 1.218e79 s^51 + 1.262e82 s^50 + 1.158e85 s^49 + 9.56e87 s^48
+ 7.178e90 s^47 + 4.942e93 s^46 + 3.14e96 s^45 + 1.85e99 s^44 + 1.016e102 s^43 + 5.206e104 s^42
+ 2.499e107 s^41 + 1.125e110 s^40 + 4.759e112 s^39 + 1.892e115 s^38 + 7.073e117 s^37 + 2.487e120 s^36
+ 8.221e122 s^35 + 2.553e125 s^34 + 7.439e127 s^33 + 2.03e130 s^32 + 5.178e132 s^31 + 1.23e135 s^30
+ 2.714e137 s^29 + 5.53e139 s^28 + 1.035e142 s^27 + 1.763e144 s^26 + 2.71e146 s^25 + 3.703e148 s^24
+ 4.416e150 s^23 + 4.469e152 s^22 + 3.68e154 s^21 + 2.342e156 s^20 + 9.624e157 s^19 + 3.951e159 s^18
+ 5.607e160 s^17 - 1.998e161 s^16 - 3.711e163 s^15 - 6.112e164 s^14 - 4.977e165 s^13 - 2.521e166 s^12
- 8.724e166 s^11 - 2.161e167 s^10 - 3.918e167 s^9 - 5.234e167 s^8 - 5.107e167 s^7 - 3.548e167 s^6
- 1.665e167 s^5 - 4.737e166 s^4 - 6.172e165 s^3 - 2.371e161 s^2 - 4.222e161 s + 2.93e151
s^68 + 5.334e06 s^67 + 1.28e13 s^66 + 1.822e19 s^65 + 1.702e25 s^64 + 1.091e31 s^63 + 4.86e36 s^62 + 1.487e42 s^61
+ 2.996e47 s^60 + 3.605e52 s^59 + 2.015e57 s^58 + 9.215e60 s^57 + 2.328e64 s^56 + 4.235e67 s^55
+ 6.137e70 s^54 + 7.465e73 s^53 + 7.87e76 s^52 + 7.347e79 s^51 + 6.163e82 s^50 + 4.696e85 s^49
+ 3.278e88 s^48 + 2.108e91 s^47 + 1.256e94 s^46 + 6.953e96 s^45 + 3.588e99 s^44 + 1.729e102 s^43
+ 7.793e104 s^42 + 3.287e107 s^41 + 1.298e110 s^40 + 4.799e112 s^39 + 1.658e115 s^38 + 5.353e117 s^37
+ 1.611e120 s^36 + 4.51e122 s^35 + 1.173e125 s^34 + 2.838e127 s^33 + 6.42e129 s^32 + 1.383e132 s^31
+ 2.949e134 s^30 + 6.607e136 s^29 + 1.625e139 s^28 + 4.317e141 s^27 + 1.164e144 s^26 + 3.004e146 s^25
+ 7.147e148 s^24 + 1.538e151 s^23 + 2.951e153 s^22 + 4.995e155 s^21 + 7.344e157 s^20 + 9.163e159 s^19
+ 9.418e161 s^18 + 7.38e163 s^17 + 4.066e165 s^16 + 8.037e166 s^15 + 8.485e167 s^14 + 5.686e168 s^13
+ 2.64e169 s^12 + 8.914e169 s^11 + 2.253e170 s^10 + 4.325e170 s^9 + 6.336e170 s^8 + 7.049e170 s^7
+ 5.864e170 s^6 + 3.538e170 s^5 + 1.464e170 s^4 + 3.717e169 s^3 + 4.372e168 s^2 - 1.053e155 s
- 1.171e143
Bruno Luong
on 16 Jul 2019
FIR order 68? It's not surprising that you run into numerical problem with such high order.

Sign in to comment.

1 Answer

Answer by Star Strider
on 16 Jul 2019
 Accepted Answer

Precision could certainly be a problem, especiall considering the magnitudes of those numbers. (MATLAB retains full internal precision, even though the printed output is much less precise.)
See if using the minreal function helps.


on 16 Jul 2019
I have tried using it and it seems that there is a certain difference so I might try that one a couple of times.
Another question:
Do you think that this might be solved by using symbolic functions and then just evaluating them with already defined numerical values of variables? Because I do have all the parameters and the functions do seem simpler when using the symbolic representation...
Star Strider
on 16 Jul 2019
The minreal function can solve many problems.
Symbolic functions have the advantage of extended precision, however to use those results with the Control System Toolbox functions, you would then have to use the double function to get the symbolic results in a form it can use. It is not easy to use symbolic functions to model control systems, since you need to write the necessary functions yourself. Also, the Symbolic Math Toolbox is not ideal for problems requiring recursive solutions, such as loops. It can take forever.

Sign in to comment.