ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 08 Dec 2014 08:43:13 -0600What's wrong with Лобачевский function?https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/ Hello,
I tried to plot the following function $$Л(\theta) = -\int_0^\theta \log |2 \sin(u)| du$$ (called the Lobatchevski function). So I started with
sage: theta, u = var('theta', 'u')
sage: assume(0 < theta < pi)
sage: assume(theta, 'real')
sage: el(theta) = - integral(log(abs(2*sin(u))), u, 0, theta)
The last command just asks maxima. Maxima starts computing (one CPUS is running 100%) but never stops.
VincentMon, 08 Dec 2014 03:54:22 -0600https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/Comment by kcrisman for <p>Hello,</p>
<p>I tried to plot the following function $$Л(\theta) = -\int_0^\theta \log |2 \sin(u)| du$$ (called the Lobatchevski function). So I started with</p>
<pre><code>sage: theta, u = var('theta', 'u')
sage: assume(0 < theta < pi)
sage: assume(theta, 'real')
sage: el(theta) = - integral(log(abs(2*sin(u))), u, 0, theta)
</code></pre>
<p>The last command just asks maxima. Maxima starts computing (one CPUS is running 100%) but never stops.</p>
<p>Vincent</p>
https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25172#post-id-25172This is actually pretty bizarre, and (sadly) yet *another* error in Maxima's `abs_integrate`. I'm getting really frustrated with that package about now, even though it adds a lot of awesome integrals. See http://trac.sagemath.org/ticket/17468Mon, 08 Dec 2014 08:43:13 -0600https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25172#post-id-25172Comment by FrédéricC for <p>Hello,</p>
<p>I tried to plot the following function $$Л(\theta) = -\int_0^\theta \log |2 \sin(u)| du$$ (called the Lobatchevski function). So I started with</p>
<pre><code>sage: theta, u = var('theta', 'u')
sage: assume(0 < theta < pi)
sage: assume(theta, 'real')
sage: el(theta) = - integral(log(abs(2*sin(u))), u, 0, theta)
</code></pre>
<p>The last command just asks maxima. Maxima starts computing (one CPUS is running 100%) but never stops.</p>
<p>Vincent</p>
https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25164#post-id-25164Even that does not work:
sage: integral(log(abs(2*sin(u))), u, 0, pi/3)Mon, 08 Dec 2014 05:10:04 -0600https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25164#post-id-25164Answer by mmarco for <p>Hello,</p>
<p>I tried to plot the following function $$Л(\theta) = -\int_0^\theta \log |2 \sin(u)| du$$ (called the Lobatchevski function). So I started with</p>
<pre><code>sage: theta, u = var('theta', 'u')
sage: assume(0 < theta < pi)
sage: assume(theta, 'real')
sage: el(theta) = - integral(log(abs(2*sin(u))), u, 0, theta)
</code></pre>
<p>The last command just asks maxima. Maxima starts computing (one CPUS is running 100%) but never stops.</p>
<p>Vincent</p>
https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?answer=25165#post-id-25165 If what you are interested in is computing values of this function, you can use numerical integration instead of symbolic:
sage: el = lambda theta: -numerical_integral(log(abs(2*sin(u))), 0, theta)[0]
sage: plot(el, 0, pi)
Mon, 08 Dec 2014 05:35:42 -0600https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?answer=25165#post-id-25165Comment by kcrisman for <p>If what you are interested in is computing values of this function, you can use numerical integration instead of symbolic:</p>
<pre><code>sage: el = lambda theta: -numerical_integral(log(abs(2*sin(u))), 0, theta)[0]
sage: plot(el, 0, pi)
</code></pre>
https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25166#post-id-25166Yeah, for plotting this would be fine.Mon, 08 Dec 2014 08:17:15 -0600https://ask.sagemath.org/question/25163/whats-wrong-with-lobachevskii-function/?comment=25166#post-id-25166