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
danl
(Daniel Lichtblau)
March 5, 2018, 3:53pm
2
It would be useful to have a complete self-contained example. Anyway, could try equation1==equation2 && x>0 as first argument to Solve.
Try:
Solve[equation1==equation2&& x > 0, x, Reals]
or:
Solve[{equation1==equation2, x > 0}, x, Reals]
Regards,MI
Thanks a bunch, people! =D
Hi everybody,
I have the same question, but I have hundreds of variables in my system of equations.
In my large system of equations including numerous variables, I use the following structure:
Solve[eq1==eq2&&
eq3==eq4&& ....]
and I do not specify any variable, so the solver tries to solve the system for all the variables.
Now the question is instead of this format:
Solve[eq1==eq2&&
eq3==eq4&& ....&&, x1>0,x2>0,..., Reals]
How can I ask the solver to return a non-zero positive solution for all the variables?
Thanks
phanis
(Phani Sanagavarapu)
September 8, 2022, 2:47pm
6
soln = Solve[eq1==eq2&& eq3==eq4&& ....&&, {x1, x2,..., xn}, Reals] ;
Pick[soln, And @@@ (Positive /@ soln)]