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.Tue, 26 May 2020 19:05:54 +0200Plotting poly logarithmic functionhttps://ask.sagemath.org/question/51508/plotting-poly-logarithmic-function/I am trying to plot the below function $$f(s,t) := \frac{(2\pi)^{s}}{\Gamma(s)}\;polylog(-s,e^{-2\pi t})$$ in the range $(s,t) \in (k,\infty) \times (1,\infty)$ where $k$ is a fixed positive real number. Thus, for my purposes, it is a real valued function on (subset of ) $R^2$. (Although, the function $polylog(s,z)$ is known to be complex analytic with respect to both s and z for arbitrary complex numbers s and $|z|<1$.)
Following is the code which is working fine in sage Cell server for smaller values of s.
s,z,t=var('s,z,t')
z(t) = exp(-2*pi.n()*t)
plot3d(((2*pi)^s)/gamma(s)*polylog(-s,z(t)),(s,10,150.1),(t,1,100))
However, the same code fails when I run larger values of $s$, even 200. I need to study the limiting behaviour of this function in terms of both parameters. Can someone tell me how to work around this "math range error"? PS I am new to Sage.
s, z, t = var('s,z,t')
z(t) = exp(-2*pi.n()*t)
plot3d(((2*pi)^s)/gamma(s)*polylog(-s,z(t)),(s,10,1500.1),(t,1,100))
opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py:592: RichReprWarning: Exception in _rich_repr_ while displaying object: math range error
RichReprWarning,Fri, 22 May 2020 19:24:17 +0200https://ask.sagemath.org/question/51508/plotting-poly-logarithmic-function/Comment by Sébastien for <p>I am trying to plot the below function $$f(s,t) := \frac{(2\pi)^{s}}{\Gamma(s)}\;polylog(-s,e^{-2\pi t})$$ in the range $(s,t) \in (k,\infty) \times (1,\infty)$ where $k$ is a fixed positive real number. Thus, for my purposes, it is a real valued function on (subset of ) $R^2$. (Although, the function $polylog(s,z)$ is known to be complex analytic with respect to both s and z for arbitrary complex numbers s and $|z|<1$.)</p>
<p>Following is the code which is working fine in sage Cell server for smaller values of s.</p>
<pre><code>s,z,t=var('s,z,t')
z(t) = exp(-2*pi.n()*t)
plot3d(((2*pi)^s)/gamma(s)*polylog(-s,z(t)),(s,10,150.1),(t,1,100))
</code></pre>
<p>However, the same code fails when I run larger values of $s$, even 200. I need to study the limiting behaviour of this function in terms of both parameters. Can someone tell me how to work around this "math range error"? PS I am new to Sage. </p>
<pre><code>s, z, t = var('s,z,t')
z(t) = exp(-2*pi.n()*t)
plot3d(((2*pi)^s)/gamma(s)*polylog(-s,z(t)),(s,10,1500.1),(t,1,100))
opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py:592: RichReprWarning: Exception in _rich_repr_ while displaying object: math range error
RichReprWarning,
</code></pre>
https://ask.sagemath.org/question/51508/plotting-poly-logarithmic-function/?comment=51568#post-id-51568The function is getting very close to zero when s and t gets bigger:
sage: f = ((2*pi)^s)/gamma(s)*polylog(-s,z(t))
sage: f(s=1500.1,t=100).n()
2.24050143357682e-3009
Maybe the exponents get so big that the plot method can not handle it? (that would be a bug)Tue, 26 May 2020 19:05:54 +0200https://ask.sagemath.org/question/51508/plotting-poly-logarithmic-function/?comment=51568#post-id-51568