number of variables in a multivariable polynomal ?
Subject: number of variables in a multivariable polynomal ?
From: Richard Fateman
Date: Sat, 15 Dec 2007 08:04:23 -0800
There is a list of all the variables in an expression in the header of an
expression in rat form.
That list might include, in some cases, variables that have been cancelled
out, e.g. rat(x*(y+1)/(xy+y)) will have x and y in it, even though it is 1.
rat(ratdisrep(rat(..)) will fix it, I think.
If e is the rat expression,
?length(?third(?first( e)) says how many vars in e.
Someone may have written a program to do this by much clumsier methods and
put it in some library.
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of S. Newhouse
> Sent: Saturday, December 15, 2007 4:52 AM
> To: maxima at math.utexas.edu
> Subject: number of variables in a multivariable polynomal ?
>
> Hello,
> Is there a function in maxima which will extract the number of
> variables in a user defined polynomial of several variables?
>
> E.g. let's call such a function 'num_vars'.
>
> It should have the property that if
> p= -2*x[1]^3*x[5]^4 + x[1]*x[6]
> then
> num_vars(p)=6
>
> TIA,
> -sen
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>