[Maxima] Simplification rules

Suresh Jeevanandam jm.suresh at gmail.com
Fri Nov 30 14:10:17 CST 2007

```Hello all,

I am computing a transfer function which looks like this:

(%i1) H : k * (1+s/wz1)* (1+s/wz2)/ ((1+s/wp1)*(1+s/wp2)*(1+s/wp3));
s         s
k (--- + 1) (--- + 1)
wz1       wz2
(%o1)                    -----------------------------
s         s         s
(--- + 1) (--- + 1) (--- + 1)
wp1       wp2       wp3

Lets say this expression is computed from some expression, then the way it
gets printed looks like this:
(%i3) h : ratsimp(H);
(%o3) ((k wp1 wp2 wp3 wz1 + k s wp1 wp2 wp3) wz2 + k s wp1 wp2 wp3 wz1
2                                          2                  2
+ k s  wp1 wp2 wp3)/((((wp1 + s) wp2 + s wp1 + s ) wp3 + (s wp1 + s ) wp2
2        3
+ s  wp1 + s ) wz1 wz2)

(%i5) factor(h);
k wp1 wp2 wp3 (wz1 + s) (wz2 + s)
(%o5)                -------------------------------------
(wp1 + s) (wp2 + s) (wp3 + s) wz1 wz2

I want to print as in %o1 . factor() comes close to it. Please suggest if
there is a way.

If there is no other way, I am thinking of looping through the factors and
solving each factor to s equating to zero thus finding all w;s. Then to
construct back the rational I would want the tool to not simplify anything
and keep it in the way I create the product and sum terms. Is there anyway
to do this?
i.e. If for example, I enter, x: a*a, I do not want this to get simplified
to a^2, but just be a*a unaltered.