> Message: 13
> From: "Charles James Leonardo Quarra Cappiello" <charsquarra at hotmail>
> To: maxima@www.ma.utexas.edu
> Date: Tue, 08 Oct 2002 13:51:12 -0400
> Subject: about curvilinear coordinates
>
>
> hi everyone!
>
> im totally new to maxima, buy i've had used maple a couple of times in
> the
> past. But i can't find a way to handle coordinate transformations in
> maxima.
> the manual says that you should feed a TTRANSFORM with a transformation
> matrix, then, what i supposed it meant was this:
>
> (C6) MT:matrix([ diff(x(f,g,h,j),f) , diff( y(f,g,h,j),f ) , diff(
> z(f,g,h,j),f ) , diff( w(f,g,h,j),f) ],[ diff(x(f,g,h,j),g) , diff(
> y(f,g,h,j) ,g) , diff( z(f,g,h,j),g) , diff( w(f,g,h,j),g) ],[
> diff(x(f,g,h,j),h) ,diff( y(f,g,h,j),h ) , diff( z(f,g,h,j),h) , diff(
> w(f,g,h,j),h) ] , [ diff( x(f,g,h,j),j) ,diff( y(f,g,h,j),j) , diff(
> z(f,g,h,j),j) , diff( w(f,g,h,j),j) ] );
> ]
> (C7) coordTrans:TTRANSFORM( MT );
>
> then i want to get the laplacian in one coordinate, ie:
>
> (C9) L(u,x,y,z,w):=diff(u(x,y,z,w),x,2) + diff(u(x,y,z,w),y,2) + diff(
> u(x,y,z,w),z,2) + diff( u(x,y,z,w),w,2) ;
> (D9) L(u, x, y, z, w) := DIFF(u(x, y, z, w), x, 2) + DIFF(u(x, y, z, w),
> y,
> 2) + DIFF(u(x, y, z, w), z, 2) + DIFF(u(x, y, z, w), w, 2)
>
> but now i want to transform to another coordinate system (ie: f,g,h,j ->
> x,y,z,w
>
> for this i specified the actual functions:
>
> (C9) x(f,g,h,j):=cos(f)*sin(g)*sin(h);
> (D9) x(f, g, h, j) := COS(f) SIN(g) SIN(h)
> (C10) y(f,g,h,j):=sin(f)*sin(g)*sin(h);
> (D10) y(f, g, h, j) := SIN(f) SIN(g) SIN(h)
> (C11) z(f,g,h,j):=cos(g)*sin(h);
> (D11) z(f, g, h, j) := COS(g) SIN(h)
> (C12) w(f,g,h,j):=cos(h);
> (D12) w(f, g, h, j) := COS(h)
>
>
> but i dont know what else to do to get the laplacian transformed into the
>
> new coordinate system, please help me out!
>
> Thanks!
Hi.
Maxima is great for vector calculus manipulations in curvilinear
coordinates.
There are probably lots of ways to do it, but an easy one is (say we wanted
to calculate the
Laplacian of a scalar field in spherical polar coordinates):
***---beginning of cut-and-paste from Maxima session---***
GCL (GNU Common Lisp) Version(2.4.0) Wed May 9 12:02:00 CDT 2001
Licensed under GNU Library General Public License
Contains Enhancements by W. Schelter
Maxima 5.6 Wed May 9 12:01:49 CDT 2001 (with enhancements by W. Schelter).
Licensed under the GNU Public License (see file COPYING)
(C1) load(vect);
Warning - you are redefining the MACSYMA function TRIGSIMP
Warning - you are redefining the MACSYMA function IMPROVE
Warning - you are redefining the MACSYMA function UPDATE
(D1) /usr/lib/maxima-5.6/share/vect.mc
(C2) scalefactors([[r*sin(theta)*cos(omega),r*sin(theta)*sin(omega),r*cos(theta)],
r, theta, omega]);
(D2) DONE
(C3) laplacian(v);
(D3) LAPLACIAN v
(C4) express(%);
d dv d 2
dv
(D4) (------ (ABS(SIN(theta)) ------) + -- (r ABS(SIN(theta)) --)
dtheta dtheta dr
dr
dv
ABS(SIN(theta)) ------
d domega 2
+ ------ (----------------------))/(r
ABS(SIN(theta)))
domega 2
SIN (theta)
(C5)
***---end of cut-and-paste from Maxima session---***
I'm not sure where these commands are discussed in the regular
documentation (I found them in an old Macsyma manual), but some
documentation can be found at http://starship.python.net/crew/mike/TixMaxima/MacRef/node115.html.
Dr Geordie McBain
School of Aerospace, Mechanical, & Mechatronic Engineering
The University of Sydney
Darlington, New South Wales, Australia.