Sort by Frequency



Look at poisson series. The arguments to the sin and cos must be linear,
e.g. 3*u+4*v+5*w ...
not u+u^2,  but maybe you can substitute names for powers.
RJF
 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Dodier
> Sent: Tuesday, December 04, 2007 7:47 AM
> To: Stefan Joeres
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] Sort by Frequency
> 
> On 12/3/07, Stefan Joeres <not_me at gmx.de> wrote:
> 
> > Using trigreduce(y) leads to
> > terms of cos(w1), cos(w2), cos(2*w1+w2) ... and so on.
> > I'd like to sort these terms according to those cos() coefficients.
> 
> The sort function sorts all kinds of expressions.
> 
> sort ([cos(w1 + w2), cos(w2^2), cos(w1), cos(2*w1 + w2), cos(w2)]);
>  => [cos(w1), cos(w2), cos(w2 + w1), cos(w2 + 2 w1), cos(w2^2)]
> 
> Maxima has its own idea about how to order non-atomic expressions.
> If you don't like that order, you can tell sort to use a specific
> comparison function.
> ? sort
> says more about that.
> 
> HTH
> 
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>