Simplification of vector norms, logs and fractions
Subject: Simplification of vector norms, logs and fractions
From: Stavros Macrakis
Date: Sat, 8 Oct 2011 13:24:13 -0400
Sometimes ratsubst(RR^2,x^2+y^2,...) will help in cases like this, but not
here -- it is "overenthusiastic".
How about map(factor,%o3) then subst(RR^2,x^2+y^2,%)
Then you can wrangle it into the form you want with things like
multthru(rat(%,xi,yi)) etc.
Another way:
part(%o3,3)$
args(multthru(%)) -- want to process each term separately
ratsubst(RR,x^2+y^2,%)
map(multthru,%)
xreduce("+",%) -- put terms together again
Not exactly the form you wanted, but close, and you could certainly do
further manipulations.
I'm using RR so that you won't have issues with R being expanded out at
later stages, but you could also use 'R if you're careful.
-s
On Thu, Oct 6, 2011 at 06:30, Freddie Witherden <freddie at witherden.org>wrote:
> R : matrix([x],[y]); ri : matrix([xi],[yi]);