vram
vram

Reputation: 103

How to do a partial fractions expand of an equation with wxMaxima that has several non integer coefficients

how are you?.

I'm having a problem to do a partial fraction expand in wxMaxima, I have the following equation which has several non integer coefficients

        3.63353804840429*10^-8*z^2-7.322452324955847*10^-8*z+3.687492572586066*10^-8
X(z) =  ----------------------------------------------------------------------------
                     1.0*z^2-1.999945180935844*z+0.9999451809358438

when I try to do a partfrac of that equation then wxMaxima simply doesn't do it as it can be seen bellow

Salida de partfrac

I know that at least the denominator has real roots because when I apply a solve then the result has two real roots very close to one like is seen bellow

float(solve(denom(PIDz))));
(%o185) [z=0.9999451810050616,z=0.9999999999307788]

I think the problems is due to the non integer coefficients or due to decimal quantity but I don't know how to solve it.

How can this be solved?.

Update 15/01/22:

The initial equation of my post is the calculated equation for making a PID control for the following plant (the following equation was obtained with Scilab)

              79.728153*z+79.433306
          -----------------------------
            z^2-1.9889465*z+0.9889465

Update 17/01/21:

Following the method teached by @Robert Dodier but with x(z) then I found the relation between the coefficients of the denominator of x(z), then I replace those coefficients with algebraic ones like follows

dd1: z^2 - (cd - 2)*z + cd;
(dd1)  z^2-(cd-2)*z+cd

nn1: nn1: an*z^2 + bn*z + cn;
(nn1)  an*z^2+bn*z+cn

nn1/dd1;
(%o3) (an*z^2+bn*z+cn)
     -------------------
      (z^2-(cd-2)*z+cd)

partfrac (nn1/dd1, z);
%o4   (an*cd+bn-2*an)*z+cn-an*cd)
     -----------------------------  + an
           (z^2-(1 + cd)*z+cd)

I've tested it with several combinations in the numerator, I mean, first order equation and second order equation having all coefficients on the numerator without any relation between them. After that and having found the relation between the coefficients of the denomintaror being the coefficient of the first order term (cd - 2) with cd being the independent term, I obtained the above %o4. That exactly the same result form that is obtained numerically like is seen in the image "Salida de partfrac"

That is, when maxima find that kind of equation in the denominator then it doesn't factorize the denominator.

Thanks in advance for the help.

Upvotes: 1

Views: 225

Answers (1)

Robert Dodier
Robert Dodier

Reputation: 17585

I can't tell what's going on from what you were saying. My advice at this point is to repost in es.stackoverflow.com and I'll try again; I can read and write Spanish. I'm thinking you will able to express the problem more clearly.

Anyway here's how far I got with the equation from Scilab. I don't know if this is useful.

(%i2) dd:z^2-1.9889465*z+0.9889465;
                   2
(%o2)             z  - 1.9889465 z + 0.9889465
(%i3) dd1: z^2 - (1 + cd)*z + cd;
                       2
(%o3)                 z  - (cd + 1) z + cd
(%i4) nn:79.728153*z+79.433306;
(%o4)                79.728153 z + 79.433306
(%i5) nn1: bn*z + cn;
(%o5)                       bn z + cn
(%i6) nn1/dd1;
                           bn z + cn
(%o6)                 --------------------
                       2
                      z  - (cd + 1) z + cd
(%i7) partfrac (nn1/dd1, z);
                 cn + bn cd           cn + bn
(%o7)         ----------------- - ----------------
              (cd - 1) (z - cd)   (cd - 1) (z - 1)
(%i8) factor (dd1);
(%o8)                   (z - 1) (z - cd)

This last bit, %o8, shows the denominator has a unit root. Does that cause complications for you?

I replaced 0.9889465 by cd and then 1.9889465 by 1 + cd -- if there are any other know relations between coefficients, it's good to use them. I don't see any relations for the other coefficients, so I just replaced them with bn and cn. The intent is to do any manipulations, then replace the constants cd, bn, cn with their numerical values.

How was the result from Scilab derived? I'm thinking maybe that should be done symbolically or at least with rational numbers also.

EDIT: Here's the result I get after trying again. The one difference between this result and the one shown by OP in the edit dated 17/01/21 (I guess that must be 17/01/22) is in dd1 -- I think the coefficient of z should be -(1 + cd), not 2 - cd.

(%i2) dd1: z^2 - (1 + cd)*z + cd;
                       2
(%o2)                 z  - (cd + 1) z + cd
(%i3) nn1: an*z^2 + bn*z + cn;
                            2
(%o3)                   an z  + bn z + cn
(%i4) nn1/dd1;
                           2
                       an z  + bn z + cn
(%o4)                 --------------------
                       2
                      z  - (cd + 1) z + cd
(%i5) factor(dd1);
(%o5)                   (z - 1) (z - cd)
(%i6) partfrac (nn1/dd1, z);
                     2
           cn + an cd  + bn cd     cn + bn + an
(%o6)      ------------------- - ---------------- + an
            (cd - 1) (z - cd)    (cd - 1) (z - 1)

Upvotes: 0

Related Questions