2
$\begingroup$

I'm using Simplify over a Min of a finite list in order to get rid of unobserved cases.

As a result, after the simplify I see

Min[1/29 (39 + 74 p1), 1/23 (29 + 78 p1)] 

(simplified, but it gets the point across) and I want to get store the list

1/29 (39 + 74 p1), 1/23 (29 + 78 p1) 

as a variable. Is there a built in function that would do this?

$\endgroup$
2
  • 3
    $\begingroup$ a = List @@ Min[1/29 (39 + 74 p1), 1/23 (29 + 78 p1)] will do what you ask. However, doing it will mean that you never take the minimum of the two arguments. $\endgroup$
    – m_goldberg
    Jun 28, 2018 at 21:04
  • 1
    $\begingroup$ Min[1/29 (39 + 74 p1), 1/23 (29 + 78 p1)] /. Min -> List $\endgroup$
    – corey979
    Jun 28, 2018 at 21:05

1 Answer 1

1
$\begingroup$

Use Piecewise

f[p1_] = Piecewise[{{1/29 (39 + 74 p1),
    Reduce[1/29 (39 + 74 p1) < 1/23 (29 + 78 p1), p1]}},
  1/23 (29 + 78 p1)]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.