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

[WIP] Improving solveset univariate Trig inequality #11257

Closed
wants to merge 1 commit into from

Conversation

Shekharrajak
Copy link
Member

solveset_univariate_trig_inequality function is added to handle Trigonometric inequality.

Main intention is to get extended solution.

eg.

In [2]: solveset((2*cos(x)+1)/(2*cos(x)-1) > 0, x, S.Reals)
Out[2]:
⎡⎧      π        ⎫  ⎧      π        ⎫⎤
⎢⎨n⋅π - ─ | n ∊ ℤ⎬, ⎨n⋅π + ─ | n ∊ ℤ⎬⎥
⎣⎩      3        ⎭  ⎩      3        ⎭⎦

n [4]: solveset(sin(x) > 1/sqrt(2), x, S.Reals)
Out[4]:
⎛⎧        π        ⎫  ⎧        3⋅π        ⎫⎞
⎜⎨2⋅n⋅π + ─ | n ∊ ℤ⎬, ⎨2⋅n⋅π + ─── | n ∊ ℤ⎬⎟
⎝⎩        4        ⎭  ⎩         4         ⎭⎠

In [15]: solveset(2*cos(x) + sqrt(3) < 0, x, S.Reals)
Out[15]:
⎛⎧        5⋅π        ⎫  ⎧        7⋅π        ⎫⎞
⎜⎨2⋅n⋅π + ─── | n ∊ ℤ⎬, ⎨2⋅n⋅π + ─── | n ∊ ℤ⎬⎟
⎝⎩         6         ⎭  ⎩         6         ⎭⎠

In [16]: solveset_univariate_trig_inequality(tan(x) > 0, x)
Out[16]: 
⎛               ⎧      π        ⎫⎞
⎜{n⋅π | n ∊ ℤ}, ⎨n⋅π + ─ | n ∊ ℤ⎬⎟
⎝               ⎩      2        ⎭⎠

solveset_univariate_trig_ineq added
@Shekharrajak
Copy link
Member Author

This PR is not that much good now. It fails some cases. I am trying to improve it. It is inspired from previous solve_univariate_inequality but it seems need changes for trig ineq.

@@ -153,6 +153,140 @@ def isdisjoint(self, other):
"""
return self.is_disjoint(other)



def _union_simplify(self, other):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original #11188

@Shekharrajak
Copy link
Member Author

Ping @aktech @hargup @kshitij10496 . This is initial code.

@Shekharrajak
Copy link
Member Author

Closing this PR, since @kshitij10496 is working on it.

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

Successfully merging this pull request may close these issues.

1 participant