I have this list
Solutions = {{"C1" -> 0., "C2" -> 0., "C3" -> 0., "L1" -> 0., "L2" -> 0.,
"L3" -> 0., "Rin" -> -1.09141*10^22}, {"C1" -> 0., "C2" -> 0.,
"C3" -> 0., "L1" -> 0., "L2" -> 0., "L3" -> 0.,
"Rin" -> -1.09141*10^22}, {"C1" -> 0., "C2" -> 0., "C3" -> 0.,
"L1" -> 0., "L2" -> 0., "L3" -> 0., "Rin" -> -22777.6}, {"C1" -> 0.,
"C2" -> 0., "C3" -> 0., "L1" -> 0., "L2" -> 0., "L3" -> 0.,
"Rin" -> -22777.6}, {"C1" -> 0., "C2" -> 0., "C3" -> 0., "L1" -> 0.,
"L2" -> 0., "L3" -> 0., "Rin" -> 59.7556}, {"C1" -> 0., "C2" -> 0.,
"C3" -> 0., "L1" -> 0., "L2" -> 0., "L3" -> 0.,
"Rin" -> 59.7556}, {"C1" -> 0., "C2" -> 0., "C3" -> 0., "L1" -> 0.,
"L2" -> 0., "L3" -> 0., "Rin" -> 100.}}
I want to eliminate any solution with a negative element. I have tried to do
Solutions = Select[Solutions, FreeQ[#, NegativeReals] &]
It does not work, gives me the empty set as a solution. How to fix this?
Select[Solutions, Min[Values[#]] >= 0 &]
$\endgroup$NonNegativeReals
so that these solutions would not be generated in the first place? I deleted my previous comment as aPositiveReals
domain would exclude all zero valued solutions. $\endgroup$Solve
. For instance, compareSolve[x^2 + y^2 == 1 && x - y == 1, {x, y}]
withSolve[x^2 + y^2 == 1 && x - y == 1 && {x, y} >= 0, {x, y}]
(or as Syed suggested, the domain options if you have version 12.0+) $\endgroup$