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

solve(....solution_dict=True) produces nonsense #24102

Open
rwst opened this issue Oct 25, 2017 · 1 comment
Open

solve(....solution_dict=True) produces nonsense #24102

rwst opened this issue Oct 25, 2017 · 1 comment

Comments

@rwst
Copy link

rwst commented Oct 25, 2017

sage: solve([x**2-1>0,x>0],x,solution_dict=True)
[{1: x}]

Probably the correct result from Maxima is mistranslated. Of course inequalities expressing interval results should not be converted to dict.

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/24102

@rwst rwst added this to the sage-8.1 milestone Oct 25, 2017
@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Jun 9, 2020

comment:1

Another mistranslation, found when fooling around #21789 :

sage: SG=desolve(eq, y(x)) ; SG
(_K2*log(x) + _K1)*x
sage: #  Boundary conditions
sage: solve([SG(x=1)==e, SG(x=e)==2*e],[_K1,_K2])
[[e == _K1, _K2 == -e + 2]]
sage: solve([SG(x=1)==e, SG(x=e)==2*e],[_K1,_K2], solution_dict=True)
[{e: _K1, _K2: -e + 2}]

Such "solutions" inverting (part of) variable-value couples, can't be used for further substitution. This may be a cause of #21789...

Note that :

sage: var("a, b")
(a, b)
sage: solve([SG(x=1)==a, SG(x=e)==b],[_K1,_K2], solution_dict=True)
[{_K1: a, _K2: -(a*e - b)*e^(-1)}]
sage: SG.subs(solve([SG(x=1)==a, SG(x=e)==b],[_K1,_K2], solution_dict=True))(x=1)
....: 
a
sage: SG.subs(solve([SG(x=1)==a, SG(x=e)==b],[_K1,_K2], solution_dict=True))(x=e)
....: .expand()
b

This hints at a mishandling of "variable-lookalike" constants. Deep in the Maxima interface...

@mkoeppe mkoeppe removed this from the sage-8.1 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants