This is regarding the `argmax` and `argmin` functions implemented in this PR
<https://github.com/sympy/sympy/pull/13555>.
Depending on the function and the given domain, argmax/argmin for a
function may be a unique value, or a set of values. The user may directly
use these values as a part of a larger calculation, which would be possible
only when the functions return a single value, and not a set of values. To
deal with this, the current implementation returns a single value if the
value is unique, and a set otherwise.
For example:
```
>>> from sympy import *
>>> from sympy.calculus.util import argmax, argmin
>>> x = Symbol('x')
>>> argmax(sin(x), x, Interval(0, pi))
pi/2
>>> argmax(sin(x), x, Interval(-2*pi, pi))
{-3*pi/2, pi/2}
```
However, dealing with functions that return multiple data types can be
complicated. How should this be resolved?
(Also refer to https://github.com/sympy/sympy/issues/13432)
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/af60c2fd-22e9-427a-bce9-1a5a721a732f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.