Group Abstract Group Abstract

Message Boards Message Boards

Keep only positive and real solutions from Solve?

Posted 8 years ago

Hi people,

I have a problem where I get four solutions to an equation system. Two imaginary, one negative and one positive. Can I somehow automatically tell Mathematica to only keep the real and positive answer?

Sort of:

Solve[equation1==equation2, x]//Real//Positive

Thanks! //Freddy, Sweden

POSTED BY: Fredrik Erling
5 Replies
soln = Solve[eq1==eq2&& eq3==eq4&& ....&&, {x1, x2,..., xn}, Reals] ;
Pick[soln, And @@@ (Positive /@ soln)]
Posted 4 years ago
POSTED BY: AMIN sol

Thanks a bunch, people! =D

POSTED BY: Fredrik Erling
POSTED BY: Mariusz Iwaniuk

It would be useful to have a complete self-contained example. Anyway, could try equation1==equation2 && x>0 as first argument to Solve.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard