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

simplify #933

Closed
dietmaroelz opened this issue Jul 25, 2023 · 1 comment
Closed

simplify #933

dietmaroelz opened this issue Jul 25, 2023 · 1 comment

Comments

@dietmaroelz
Copy link

dietmaroelz commented Jul 25, 2023

The following expression doesn't simplify to zero as it should.

using Symbolics
@syms θ ϕ
tmp=2*cos(ϕ)^2 * sin(2* θ)+2*sin(ϕ)^2*sin(2*θ) - 2*sin(2*θ);
simplify(tmp)

returns
2(cos(ϕ)^2)*sin(2θ) + 2(sin(ϕ)^2)*sin(2θ) - 2sin(2θ)

The same expression without the constant factors does simplify correctly though.

tmp2=cos(ϕ)^2 * sin(2* θ)+sin(ϕ)^2*sin(2*θ) - sin(2*θ) 
simplify(tmp2)
@XLin0mu
Copy link

XLin0mu commented Jun 13, 2024

Solved in new version.

julia> using Symbolics

julia> @variables θ ϕ
2-element Vector{Num}:
 θ
 ϕ

julia> tmp=2*cos(ϕ)^2 * sin(2* θ)+2*sin(ϕ)^2*sin(2*θ) - 2*sin(2*θ);

julia> simplify(tmp)
0

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

No branches or pull requests

3 participants