Ask Your Question
2

Find minimum value of polynomial

asked 2013-07-29 14:20:42 +0200

ji-o gravatar image

updated 2013-07-29 15:53:16 +0200

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-07-29 16:08:12 +0200

calc314 gravatar image

Try the following:

f(x)=(x-3)*(x+2)^2
f.find_minimum_on_interval(0,1)
edit flag offensive delete link more

Comments

You 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))

Pavel Yartsev gravatar imagePavel Yartsev ( 2013-07-31 14:05:13 +0200 )edit

I found this answer before finding

https://ask.sagemath.org/question/412...

The answer given at this link notes the updated method name "find_local_minimum/maximum"

See also: Sage Reference Manual on numerical optimization.

I also discovered this name change after following examples in Craig Finch's "Sage Beginner's Guide"

dyne2meter gravatar imagedyne2meter ( 2020-09-25 07:16:55 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-07-29 14:20:42 +0200

Seen: 1,300 times

Last updated: Jul 29 '13