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

Can't solve symbolic equations containing inexact (e.g. RIF, RBF) numbers #27314

Open
rburing opened this issue Feb 18, 2019 · 3 comments
Open

Comments

@rburing
Copy link
Contributor

rburing commented Feb 18, 2019

There are (undocumented?) symbolic wrappers around RIF, RBF objects, but solving equations with them

sage: var('x')
sage: solve(x + RIF(0.999,1.001) == 0, x)

fails because the inexact objects cannot be converted to Maxima objects.

This is confusing to new users; see Ask SageMath: long traceback when calling solve().

Specifying algorithm='sympy' gives a solution but loses information about precision.

The least thing that could be done is for solve(eqn, x) to check eqn.is_exact() and give a warning.

Component: symbolics

Keywords: RIF, RBF, solve

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

@rburing rburing added this to the sage-8.7 milestone Feb 18, 2019
@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Feb 18, 2019

comment:1

One notes that numerical root seeking via find_root also fails for both RIF and RBF :

sage: u=RIF(0.99,1.01);u
1.0?
sage: s=find_root(x+u,-3,3);s
-1.0
sage: type(s)
<type 'float'>
sage: v=RBF(v);v
1.000000000000000
sage: v=v.add_error(0.01);v
[1.0 +/- 0.0101]
sage: s2=find_root(x+v,-3,3);s2
-1.0
sage: type(s2)
<type 'float'>

Extending find_root to handle RIF and RBF expressions would allow to handle the cases where no explicit form of a root solution is known (e. g. implicit expressions resulting of solve), where find_root allows to compute a numerical approxomation.

This would certainly be handy (but is probably a significant project in itself !).

It might also be useful to check which of the optimization functions in Sage support such uncertainty handling...

@embray
Copy link
Contributor

embray commented Mar 25, 2019

comment:2

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

@embray embray modified the milestones: sage-8.7, sage-8.8 Mar 25, 2019
@embray
Copy link
Contributor

embray commented Jun 14, 2019

comment:3

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

@embray embray removed this from the sage-8.8 milestone Jun 14, 2019
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