[Maxima] Can't use the result of solve() to define a function

Takahashi Hideo2 hideo.at.yokohama at gmail.com
Thu May 6 11:26:36 CDT 2010


Hi list,

I want to do some coordinate transformation between (x,y) and (η,ξ)
For a simple try, I want to map a triangle (x1,y1) - (x2,y2) - (x3,y3) to
{(η,ξ) | η>=0, ξ >=0, η+ξ <= 1}
This appears in beginner-level finite element method problems.

What I have tried is as follows.

    p1:[x1,y1] $ p2:[x2,y2] $ p3:[x3,y3] $

    p(η,ξ):=p1+η*(p2-p1)+ξ*(p3-p1);   /* This maps from (η,ξ) to (x,y).  I
want to make an inverse of this */

    eqnx : x = p(η,ξ)[1];

    eqny : y = p(η,ξ)[2];

    results:solve([eqnx, eqny], [η,ξ]);

    rhs(results[1][1]);                  /* This gives me what I want as the
definition of Nη(x,y) */

    Nη(x,y) := rhs(results[1][1]);   /* But this does not define a function
that I want */

I am using maxima 5.20.1 on Ubuntu Linux.

In the above specific case the mapping from (η,ξ) to (x,y) is linear,
so using matrices is one solution, but I also want to try out mappings that
are
non-linear so I want to use solve to get the inverse function.

-- 
Hideo at Yokohama
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20100507/f26e6f2e/attachment.html>


More information about the Maxima mailing list