Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement of inequalities in solveset #13905

Open
jashan498 opened this issue Jan 12, 2018 · 6 comments
Open

Improvement of inequalities in solveset #13905

jashan498 opened this issue Jan 12, 2018 · 6 comments

Comments

@jashan498
Copy link
Member

For time being, solveset gives following error if we try it for inequalities without passing its domain as S.Reals (for example: on solveset(x<2,x)) :

inequalities in the complex domain are not supported. Try the real domain by setting domain=S.Reals

This gives open(-oo,2) if we explicitly make domain=S.Reals
But as all real numbers are a proper subset of complex numbers, therefore it should give the above result even for a complex domain.

@himanshuladia
Copy link
Contributor

Given that you want to solve for x, then yes, even in the complex domain, it should give open(-00,2). But the exception is simply says that solving inequalities in complex domain isn't implemented yet,

@jashan498
Copy link
Member Author

Yah you are right. Apparently, there are ways to compare complex numbers too which can be used here such as re(z)<2.
Thatswhy I said improvisation (or implementing it) of inequalities for this : )

@ethankward
Copy link
Contributor

It doesn't make sense to talk about inequalities of complex numbers without redefining the usual definition of inequality. Shouldn't the variables just be assumed to be real here?

@jashan498
Copy link
Member Author

Kinda right what you said. But I said comparing like re(z)<2 because solveset has complex domain by default and I want that user doesn't need to write S.Reals explicitly because all real numbers are complex too by default :)
We cant compare imaginary numbers, so sympy simply would only return real intervals.

@normalhuman
Copy link
Contributor

@ethankward It makes sense to talk about solving, say, abs(z) <= 1 and im(z) >= 1 where z is a complex number (solution: z = I).

@jashan498 jashan498 changed the title Improvisation of inequalities in solveset Improvement of inequalities in solveset Jan 13, 2018
@oscargus
Copy link
Contributor

oscargus commented Aug 21, 2021

Current master returns {x │ x ∊ ℂ ∧ (x < 2)} which seems less than ideal (as complex x will not work in the comparison).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants