control icon indicating copy to clipboard operation
control copied to clipboard

Error with ss2tf function

Open kjudom opened this issue 4 years ago • 1 comments

I got this error when trying to convert the model back to TF with these statements:

g1 <- tf(10,c(1,6,5,0)) s1 <- tf2ss(g1) ss2tf(s1)

y1:Error in poly2str(argnum, svar = "s", smul = " ") : Argument 'p' must be a numeric vector.

kjudom avatar Apr 23 '21 02:04 kjudom

by the way, this should be some floating point rounding problem since changing the numerator from 10 to 2 gives the following:

g1 <- tf(2,c(1,6,5,0)) s1 <- tf2ss(g1) ss2tf(s1)

y1: -3.552714e-15 s^2 - 1.776357e-15 s + 2


                 s^3 + 6 s^2 + 5 s 

kjudom avatar Apr 23 '21 02:04 kjudom