Subject: I really don't understand rules and patterns
From: Richard Fateman
Date: Tue, 02 Apr 2013 14:09:07 -0700
Basically, On 4/2/2013 1:25 PM, Daniel Lakeland wrote:
> What is going on here? I want to find sums involving x,y, or z, and an
> index variable, i, j, k and a symbol dq and do something to them. I
> have rules like:
>
1. Of all the names you could choose, perhaps you should not use x twice.
You could say lambda([daniel], member(daniel,'[x,y,z]).
Not that it matters here, I think.
2. The big issue is you are expecting Maxima to do some kind of
exponential exhaustive search
to try to match something you have in mind. It doesn't.
If you want to partition sums and products, you can do so but not the
way you wrote it.
See the paper I wrote and posted a link to, about partitions.
RJF
>
> matchdeclare(var,lambda([x],member(x,'[x,y,z])),
> indx,lambda([x],member(x,'[i,j,k])),
> int,integerp);
>
> defrule(recenteridxsum,var+int*dq+indx*dq,[var+indx*dq,int]);
>
>
> (%i179) recenteridxsum(x+dq*i+dq);
> (%o179) false
>
> This would seem to be wrong. I don't know why it does this though.
>
>
> (%i180) recenteridxsum(x+dq*i);
> (%o180) [x + dq i, 0]
>
>
> this is correct, and is the only case that seems to work. I am confused.
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima