ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 27 Feb 2012 20:59:17 -0600How can one use maxima kummer confluent functions in sagehttp://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/Hi, here is my piece of code
var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
which yields
[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.
Thanks in advanceMon, 20 Feb 2012 22:20:27 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/Comment by kcrisman for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20263#post-id-20263I'm not even sure! You can click "edit" to see the previous versions, but it doesn't give you a thing that shows what has *changed*.Wed, 22 Feb 2012 05:48:53 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20263#post-id-20263Comment by kcrisman for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20262#post-id-20262See http://askbot.org/en/question/6589/view-edits-as-diffs for (hopefully) followup.Wed, 22 Feb 2012 05:50:37 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20262#post-id-20262Comment by god.one for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20208#post-id-20208Good, very good indeed. Thanks for the info and the effort.Mon, 27 Feb 2012 20:59:17 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20208#post-id-20208Comment by kcrisman for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20236#post-id-20236Okay, they followed up. If you click on the hyperlink where it says "updated Feb 21", you can see that I added "kummer confluent " to the title of the post. Very hard to find...Mon, 27 Feb 2012 06:25:28 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20236#post-id-20236Comment by god.one for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20264#post-id-20264@kcrisman Can you tell me what you did change in my question?Tue, 21 Feb 2012 18:28:34 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20264#post-id-20264Answer by kcrisman for <p>Hi, here is my piece of code</p>
<pre><code>var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
</code></pre>
<p>which yields</p>
<pre><code>[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
</code></pre>
<p>Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.</p>
<p>Thanks in advance</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?answer=13285#post-id-13285The short answer is "we don't have this yet".
The long answer is that we have the [`kummer_u` function implemented](http://www.sagemath.org/doc/reference/sage/functions/special.html) (search for `hypergeometric_U`), but not the `kummer_m` function in question, and the former only as a numerical function.
You can always access Maxima stuff in a roundabout way, though I couldn't do more than
sage: maxima_calculus('load(contrib_ode)')
\"/Users/.../sage-4.8/local/share/maxima/5.23.2/share/contrib/diffequations/contrib_ode.mac\"
sage: maxima_calculus('kummer_m(-1,1/2,-1)')
kummer_m(-1,1/2,-1)
[Note that](http://maxima.sourceforge.net/docs/manual/en/maxima_44.html)
> The only use of this function is in solutions of ODEs returned by odelin and contrib_ode. The definition and use of this function may change in future releases of Maxima.
and I couldn't get it to evaluate numerically, though maybe it does.
Also, [mpmath has](http://mpmath.googlecode.com/svn/trunk/doc/build/functions/bessel.html#mpmath.hyperu) both [solutions](http://mpmath.googlecode.com/svn/trunk/doc/build/functions/hypergeometric.html#mpmath.hyp1f1) so we could easily implement this symbolically in Sage. I've updated [the Trac wiki](http://trac.sagemath.org/sage_trac/wiki/symbolics/functions) about this, though my guess is that we will focus first on getting some of the more well-known special functions more fully supported in Sage. You can get the numerics now by doing
sage: mpmath.hyp1f1(2,-1/3,3.25)
mpf('-2815.9568569248172')
Finally, if you want to make your own symbolic function now for this, you can follow some of the examples like our new [beta function](http://trac.sagemath.org/sage_trac/ticket/9130), which has positive review, and it would be possible to just add your own custom code for this by cutting and pasting.Tue, 21 Feb 2012 02:09:48 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?answer=13285#post-id-13285Comment by god.one for <p>The short answer is "we don't have this yet". </p>
<p>The long answer is that we have the <a href="http://www.sagemath.org/doc/reference/sage/functions/special.html"><code>kummer_u</code> function implemented</a> (search for <code>hypergeometric_U</code>), but not the <code>kummer_m</code> function in question, and the former only as a numerical function.</p>
<p>You can always access Maxima stuff in a roundabout way, though I couldn't do more than</p>
<pre><code>sage: maxima_calculus('load(contrib_ode)')
\"/Users/.../sage-4.8/local/share/maxima/5.23.2/share/contrib/diffequations/contrib_ode.mac\"
sage: maxima_calculus('kummer_m(-1,1/2,-1)')
kummer_m(-1,1/2,-1)
</code></pre>
<p><a href="http://maxima.sourceforge.net/docs/manual/en/maxima_44.html">Note that</a></p>
<blockquote>
<p>The only use of this function is in solutions of ODEs returned by odelin and contrib_ode. The definition and use of this function may change in future releases of Maxima.</p>
</blockquote>
<p>and I couldn't get it to evaluate numerically, though maybe it does.</p>
<p>Also, <a href="http://mpmath.googlecode.com/svn/trunk/doc/build/functions/bessel.html#mpmath.hyperu">mpmath has</a> both <a href="http://mpmath.googlecode.com/svn/trunk/doc/build/functions/hypergeometric.html#mpmath.hyp1f1">solutions</a> so we could easily implement this symbolically in Sage. I've updated <a href="http://trac.sagemath.org/sage_trac/wiki/symbolics/functions">the Trac wiki</a> about this, though my guess is that we will focus first on getting some of the more well-known special functions more fully supported in Sage. You can get the numerics now by doing</p>
<pre><code>sage: mpmath.hyp1f1(2,-1/3,3.25)
mpf('-2815.9568569248172')
</code></pre>
<p>Finally, if you want to make your own symbolic function now for this, you can follow some of the examples like our new <a href="http://trac.sagemath.org/sage_trac/ticket/9130">beta function</a>, which has positive review, and it would be possible to just add your own custom code for this by cutting and pasting.</p>
http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20265#post-id-20265Thank you for the fast answer.Tue, 21 Feb 2012 18:26:47 -0600http://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/?comment=20265#post-id-20265