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

solveset_real need to check symbol in piecewise-condition.Expression with multiple abs ,having Piecewise solution as 0 #10550

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Shekharrajak
Copy link
Member

Fixes #10122 and #10534

To fix the Assertion Error of piecewise test-case in PR #10502
need changes of PR #10547
I merged that PR branch into this.

@Shekharrajak Shekharrajak changed the title 10534 merge 10122 solveset_real need to check symbol in condition ,Expression with multiple abs ,having Piecewise solution as 0 Feb 8, 2016
@Shekharrajak Shekharrajak changed the title solveset_real need to check symbol in condition ,Expression with multiple abs ,having Piecewise solution as 0 solveset_real need to check symbol in piecewise-condition ,Expression with multiple abs ,having Piecewise solution as 0 Feb 8, 2016
@Shekharrajak Shekharrajak changed the title solveset_real need to check symbol in piecewise-condition ,Expression with multiple abs ,having Piecewise solution as 0 solveset_real need to check symbol in piecewise-condition.Expression with multiple abs ,having Piecewise solution as 0 Feb 8, 2016
for (expr, in_set) in expr_set_pairs:
solns = solveset_real(expr, symbol).intersect(in_set)
result = result + solns
expr_cond = {}
Copy link
Member

Choose a reason for hiding this comment

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

just write expr_cond = dict(f.args)?

@@ -304,7 +304,40 @@ def test_piecewise_solve():
(-x + 2, x - 2 <= 0), (x - 2, x - 2 > 0))
assert solve(g, x) == [5]

# See issue 4352 (enhance the solver to handle inequalities).

def test_piecewise_solveset():
Copy link
Member

Choose a reason for hiding this comment

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

This should be in the solveset test suite; you aren't testing Piecewise, you are testing how solveset handles it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I found test case for solve just above so copied the same cases for solveset to check it is working correctly or not.
I have shifted the both testcases.

@smichr
Copy link
Member

smichr commented Feb 11, 2016

Also, see comment on line 490.

@Shekharrajak
Copy link
Member Author

I changed the expr_cond = {} to expr_cond = dict(f.args).Thanks for pointing this. @smichr

@Shekharrajak
Copy link
Member Author

Why is solveset_real totally changed in master branch?

def solveset_real(f, symbol):
    return solveset(f, symbol, S.Reals)

@smichr
Copy link
Member

smichr commented Feb 17, 2016

Why is solveset_real totally changed in master branch?

Because it went through a major overhaul. It, and solveset_complex are now just thin wrappers for calling solveset with the real or complex domain. It was this overhaul that I mentioned in another of your PRs.

@Shekharrajak
Copy link
Member Author

I spent hours for these PRs. I did similar thing with _solve_real_trig in PR 10552.
and also that PR tried to handle trigonometric and hyperbolic function same as solveset_real in solveset_complex (which is now not needed).
Now _solveset is handling both domain so I need to place my changes there.
Should I go ahead and fix this conflict in both PR ,will these changes be accepted?

@smichr
Copy link
Member

smichr commented Mar 18, 2016

Should I go ahead and fix this conflict in both PR ,will these changes be accepted?

For this PR, yes. It looks like the other one is already closed.

@Shekharrajak Shekharrajak force-pushed the 10534_merge_10122 branch 2 times, most recently from 2476407 to 79bd2c2 Compare April 9, 2016 07:19
@Shekharrajak
Copy link
Member Author

@smichr , please review once.

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

Successfully merging this pull request may close these issues.

expression with multiple abs has partial solution returned
3 participants