My guess is that solve is not intended to solve a system of inequalities so
it doesn't know what to do with the relationals that are seen in the system
of Piecewise. But if you know the structure you can build the appropriate
product of args and reconstruct a solution:
solns= []
for p in product(*[P.args[1].args for P in new_sys]):
e, c = zip(*p); s = solve(e,(x,y),dict=True)
if s:solns.append((s,And(*c)))
>>> solns
[([{x: 0, y: 0}], True)]
/c
On Saturday, August 9, 2025 at 4:39:32 PM UTC-5 [email protected] wrote:
> > Expressions with Max/Min can already be converted to Piecewise:
> > >>> (1+Max(x,y)).rewrite(Piecewise)
> > Piecewise((x, x >= y), (y, True)) + 1
>
> I'm sorry, I don't understand what you're implying. I understand that
> Min/Max can be rewritten to Piecwise manually. My point was that after the
> rewrite sympy.solve throws a NaN comparison error, and was wondering if
> that is intended there, or if I can do anything about it.
>
> Thanks,
> Gábor
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/sympy/5fb09be1-909a-4344-8a92-4ed692ee4bb9n%40googlegroups.com.