ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 12 Oct 2012 05:22:01 +0200How to use associated legendre polynomials in sage?https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/Hey, I'm trying to make a symbolic expression (function) that depends on associated lengendre polynomials. For this I'm using the maxima module/interface. When I do something like
maxima.assoc_legendre_p(2,0,x)
I get the correct output. But when I try something like the following
lp(l,m,x) = maxima.assoc_legendre_p(l,m,x)
and then `lp(2,0,3)` all I get is "assoc_legendre_p(2, 0, 3)". So it's not understanding the "assoc_legendre_p" part, it takes it as many symbols. How could I achieve this? Thanks.
PS: The actual expression is more complicated than that, but to makes thing simple I used a basic example.
Fri, 12 Oct 2012 01:52:12 +0200https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/Answer by twch for <p>Hey, I'm trying to make a symbolic expression (function) that depends on associated lengendre polynomials. For this I'm using the maxima module/interface. When I do something like</p>
<pre><code>maxima.assoc_legendre_p(2,0,x)
</code></pre>
<p>I get the correct output. But when I try something like the following</p>
<pre><code>lp(l,m,x) = maxima.assoc_legendre_p(l,m,x)
</code></pre>
<p>and then <code>lp(2,0,3)</code> all I get is "assoc_legendre_p(2, 0, 3)". So it's not understanding the "assoc_legendre_p" part, it takes it as many symbols. How could I achieve this? Thanks.</p>
<p>PS: The actual expression is more complicated than that, but to makes thing simple I used a basic example.</p>
https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/?answer=14136#post-id-14136I do not really know what your intension is, but if you define your lp as a function call, then everything works fine for me:
show(maxima.assoc_legendre_p(2,0,x))
show(maxima.assoc_legendre_p(2,0,3))
and
def k(l,m,n):
return maxima.assoc_legendre_p(l,m,n)
show(k(2,0,x))
show(k(2,0,3))
produces the same aoutput for me. Maybe this already helps you?
Honestly I didn't really understand the problem with your call. Probably maxima returns other object types when you enter symbolic expressions and it is not possible anymore to evaluate this expression. Maybe somebody else can explain us the problem...Fri, 12 Oct 2012 05:22:01 +0200https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/?answer=14136#post-id-14136Answer by ijpulidos for <p>Hey, I'm trying to make a symbolic expression (function) that depends on associated lengendre polynomials. For this I'm using the maxima module/interface. When I do something like</p>
<pre><code>maxima.assoc_legendre_p(2,0,x)
</code></pre>
<p>I get the correct output. But when I try something like the following</p>
<pre><code>lp(l,m,x) = maxima.assoc_legendre_p(l,m,x)
</code></pre>
<p>and then <code>lp(2,0,3)</code> all I get is "assoc_legendre_p(2, 0, 3)". So it's not understanding the "assoc_legendre_p" part, it takes it as many symbols. How could I achieve this? Thanks.</p>
<p>PS: The actual expression is more complicated than that, but to makes thing simple I used a basic example.</p>
https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/?answer=14135#post-id-14135Oh sorry, this was already in the official documentation I just misread it.
http://www.sagemath.org/doc/reference/sage/functions/orthogonal_polys.htmlFri, 12 Oct 2012 05:11:58 +0200https://ask.sagemath.org/question/9414/how-to-use-associated-legendre-polynomials-in-sage/?answer=14135#post-id-14135