Substitution in a function



Hi Valerij

On Tue, 2002-09-24 at 03:44, Valerij Pipin wrote:
> I guess the following is what you need
> 
> (C6) block(f[0]:u-v+3*w, for i:1 thru 2 do 
> f[i]:''sublis([u=v,v=w,w=u],f[i-1]));
> (D6)                                 DONE
> (C7) [f[0],f[1],f[2]];
> (D7)               [3 w - v + u, - w + v + 3 u, w + 3 v - u]
> (C8)
Thanks. This is exaclty what I was looking for.

Cheers
Neilen

> On Tuesday 24 September 2002 09:05, Neilen wrote:
> > Hi.
> >
> > I'm trying to permute some functions w.r.t. the variables they are
> > using.
> >
> > For example, I have a function
> >
> > (C93) f:u-v+3*w;
> >
> > (D93) 				  3 w - v + u
> >
> > then, I "rotate" the vars like this:
> >
> > (C94) f:f,u=v,v=w,w=u;
> >
> > (D94) 				 - w + v + 3 u
> > which is what I want.
> >
> > But how can I achive it within a function.  If I go
> >
> > func(p):=( .. stuff ...
> > 	f:u-v+3*w,
> > 	... stuff ..
> > 	f:f,u=v,v=w,w=u,
> > 	... stuff that uses the new f...
> > )
> >
> > the substitutions seem to have no effect.  The subst functions seems
> > only to allow one substitution at a time, so I can't use it, it seems.
> >
> > Help appreciated
> >
> > Thanks
> > Neilen
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
-- 
all we are waiting for is something worth waiting for
		   		   --- KMFDM