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.Wed, 31 Jul 2013 07:05:13 -0500Find minimum value of polynomialhttp://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/I have a univariate polynomial with integer coefficients over [0,1] and I would like to find a minimum value. Is there an easy way to do that in sage?
Mon, 29 Jul 2013 07:20:42 -0500http://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/Answer by calc314 for <p>I have a univariate polynomial with integer coefficients over [0,1] and I would like to find a minimum value. Is there an easy way to do that in sage?</p>
http://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/?answer=15280#post-id-15280Try the following:
f(x)=(x-3)*(x+2)^2
f.find_minimum_on_interval(0,1)Mon, 29 Jul 2013 09:08:12 -0500http://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/?answer=15280#post-id-15280Comment by Pavel Yartsev for <p>Try the following:</p>
<pre><code>f(x)=(x-3)*(x+2)^2
f.find_minimum_on_interval(0,1)
</code></pre>
http://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/?comment=17212#post-id-17212You have to remember that:
f.find_minimum_on_interval(0,1)
does NOT include the end points. This call on f(x) = (x-3)*(x+2)^2 will produce these results:
(-17.99999991390072, 0.99999997130024143)
While over the interval [0,1] the minimum is located at x=1
If you want to include the endpoints you would need to write something like this:
min(f(0), f.find_minimum_on_interval(0,1)[0], f(1))
Wed, 31 Jul 2013 07:05:13 -0500http://ask.sagemath.org/question/10396/find-minimum-value-of-polynomial/?comment=17212#post-id-17212