Message Boards Message Boards

0
|
2630 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Min function across several functions

Posted 9 years ago

There are several "min" functions in Mathematica. In the "Numerical" category, there is a "Min" function that works on a numerical list. Then there's MinValue for finding the minimum of a whole function (FindMinimum) and other variations of this. What I'm looking for is a "min" function that takes several functions (f1, f2, f3, ...) and returns the output of function (fn) across the domain that it (fn) has the lowest values. Say,

Min(-x^2, -(x + 1)^2)
=> -x^2         when x < -1/2,
   -(x + 1)^2 when x >= -1/2

Is there such a function in Mathematica? If not, how do I define one? It has to seemlessly work with all the other built-in functions in Mathematica so I don't always have to be worrying about the gaps.

POSTED BY: Ren Sena

If you don't need a symbolic result, then this works

f[x_] := Min[-x^2, -(x + 1)^2]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract