0

how are you?.

I'm trying to create a function that calculates the z-transform of a transfer function using the residues method but for that, I need the factors of the characteristic equation and the powers of the factors, so, in order to do that I tried to factorize polynomials with non-integer coefficients but after trying everything that I read I couldn't factorize make maxima to factorize those polynomials the way I need it.

For giving an example, I have this characteristic equation: "s·(s^2+0.1·s)", the factors should be "s^2" and "s + 0.1" but maxima allways gives me "(s^2·(10·s + 1))/10".

Why I'm signalling this?, well, as I learned that maxima treates the outputs equation as list so I can have its dimension and separate the factos by its positions in the list to measure the powers of the factors and do what I need, but like maxima gives me the result that is shown above then the dimension of the list is different and it will make my function to work differently and possibly have errors.

The result that is shown is given by maxima no matter if I use factor, gfactor, or expand or whatever other function that I found and I know that result is because maxima are rationalizing the polynomial before working with it but I don't need that behavior, I only need the pure factors, so, how can I have the result that I want?.

Thanks in advance for the help.

wajaap
  • 273
  • 3
  • 20
vram
  • 85
  • 8
  • 1
    Operations on polynomials are carried out using exact arithmetic, so inexact numbers (floats and bigfloats) are converted to exact numbers (integers and rationals) before going any further. My advice is to work with exact numbers as much as possible, and convert to inexact, via `float` and/or `numer`, only at the end. – Robert Dodier Feb 20 '22 at 00:38
  • Thanks @RobertDodier, I received a similar advice through a github issue. I will modfy my function to work with exact numbers. – vram Feb 21 '22 at 14:13
  • Thanks to your comments and the comment of Günter Koeningsman on github I managed to modify my functio to work with the rationalized result of maxima and at least for now is working, so, how can I give you the punctuation here? – vram Feb 22 '22 at 09:37
  • 1
    No need for points, I'm glad to hear it's working for you. – Robert Dodier Feb 22 '22 at 16:50
  • Well, Thanks again for your help. – vram Feb 22 '22 at 19:56

0 Answers0