Skip to main content
1-Visitor
June 11, 2013
Question

Symbolically identifying solutions to max/min function

  • June 11, 2013
  • 7 replies
  • 2941 views

I feel like this may be a simple question to answer, but I'm having a hard time finding a solution on my own, so hopefully someone can help me with this.

I've been exploring symbolic/explicit calculation for a short while now, but keep running into a wall when I want to display the solution to a max or min function as the actual variable and not the numeric solution. What I keep getting is:

a:=1

b:=2

c:=3

min(a,b,c) -> min(a,b,c),

min(a,b,c) -> min(1,2,3), or

min(a,b,c) -> 1

What I would like to be able to see is:

min(a,b,c) -> a

If someone could point me in the right direction as to what keywords to use to achieve this, I'd really appreciate it.

7 replies

Werner_E
25-Diamond I
June 11, 2013

Don't think that "explicit" or any other keyword will do what you want as soon as we have concrete values for a,b,c.

Not exactly what you demanded but the best I could come up is

min_expl.png

1-Visitor
June 11, 2013

So there's no way to symbolically evaluate a max/min function once you have concrete values?

For my current project I'm looking to evaluate different safety ratios, so a,b,c and are actually (Vd1/Vr1), (Vd2/Vr2), (Vd3/Vr3), which will need numerical values in order to compare them.

1-Visitor
June 11, 2013

In case anyone else is looking for this as well, this is a method that works, but looks ugly as sin and will only get worse with the more variables you're comparing.

It's a series of "if" statements that compare the number/variable to the solution of the max/min function. It works fine if no units are involved (in the case of comparing Vd/Vr as "lbf" cancel out), but otherwise if comparing numbers with units, you have to remove them in order to avoid an error ("value must be scalar"). Here's a sample of both cases:

Example.bmp

Werner_E
25-Diamond I
June 11, 2013

Clever workaround.

Still not as easy and natural as it should be, but could using vectors be an option?

min_expl2.png

19-Tanzanite
June 11, 2013

Here's yet another (cumbersome) way of indicating which variable is the minimum .

Alan

minfn.PNG