Dieter Kaiser | 1 Dec 2008 01:02
Picon

Small problem with the value of niceindicespref after running the testsuite

After a run of the testsuite the value is of niceindicespref is no longer
[i,j,k,l,m,n] but has the value [888,j,k,l,m,n]. When you start a second run of
the testsuite you can observe this error too.

When you later would like to use the function niceindices you can get a system
hang or very strange results.

The reason is that within the testsuite the value of niceindecespref is restored
with reset(niceindicespref). But at this point of the file the symbol i has the
value 888 which is inserted in the list. 

To get the correct list for niceindicespref we have first to kill the value of
the symbol i. Then it works and niceindicespref has again the correct default
value.

Perhaps it might be even better to explicitly set the value of niceindicespref
to the default value with niceindicespref:['i,'j,'k,'k,'l,'m,'n], because
someone else might give one of the symbols a value and the list of symbols would
be again destroyed.

Dieter Kaiser
Edwin Woollett | 1 Dec 2008 01:55
Favicon

Re: compute integral with Maxima

thanks to dan for the reference.

the problem is then
g(x) := exp( -( (a-b*cos(x))^2 + (c-b*sin(x))^2 ) );
integrate((g(x))^2, x, 0, 2*%pi);
or
integrate(exp( - 2* (a-b*cos(x))^2 -2*(c-b*sin(x))^2 ),x,0,2*%pi );

with the answer
2*%pi*%e^(-2*c^2-2*b^2-2*a^2)*I0(4*b*sqrt(c^2+a^2)),

with I0(x) the same as bessel_i(0,x).

A solution which avoids looking up trig identities, but
has to use exp(z*cos(th)) expansion in terms of
I(k,z) from Abramowitz and Stegun 9.6.34, page 376,
(Dan's reference):

(%i1) display2d:false$

arge is argument of the exponential in the integrand

(%i2) arge:(-2*(c-b*sin(x))^2 -2*(a-b*cos(x))^2 ,trigsimp(%%));
(%o2) 4*b*c*sin(x)+4*a*b*cos(x)-2*c^2-2*b^2-2*a^2

exp(arge1) comes outside the integral
(%i3) arge1:rest(arge,2);
(%o3) -2*c^2-2*b^2-2*a^2

the other factor is exp(arge2) which remains to
(Continue reading)

Viktor T. Toth | 1 Dec 2008 04:58
Favicon

Re: ctensor: compute Ricci rotation coefficients

Dear Ivan,

I quite agree with you, the documentation could use more detail. I know because I also get confused
sometimes when I use my own tensor code! My excuse is that it was a lot worse in the past...

Meanwhile, I do recommend that, if you have not yet done so, you peruse the numerous tensor examples that I
included (do demo(tensor) in Maxima to see a menu), and also the draft paper that I have at
http://arxiv.org/abs/cs/0503073, which provides more details.

By the way, the reason trrc is not documented is that it is really meant to be an internal function; the
user-level function to compute the rotation coefficients is the same christof() that is used to compute
the Christoffel symbols in a coordinate base.

Viktor

-----Original Message-----
From: Ivan Zolotukhin [mailto:ivan.zolotukhin <at> gmail.com] 
Sent: Sunday, November 30, 2008 12:58 PM
To: Viktor T. Toth
Cc: maxima <at> math.utexas.edu
Subject: Re: [Maxima] ctensor: compute Ricci rotation coefficients

Viktor,

Many thanks, that's simply great. I managed to reproduce everything
and now will try to make more complex things in 4D. May I suggest to
add some notes in the documentation for the newbies to feel more
comfortable when dealing with ctensor:

- fri should be array of Cartesian 1-forms, it was not straightforward
(Continue reading)

Robert Dodier | 1 Dec 2008 06:07
Picon

Re: how to define mathematical operators?

On 11/30/08, José Antonio Vallejo <jose.a.vallejo <at> prodigy.net.mx> wrote:

>  (%o3) H(V):=lambda([f],diff(f(x),x)+V*f(x))
>  (%i4) H(W) <at> lambda([x],%psi(x));
>  (%o4) %psi(x)*V+'diff(%psi(x),x,1)

The reason V appears instead of W is that the arguments of lambda
are never evaluated until the lambda expression is applied to some
argument. The construction buildq([V], lambda(whatever, V*foo))
interpolates the actual value of V into the lambda expression,
without evaluating it.

I'm always heartened to see people using Maxima for real work --
thanks for telling us about it.

best

Robert Dodier
Robert Dodier | 1 Dec 2008 07:48
Picon

5.17 release branch tagged in cvs; trouble w/ texinfo output

Hello,

I've tagged release-5_17-base and RELEASE-5_17-BRANCH in cvs.

I'm having trouble with the build -- looks like the English-language
maxima.info* files are generated but they are not put into the tarball
by make dist-gzip. (However the foreign-language maxima.info* files
are in the tarball. Also imaxima.info and xmaxima.info are there.)

rpmbuild -ba ./maxima.spec fails with error messages about the
texinfo stuff; probably fixing the problem above would make this
problem go away.

Can someone figure out how to get the maxima.info* files into the tarball?

Thanks for your help,

Robert Dodier
Robert Dodier | 1 Dec 2008 07:52
Picon

Re: new to_poly_solver

On 11/29/08, Viktor T. Toth <vttoth <at> vttoth.com> wrote:

>  I'm attaching a diff for simp.lisp. Please let me know if this suffices.

Viktor, I've applied the patch w/ patch --reverse to revert the
changes to list arithmetic in the 5.17 release branch.

Thanks for your help,

Robert
Robert Dodier | 1 Dec 2008 08:02
Picon

Re: Small problem with the value of niceindicespref after running the testsuite

On 11/30/08, Dieter Kaiser <drdieterkaiser <at> web.de> wrote:

>  The reason is that within the testsuite the value of niceindecespref is restored
>  with reset(niceindicespref). But at this point of the file the symbol i has the
>  value 888 which is inserted in the list.

Well, that's a bug in reset. I think the following 1-line patch fixes it.
I'll probably commit that patch tomorrow.

HTH

Robert Dodier

PS.
--- src/inmis.lisp      19 Jul 2008 15:23:59 -0000      1.12
+++ src/inmis.lisp      1 Dec 2008 06:59:12 -0000
 <at>  <at>  -86,7 +86,7  <at>  <at> 
           (displa `((mtext) "reset: bind " ,key " to " ,displa-val))))
       (nconc actually-reset (list key))
       (let ((munbindp t))
-        (meval `((msetq) ,key ,val))))))
+        (meval `((msetq) ,key ((mquote) ,val)))))))

 (defmspec $reset_verbosely (L)
   (reset-do-the-work (cdr L) t))
nijso beishuizen | 1 Dec 2008 09:38
Picon
Picon

Re: dy(x)/dy - prolongation formula

On Sunday 30 November 2008 22:18:24 Richard Fateman wrote:
> Rather than ask how to implement your traditional, yet ambiguous
> notation on Maxima,  I suggest that you start by changing your notation
> completely to correspond to what is supported in Maxima.

Actually, I'd rather have a piece of code that is self-explanatory and has 
some resemblance to what it mathematically means. 
I've only used maxima for six weeks now so I write functions with what I know 
and improve it later with what I've learned. 

> I think this will then make your problem easy to compute, instead of
> hard to even explain.

I think this problem is not easy to compute and even harder to explain. And 
this is just one simple recursion formula. But you are right that it is 
easier to do both if you write good code.

> For example, Maxima can operate with computational functions, arrays,
> and array functions like n[i](x,y), and infix operations like +, *.
>
> The notation you present using includes operators like Dx  and ',  which
> are not supported.  
I have no idea what you mean. the operator Dx should be a function in maxima, 
and I don't use ' in the example code.

> If you define a function n of one argument, then 
> n()  or just n   is wrong.   
So? n always has one argument, which is k, the integer number of prolongations 
that you want to have. The code doesn't even work yet, so handling wrong 
input is not really an issue yet.
(Continue reading)

Leo Butler | 1 Dec 2008 12:39
Picon
Picon

Re: ctensor: compute Ricci rotation coefficients


On Sun, 30 Nov 2008, Viktor T. Toth wrote:

< Dear Ivan,
< 
< I quite agree with you, the documentation could use more detail. I know because I also get confused
sometimes when I use my own tensor code! My excuse is that it was a lot worse in the past...
< 
< Meanwhile, I do recommend that, if you have not yet done so, you peruse the numerous tensor examples that I
included (do demo(tensor) in Maxima to see a menu), and also the draft paper that I have at
http://arxiv.org/abs/cs/0503073, which provides more details.

Viktor,
Could you include a link or reference to this arxiv paper in maxima's
ctensor documentation, please.

Leo

--

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
José Antonio Vallejo | 1 Dec 2008 04:38
Picon

Re: how to define mathematical operators?

Alexey, Robert:
Thank you very much for your responses!! I am very impressed both for
Maxima's capabilities and for your skills with them.
The definition of the  <at>  operator is very close to that of Wolfram's,
although it seems that it does not allow for an arbitrary potential:

(%i1) infix(" <at> ");
(%o1)  <at> 
(%i2) " <at> "(f,g):=f(g);
(%o2) f  <at>  g:=f(g)
(%i3) H(V):=lambda([f],diff(f(x),x)+V*f(x));
(%o3) H(V):=lambda([f],diff(f(x),x)+V*f(x))
(%i4) H(W) <at> lambda([x],%psi(x));
(%o4) %psi(x)*V+'diff(%psi(x),x,1)

Here I would like to see
%psi(x)*W+'diff(%psi(x),x,1)
with W instead of V. The potential V should work as a parameter.
I suppose that it is possible to change slightly the definiton of H to
make it work, but perhaps there is no need for this as Robert's second
construction does exactly what I need:

(%i5) Hamiltonian(V):=buildq([V],lambda([f],diff(f(x),x)+V*f(x)));
(%o5) Hamiltonian(V):=buildq([V],lambda([f],diff(f(x),x)+V*f(x)))

The result is very impressive...

(%i6) Hamiltonian(V[0])(%psi);
(%o6) 'diff(%psi(x),x,1)+V[0]*%psi(x)
(%i7) %psi(x):=exp(%i*k*x);
(Continue reading)


Gmane