1. PF Contest - Win "Conquering the Physics GRE" book! Click Here to Enter
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Maple - Finding maximum of maximums in different functions

  1. May 25, 2015 #1

    I've been trying to come up with a short way of writing the code. What I'm trying to do is:

    I have 11 equations, each of which have a defined minimum and maximum. I'm trying to find the highest maximum out of all of them and I need to know which one it is. The highest as in farthest away from zero, so negative values are also required.

    I was trying this:

    And although this would work (it does give me a value), it doesn't tell me which of the functions is the highest. Is there any way to do this other than wasting a bunch of lines writing:

  2. jcsd
  3. May 28, 2015 #2
    You'll probably want to write a function as far as I can tell. (It's been a while since I used maple so maybe a built-in function exists although highly unlikely)

    In essence it would do something like create an array of functions.
    Then loop over this array determining the maximum/whatever you need of said function and assign to a new array at the same index (<- this is important)
    Then you can determine the maximum of this newly created list
    Now the result, you search in your array of maxima and use the index to retrieve your function.

    disclaimer: I'm probably using some bad terminology here like the array. An array can be a list or vector or ... in Maple, if I'm not mistaken
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted