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

Projects
None yet
1 participant
@Shekharrajak
Copy link
Member

Shekharrajak commented Jun 19, 2016

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        ⎭⎠

@Shekharrajak Shekharrajak force-pushed the Shekharrajak:gsoc_trig_ineq branch from ac44cd2 to 7a70227 Jun 19, 2016

solveset_univariate_trig_ineq added
solveset_univariate_trig_ineq added
@Shekharrajak

This comment has been minimized.

Copy link
Member Author

Shekharrajak commented Jun 19, 2016

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):

This comment has been minimized.

Copy link
@Shekharrajak

Shekharrajak Jun 19, 2016

Author Member

Original #11188

@Shekharrajak

This comment has been minimized.

Copy link
Member Author

Shekharrajak commented Jun 19, 2016

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

@Shekharrajak

This comment has been minimized.

Copy link
Member Author

Shekharrajak commented Aug 5, 2016

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
You can’t perform that action at this time.