The problem is that the csetup function is interactive, and as far as I can
tell, there is no clear documentation on how to perform the same setup
non-interactively. Like many "convenience" features, this makes it more
difficult to work programmatically.
What I recommend you do is read the csetup function (using grind('csetup) )
and simply set things up directly. At first approximation, this is
something like:
my_csetup(cdim,cdimnames) := block([],
tensorkill:false,
setflags(),
dim: cdim,
ct_coords: cdimnames,
etc.etc.
)
Then call my_csetup(3,'[x,y,z], ...). Or simply put the assignments in a
batch file.
In fact, I'd recommend you refactor csetup to separate its interactive
functions from its error-checking and default handling so that the
interactive and the programmatic versions share that code. The current
approach is vomit-worthy (like some of my own from the 1970's, no doubt).
Thanks for your patience with the quirks of Maxima!
-s
PS Please correspond with the whole Maxima list on things like this. I
didn't notice that you'd taken the list off the mail thread -- there are
definitely people who know much more about ctensor and wxMaxima than me.
On Tue, Dec 20, 2011 at 10:53, Olaoluwa Omokanwaiye <laoluomoks at gmail.com>wrote:
> Thanks Starvos,
>
> I have inserted a ctensor example that i ran and saved, however i tried
> reloading using batch and batchload commands which worked for simple
> problems.
> However when i tried loading a saved ctensor calculation like the one
> beneath with batch, it required me entering the dimensions and coordinates
> and other inputs to other questions all over again. How can this be avoided?
> Cant Maxima just reload the whole thing I had typed previously?
>
> Beneath is a sample ctensor example I ran to replreoduce
> command used in trying to reload is batch "where .wxm file is saved"; this
> loaded the file alright but i have to start input values all over again
> which i think can be avoided
>
> Thanks and Kind regards
> Ola
>
> (%i1) load(ctensor);
> (%o1) /share/tensor/ctensor.mac
> (%i2) csetup();
> Enter the dimension of the coordinate system:
> 4;
> Do you wish to change the coordinate names?
> n;
> Do you want to
> 1. Enter a new metric?
>
> 2. Enter a metric from a file?
>
> 3. Approximate a metric with a Taylor series?
> 1;
>
> Is the matrix 1. Diagonal 2. Symmetric 3. Antisymmetric 4. General
> Answer 1, 2, 3 or 4
> 1;
> Row 1 Column 1:
> a;
> Row 2 Column 2:
> x^2;
> Row 3 Column 3:
> x^2*sin(y)^2;
> Row 4 Column 4:
> -d;
>
> Matrix entered.
> Enter functional dependencies with the DEPENDS function or 'N' if none
> depends([a,d],x);
> Do you wish to see the metric?
> y;
> [ a 0 0 0 ]
> [ ]
> [ 2 ]
> [ 0 x 0 0 ]
> [ ]
> [ 2 2 ]
> [ 0 0 x sin (y) 0 ]
> [ ]
> [ 0 0 0 - d ]
> (%o2) done
> (%i3) christof(mcs);
> a
> x
> (%t3) mcs = ---
> 1, 1, 1 2 a
>
> 1
> (%t4) mcs = -
> 1, 2, 2 x
>
> 1
> (%t5) mcs = -
> 1, 3, 3 x
>
> d
> x
> (%t6) mcs = ---
> 1, 4, 4 2 d
>
> x
> (%t7) mcs = - -
> 2, 2, 1 a
>
> cos(y)
> (%t8) mcs = ------
> 2, 3, 3 sin(y)
>
> 2
> x sin (y)
> (%t9) mcs = - ---------
> 3, 3, 1 a
>
> (%t10) mcs = - cos(y) sin(y)
> 3, 3, 2
>
> d
> x
> (%t11) mcs = ---
> 4, 4, 1 2 a
> (%o11) done
>
>
> On Tue, Dec 20, 2011 at 1:23 AM, Stavros Macrakis <macrakis at alum.mit.edu>wrote:
>
>> Dear Olaoluwa,
>>
>> You still have not given us enough information to ***reproduce*** your
>> problem. Without that, it is difficult to help you.
>>
>> Why do you think your problem is related to tensors? Do you have a
>> minimal example of a case without tensors which works correctly and one
>> with tensors which does not? What ***exactly*** are the commands you used?
>>
>> -s
>>
>>
>> On Mon, Dec 19, 2011 at 16:57, Olaoluwa Omokanwaiye <laoluomoks at gmail.com
>> > wrote:
>>
>>>
>>>> Dear Savros
>>>
>>>> It will help us figure out what the problem is if you tell us *exactly
>>>> what you did. * What commands did you use to create the "saved
>>>> session"? What commands did you use to "reload the saved session"?
>>>>
>>>
>>> I used wxMaxima -frontend to Maxima ( save icon to save and folder
>>> icon to reload, then typed the batchload command)
>>>
>>>>
>>>> The problem report should be *reproducible* and *self-contained *i.e.
>>>> not depend on previous things you did. Ideally, it should also be *
>>>> minimal* i.e. it should not include extraneous details.
>>>>
>>>> It would also be useful if you told us *exactly what system* you are
>>>> using -- there may be bugs in some versions but not others. You mention
>>>> WxMaxima on Mac and Linux. What version of WxMaxima? What version of
>>>> Maxima? What version of the Mac or Linux OS?
>>>>
>>>> Linux Distro and wxMaxima Version is: Knoppix 6.0 and wxMaxima 0.8.5
>>> and Maxima 5.22.1 respectively
>>>
>>> Mac Version and wxMaxima Version is: Mac OS X Snow Leopard and wxMaxima
>>> 11.08.0 and Maxima 5.25.1 (most recent)
>>>
>>>
>>> Please let me know if there are bugs in any of these versions. ctensor
>>> equations require my inputting all over again after reloading. Is this
>>> normal?
>>>
>>>> Thanks,
>>>>
>>> Ola
>>>
>>>>
>>>> -s
>>>>
>>>>
>>>> On Fri, Dec 16, 2011 at 16:48, Olaoluwa Omokanwaiye <
>>>> laoluomoks at gmail.com> wrote:
>>>>
>>>>> Hi Richard, thanks for your prompt reply.
>>>>> While working on a Mac and Linux system, reloading a saved session
>>>>> still requires retyping whole equations all over again or supplying
>>>>> coefficients(e.g for tensor worksheets)
>>>>>
>>>>> Is it not possible to recover all I typed and saved previously?
>>>>>
>>>>> Kind regards
>>>>> Ola
>>>>>
>>>>> On 12/16/11, Richard Fateman <fateman at eecs.berkeley.edu> wrote:
>>>>> > On 12/16/2011 3:42 AM, Olaoluwa Omokanwaiye wrote:
>>>>> >> Hello Friends:
>>>>> >>
>>>>> >> Hope this mail meets you well.
>>>>> >> Pleased to be a part of the mailing list to learn and contribute.
>>>>> >>
>>>>> >> Please can anyone provide assistance with recovering saved worksheet
>>>>> >> on WxMaxima without having to retype previous work all over again.
>>>>> >>
>>>>> >> I observed that anytime i saved my work and tried to work on it
>>>>> later
>>>>> >> I have to do alot of retyping of the whole thing i had saved, which
>>>>> is
>>>>> >> rather cumbersome.
>>>>> >>
>>>>> >> I believe there are more efficient ways to do this.
>>>>> >> Please help!! :)
>>>>> >>
>>>>> >> Thanks
>>>>> >> Ola
>>>>> >> _______________________________________________
>>>>> >> Maxima mailing list
>>>>> >> Maxima at math.utexas.edu
>>>>> >> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>>> >
>>>>> > Type your commands into a file, then use batch(file).
>>>>> >
>>>>> > or use save() and load().
>>>>> >
>>>>> > What did you try?
>>>>> >
>>>>> >
>>>>> >
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> laolu omokanwaiye
>>>>> _______________________________________________
>>>>> Maxima mailing list
>>>>> Maxima at math.utexas.edu
>>>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> laolu omokanwaiye
>>>
>>>
>>
>
>
> --
>
> laolu omokanwaiye
>
>