-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Solveset fails with trig and symbols #17667
Labels
Comments
Also solveset returns very complicated answers with tan and irrational numbers: In [17]: solveset(tan(x)-S.Half, x, Interval(0, pi/2))
Out[17]: {atan(1/2)}
In [18]: solveset(tan(x)-sqrt(2), x, Interval(0, pi/2))
Out[18]:
⎧ ⎛ ⎛ ⎛atan(2⋅√2)⎞⎞⎞⎫
⎪ ⎜ ⎛ _____________________________________⎞ ⎜cos⎜──────────⎟⎟⎟⎪
⎪ ⎜ ⎜ ╱ 2⎛atan(2⋅√2)⎞ 2⎛atan(2⋅√2)⎞ ⎟ ⎜ ⎝ 2 ⎠⎟⎟⎪
⎨-ⅈ⋅⎜log⎜ ╱ sin ⎜──────────⎟ + cos ⎜──────────⎟ ⎟ + ⅈ⋅atan⎜───────────────⎟⎟⎬
⎪ ⎜ ⎝╲╱ ⎝ 2 ⎠ ⎝ 2 ⎠ ⎠ ⎜ ⎛atan(2⋅√2)⎞⎟⎟⎪
⎪ ⎜ ⎜sin⎜──────────⎟⎟⎟⎪
⎩ ⎝ ⎝ ⎝ 2 ⎠⎠⎠⎭
In [19]: solveset(tan(x)-pi, x, Interval(0, pi/2))
Out[19]:
⎧ ⎛ ⎛ ________________________________________________________________________________________________________________________
⎪ ⎜ ⎜ ╱ ⎛ ⎛ 2⋅π ⎞⎞
⎪ ⎜ ⎜ ╱ ⎜atan⎜─────────────────⎟⎟
⎪ ⎜ ⎜ ╱ ⎜ ⎜ 4 ⎟⎟
⎪ ⎜ ⎜ ╱ __________________________________ ⎜ ⎜ 1 π ⎟⎟ __________________________________
⎪ ⎜ ⎜ ╱ ╱ 2 ⎜ ⎜- ────── + ──────⎟⎟ ╱ 2
⎪ ⎜ ⎜ ╱ ╱ 2 ⎛ 2 ⎞ ⎜ ⎜ 2 2⎟⎟ ╱ 2 ⎛ 2 ⎞
⎨ ⎜ ⎜ ╱ ╱ 4⋅π ⎜ 1 π ⎟ 2⎜ ⎝ 1 + π 1 + π ⎠⎟ ╱ 4⋅π ⎜ 1 π ⎟
⎪-ⅈ⋅⎜log⎜ ╱ ╱ ───────── + ⎜- ────── + ──────⎟ ⋅sin ⎜───────────────────────⎟ + ╱ ───────── + ⎜- ────── + ──────⎟ ⋅c
⎪ ⎜ ⎜ ╱ ╱ 2 ⎜ 2 2⎟ ⎝ 2 ⎠ ╱ 2 ⎜ 2 2⎟
⎪ ⎜ ⎜ ╱ ╱ ⎛ 2⎞ ⎝ 1 + π 1 + π ⎠ ╱ ⎛ 2⎞ ⎝ 1 + π 1 + π ⎠
⎪ ⎜ ⎝╲╱ ╲╱ ⎝1 + π ⎠ ╲╱ ⎝1 + π ⎠
⎪ ⎜
⎪ ⎜
⎩ ⎝
_____________________________⎞ ⎞⎫
⎛ ⎛ 2⋅π ⎞⎞ ⎟ ⎟⎪
⎜atan⎜─────────────────⎟⎟ ⎟ ⎛ ⎛ ⎛ 2⋅π ⎞⎞⎞⎟⎪
⎜ ⎜ 4 ⎟⎟ ⎟ ⎜ ⎜atan⎜──────⎟⎟⎟⎟⎪
⎜ ⎜ 1 π ⎟⎟ ⎟ ⎜ ⎜ ⎜ 2⎟⎟⎟⎟⎪
⎜ ⎜- ────── + ──────⎟⎟ ⎟ ⎜ ⎜ ⎝1 - π ⎠⎟⎟⎟⎪
⎜ ⎜ 2 2⎟⎟ ⎟ ⎜cos⎜────────────⎟⎟⎟⎪
2⎜ ⎝ 1 + π 1 + π ⎠⎟ ⎟ ⎜ ⎝ 2 ⎠⎟⎟⎬
os ⎜───────────────────────⎟ ⎟ - ⅈ⋅atan⎜─────────────────⎟⎟⎪
⎝ 2 ⎠ ⎟ ⎜ ⎛ ⎛ 2⋅π ⎞⎞⎟⎟⎪
⎟ ⎜ ⎜atan⎜──────⎟⎟⎟⎟⎪
⎠ ⎜ ⎜ ⎜ 2⎟⎟⎟⎟⎪
⎜ ⎜ ⎝1 - π ⎠⎟⎟⎟⎪
⎜sin⎜────────────⎟⎟⎟⎪
⎝ ⎝ 2 ⎠⎠⎠⎭ |
That's because equations of purely trigonometric nature end up in |
gschintgen
added a commit
to gschintgen/sympy
that referenced
this issue
Dec 20, 2023
Closes sympy#21296 Improves sympy#17667 Improves sympy#17579 Closes sympy#17334 Closes sympy#9825
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Failing example:
Firstly the domain of the ConditionSet is wrong. It should be
Interval(0, pi)
notReals
.Secondly cos is invertible over that domain so we should be able to get
acos(y)
. We don't know thaty
is real and between-1
and1
but a better answer could beThe text was updated successfully, but these errors were encountered: