We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
(Edited to actually demonstrate the issue)
I am running SymPy 1.4 in Python 2.7. I have confirmed that this issue is also present in SymPy Live Shell.
I have a simple trigonometric expression that I am trying to simplify:
from sympy import sin, cos, symbols, trigsimp x_0, y_0, theta_0 = symbols("x_0 y_0 theta_0") trigsimp((x_0*cos(2*theta_0) + x_0 + y_0*sin(2*theta_0))/(2*cos(theta_0)))
Expected simplification: x_0 * cos(theta_0) + y_0 * sin(theta_0)
x_0 * cos(theta_0) + y_0 * sin(theta_0)
Actual simplification (no change): (x_0 * cos(2 * theta_0) + x_0 + y_0 * sin(2 * theta_0)) / (2 * cos(theta_0))
(x_0 * cos(2 * theta_0) + x_0 + y_0 * sin(2 * theta_0)) / (2 * cos(theta_0))
The text was updated successfully, but these errors were encountered:
I just tried this:
Python 2.7.12 (default, Oct 8 2019, 14:14:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sympy >>> sympy.__version__ '1.4' >>> from sympy import * >>> from sympy.abc import x, y, theta >>> trigsimp((x * cos(2 * theta) + x + y * sin(2 * theta)) / (2 * cos(theta))) x*cos(theta) + y*sin(theta)
Any other details?
Sorry, something went wrong.
Oops, looks like I left an important piece out.
This works great:
from sympy import sin, cos, symbols, trigsimp x_0, y_0, theta_0 = symbols("x0 y0 theta0") trigsimp((x_0*cos(2*theta_0) + x_0 + y_0*sin(2*theta_0))/(2*cos(theta_0)))
This does not:
The issue seems to occur when using underscores in string variable names, at least in this instance.
No issue here, though:
from sympy import sin, cos, symbols, trigsimp x_0, y_0, theta_0 = symbols("x_0 y_0 theta_0") trigsimp(x_0 * cos(theta_0) **2 + x_0 * sin(theta_0) ** 2)
No branches or pull requests
(Edited to actually demonstrate the issue)
I am running SymPy 1.4 in Python 2.7. I have confirmed that this issue is also present in SymPy Live Shell.
I have a simple trigonometric expression that I am trying to simplify:
Expected simplification:
x_0 * cos(theta_0) + y_0 * sin(theta_0)
Actual simplification (no change):
(x_0 * cos(2 * theta_0) + x_0 + y_0 * sin(2 * theta_0)) / (2 * cos(theta_0))
The text was updated successfully, but these errors were encountered: