Newbie Question



Maybe something like my function "squash" does what you want?

(%i16) squash(e,s) := block([p : ratnumer(e), q : ratdenom(e), lc],
   q : ratexpand(q,s),
   lc : ratcoef(q,s,hipow(q,s)), /* leading coefficient */
   ratexpand(p / lc) / ratexpand(q / lc))$

(%i17) (a * s^2 + s + 1)/(b * s^3 + s +1)$

(%i18) squash(%,s);
(%o18) ((a*s^2)/b+s/b+1/b)/(s^3+s/b+1/b)

Barton

maxima-bounces at math.utexas.edu wrote on 11/10/2009 06:41:18 PM:

> [image removed] 
> 
> [Maxima] Newbie Question
> 
> Jim scott 
> 
> to:
> 
> maxima
> 
> 11/11/2009 12:43 PM
> 
> Sent by:
> 
> maxima-bounces at math.utexas.edu
> 
> I am an electrical engineer newly trying out Maxima to manipulate 
> control system and filter equations.  Part of the manipulation is to
> form the equation into an "engineer readable" format.  The following
> has me stumped (b subscript n is written b_n):
> 
> Given an equation of the form
> (b_n*s^n + b_(n-1)*s^(n-1) + .... b_1*s + b_0) / (a_n*s^n + a_(n-1)
> *s^(n-1) + .... a_1*s + a_0),
> how would I go about dividing the numerator and denominator by a_n 
> (such that the s^n term in the denominator is always multiplied by 1)?
> Neither a_n nor the value of n is known beforehand.
> 
> I have spent several hours trying to find Maxima operators to 
> perform the needed division (or supportive operations) and am not 
> finding what I need.
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima