Dear Soujiro:
First of all, you don't need csetup() to use ctensor. On the contrary,
csetup() is just a simple interactive helper function that supposedly helps
novice users of ctensor set up a simple metric. It doesn't do anything that
you cannot do with more direct commands.
The failure occurs because csetup() is interactive, so it really only works
reliably in command-line Maxima and it is known to fail in some front-ends.
What happens is that csetup() sends a prompt, but this prompt is buffered by
the front end and not displayed. Thinking that nothing happened, you are
entering csetup(); again when in fact csetup() is already running and it
expects a number. First, this results in a recursive call to csetup() (so
you get the error message telling you to use kill(all) and tensorkill:true);
second, as this call to csetup() fails to return an integer, the original
call to csetup() complains and gives up. But the real problem has nothing to
do with kill or tensorkill or indeed, with csetup(); it is the front-end's
failure to show the prompt that csetup() sends when it requests input.
You can actually work around this if you know what prompt is about to be
displayed. For instance, after entering csetup();, you can blindly enter the
lines
4;
y;
[t,r,theta,phi];
1;
1;
1-rs/r;
-1/(1-rs/r);
-r^2;
-r^2*sin(theta)^2;
n;
y;
and set up the Schwarzschild metric. But you could just as easily not use
csetup() at all, and instead enter the metric directly:
load(ctensor);
dim:4;
ct_coords:[t,r,theta,phi];
lg:zeromatrix(4,4);
lg[1,1]:1-rs/r;
lg[2,2]:-1/(1-rs/r);
lg[3,3]:-r^2;
lg[4,4]:-r^2*sin(theta)^2;
(NB: The dim:4 command is unnecessary, as 4 is the default.)
In other words, you don't have to use csetup(). Indeed, it adds very little
value to the ctensor package, and because of the issues of compatibility
with front-ends, I more than once felt tempted to remove it from ctensor
altogether.
If you wish to use csetup() anyway, please try using it from command-line
Maxima.
One thing I do recommend is demo(tensor), by the way. It contains a large
number of examples that exercise almost all the functionality present in the
tensor packages.
Viktor
-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Soichi Ishida
Sent: Sunday, April 12, 2009 6:54 AM
To: maxima at math.utexas.edu
Subject: errors in ctensor and csetup
environment: latest ubuntu, latest emacs, latest maxima
I have a problem settin up "ctensor".
generally, we first load...
load(ctensor);
the output is "done". this is fine.
but next is...
csetup();
gives nothing, no output but gets to the next line (no input signe either).
so I type
csetup();
again, then I would get...
----------------------------------------
(%i2) csetup();
csetup();
(*) \verb| Enter the dimension of the coordinate system:|\linebreak[0]
Type KILL(ALL); and then TENSORKILL:TRUE;
before you enter a new metric.
#0: csetup()(ctensor.mac line 208)
#1: readvalue(message=Enter the dimension of the coordinate
system:,pred=lambda([v],if integerp(v) then
block([u:v],mode_declare(u,fixnum),if u > 0 then true)),badboy=["Must be a
positive integer!"])
#2: csetup()(ctensor.mac line 213)
-- an error. To debug this try debugmode(true);
(%i3)
----------------------------------------
well, I have tried as instructed.
kill(all);
tensorkill(true);
and
load(ctensor);
again. but nothing has been improved.
it says about "debugmode" but I am not sure how to use it.
Could someone help me on this problem.
soujiro
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima