2
$\begingroup$

I have nearly 11^4 inequalities and I want to obtain the upper bounds of the solutions of the inequalities as given in a set. When use the command Reduce, i get the following intervals. This is only two ones.

A<-0.756026||0.<A<1.94105

A<-0.757879||0.<A<7.36113

I want to obtain the upper bounds of A as in the set. Namely, the output should be as {-0,756026,1,94105,-0.757879,7.36113}

Thank you.

$\endgroup$
3
$\begingroup$
res = {A < -0.756026 || 0. < A < 1.94105,  A < -0.757879 || 0. < A < 7.36113};

res /. {Or -> List, Less -> (Last[{##}] &)} // Flatten
Sequence @@@ res[[All, All, -1]]
ArgMax[{A, #}, A] & /@ # & /@ res /. Or -> Sequence

all give

{-0.756026, 1.94105, -0.757879, 7.36113}

$\endgroup$
2
  • $\begingroup$ It did not work in my computer $\endgroup$
    – MATIRMAK
    Jul 18 '17 at 18:40
  • 1
    $\begingroup$ @MATIRMAK, some detail on how it didn't work would be useful. $\endgroup$
    – kglr
    Jul 18 '17 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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