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.Thu, 31 Mar 2022 22:10:34 +0200Plotting Zero-free regionshttps://ask.sagemath.org/question/61733/plotting-zero-free-regions/So I am working on a project for proving different types of zero-free regions, I needed to plot some zero free regions using sage and cannot think any obvious ways to do it. I am still pretty new to sage and computational math in general but I needed some guidance as to what I should do.
I am trying to plot the zero free region by de la Vall ́ee Poussin which is $1-\beta \leq \frac{c}{\log(t)}$Tue, 29 Mar 2022 06:02:04 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/Comment by Emmanuel Charpentier for <p>So I am working on a project for proving different types of zero-free regions, I needed to plot some zero free regions using sage and cannot think any obvious ways to do it. I am still pretty new to sage and computational math in general but I needed some guidance as to what I should do.
I am trying to plot the zero free region by de la Vall ́ee Poussin which is $1-\beta \leq \frac{c}{\log(t)}$</p>
https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61737#post-id-61737what gives `region_plot?` ?
More generally, the [reference manual](https://doc.sagemath.org/html/en/reference/plotting/index.html) may come in handy...Tue, 29 Mar 2022 08:19:46 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61737#post-id-61737Answer by mrisager for <p>So I am working on a project for proving different types of zero-free regions, I needed to plot some zero free regions using sage and cannot think any obvious ways to do it. I am still pretty new to sage and computational math in general but I needed some guidance as to what I should do.
I am trying to plot the zero free region by de la Vall ́ee Poussin which is $1-\beta \leq \frac{c}{\log(t)}$</p>
https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?answer=61738#post-id-61738Maybe something like
var('sigma,t')
c=0.3
region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
will do the trick. Notice that I have changed the argument of the log a bit to make it non-negative. The form of the Hadamard-dVP region you have stated is only nontrivial for $\lvert t \rvert$ sufficiently large anyway.
If you want the symmetric version you may try
region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)+region_plot((sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)Tue, 29 Mar 2022 11:06:49 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?answer=61738#post-id-61738Comment by prathamlalwani for <p>Maybe something like </p>
<pre><code>var('sigma,t')
c=0.3
region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
<p>will do the trick. Notice that I have changed the argument of the log a bit to make it non-negative. The form of the Hadamard-dVP region you have stated is only nontrivial for $\lvert t \rvert$ sufficiently large anyway.</p>
<p>If you want the symmetric version you may try</p>
<pre><code>region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)+region_plot((sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61784#post-id-61784Thank you very much @mrisagerThu, 31 Mar 2022 22:10:34 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61784#post-id-61784Comment by mrisager for <p>Maybe something like </p>
<pre><code>var('sigma,t')
c=0.3
region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
<p>will do the trick. Notice that I have changed the argument of the log a bit to make it non-negative. The form of the Hadamard-dVP region you have stated is only nontrivial for $\lvert t \rvert$ sufficiently large anyway.</p>
<p>If you want the symmetric version you may try</p>
<pre><code>region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)+region_plot((sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61782#post-id-61782You can play around with aspect_ratio. I have updated the answer accordingly. If it solves the original question, you can mark it as accepted by clicking the "accept" button next to it (the button with a check mark). This will mark the question as solved in the list of questions.Thu, 31 Mar 2022 07:59:46 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61782#post-id-61782Comment by prathamlalwani for <p>Maybe something like </p>
<pre><code>var('sigma,t')
c=0.3
region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
<p>will do the trick. Notice that I have changed the argument of the log a bit to make it non-negative. The form of the Hadamard-dVP region you have stated is only nontrivial for $\lvert t \rvert$ sufficiently large anyway.</p>
<p>If you want the symmetric version you may try</p>
<pre><code>region_plot((1-sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)+region_plot((sigma)-c/log(2+abs(t))<= 0, (sigma, 0, 1), (t, -100, 100),aspect_ratio=1/99)
</code></pre>
https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61762#post-id-61762I was able to do it by calculating points and the plotting using scatter_plot but I like this way better but I wanted to ask how do I scale the x axis on this plot because if I go for 100 on the y axis then x axis appears as 0. Because using scatter plot I am getting a very nice visualization of the zero-free region, but this is much cleaner code wise. Thank you for your answerWed, 30 Mar 2022 03:37:05 +0200https://ask.sagemath.org/question/61733/plotting-zero-free-regions/?comment=61762#post-id-61762