Possibility/ease of doing some vector ops in Maxima
Subject: Possibility/ease of doing some vector ops in Maxima
From: Richard Fateman
Date: Sun, 22 Sep 2002 19:56:43 -0700
I'm not sure of the rest of the suggestion, but
tellsimpafter needs to be spelled better!
RJF
Neilen wrote:
> Hi Barton
>
> On Thu, 2002-09-19 at 03:00, willisb@unk.edu wrote:
>
>>
>>Instead of grad, try using diff without a second argument.
>>Used this way, diff works like a total derivative operator:
>>
>> diff(f(x,y)) = diff(f(x,y),x) * del(x) + diff(f(x,y),y) * del(y).
>>
>>First, tell Maxima that del(p) is zero.
>>
>>(C1) tellsimpafer(del(p),0);
>>(D1) tellsimpafer(DEL(p),0)
>>
>>Second, compute the total derivative
>>
>>(C2) f : diff(L_1*L_2*(L_1-L_2)^(p-1));
>>(D2) (L_1*(L_1-L_2)^(p-1)-(p-1)*L_1*(L_1-L_2)^(p-2)*L_2) * DEL(L_2)
>> +((L_1-L_2)^(p-1)*L_2+(p-1)*L_1*(L_1-L_2)^(p-2)*L_2)*DEL(L_1)
>>
>
> When I try this, I get the following:
>
> (C309) tellsimpafer(del(p),0);
> (D309) tellsimpafer(DEL(p), 0)
> (C310) f : diff(L_1*L_2*(L_1-L_2)^(p-1));
> L_1*LOG(L_1-L_2)*(L_1-L_2)^(p-1)*L_2*DEL(p)+(L_1*(L_1-L_2)^(p-1)-
> L_1*(L_1-L_2)^(p-2)*L_2*(p-1))*DEL(L_2)+(L_1*(L_1-L_2)^(p-2)*L_2*(p-1)+
> (L_1-L_2)^(p-1)*L_2)*DEL(L_1)
>
> I assume the tellsimpafer command is not doing quite the right thing?
>
> Thanks
> Neilen
>
>
>>If you want grad instead of del, use subst
>>
>>(C3) f : subst(grad,del,f);
>>(D3) (L_1*(L_1-L_2)^(p-1)-(p-1)*L_1*(L_1-L_2)^(p-2)*L_2) * GRAD(L_2)
>> +GRAD(L_1)*((L_1-L_2)^(p-1)*L_2 +(p-1)*L_1*(L_1-L_2)^(p-2)*L_2)
>>
>>To extract the coefficients of grad(L_1), etc, use expand followed
>>by coeff
>>
>>(C4) f : expand(f);
>>(D4) -p*L_1*(L_1-L_2)^(p-2)*L_2*GRAD(L_2)
>> +L_1*(L_1-L_2)^(p-2)*L_2*GRAD(L_2)
>> +L_1*(L_1-L_2)^(p-1)*GRAD(L_2)
>> +GRAD(L_1)*(L_1-L_2)^(p-1)*L_2
>> +p*L_1*GRAD(L_1)*(L_1-L_2)^(p-2)*L_2
>> -L_1*GRAD(L_1)*(L_1-L_2)^(p-2)*L_2
>>(C5) [coeff(f, grad(L_1)), coeff(f,grad(L_2))];
>>
>>(D5) [(L_1-L_2)^(p-1)*L_2+p*L_1*(L_1-L_2)^(p-2)*L_2
>> -L_1*(L_1-L_2)^(p-2)*L_2,
>> -p*L_1*(L_1-L_2)^(p-2)*L_2+L_1*(L_1-L_2)^(p-2)*L_2
>> +L_1*(L_1-L_2)^(p-1)]
>>(C6)
>>
>>
>>Maybe this helps?
>>
>>Barton
>>
>>
>>
>>
>>_______________________________________________
>>Maxima mailing list
>>Maxima@www.math.utexas.edu
>>http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>>