[SciPy-user] symbolic math & scipy (& maxima)...

fred fredantispam at free.fr
Mon Aug 7 15:34:06 CDT 2006


Gael Varoquaux a écrit :

>     I was talking about Xavier's idea: do step 1 and 2 as he says, and
> use weave.inline to use the c code generated by mathematica.
Ok, I understand better.
But maxima only generates fortran code.
A little tricky (quick'n'dirty) but it works fine now :

def Lmnp(x,y,z,m,n):
  cmd = "maxima -r
'load(\"specfun\")$fortran(diff(assoc_legendre_p("+str(n)+','+str(m)+",cos(theta)),theta))$\n'
| grep -v 'Maxima\|%' | tr [A-Z] [a-z] | sed 's!theta!theta(x,y,z)!g'"
  foo = getoutput(cmd)
  return(eval(foo))

Thanks all.

-- 
Fred.


More information about the SciPy-user mailing list