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 misses some solutions in a certain nonlinear system #8862

Open
sagetrac-casamayou mannequin opened this issue May 3, 2010 · 9 comments
Open

solve misses some solutions in a certain nonlinear system #8862

sagetrac-casamayou mannequin opened this issue May 3, 2010 · 9 comments

Comments

@sagetrac-casamayou
Copy link
Mannequin

sagetrac-casamayou mannequin commented May 3, 2010

We search the critical points of the function x|-> (x2 + y2)^x

This function has four critical points : ±(0,1) and ±(1/e,0)

However the function solve can not find any of this.

More, solve returns (0,0) which is not a critical point since f is not differentiable at (0,0) !

  sage: var('x y')
  sage: f(x,y) = (x^2 + y^2)^x
  sage: solve([diff(f(x,y), x), diff(f(x,y), y)], x, y)
  [[x == 0, y == 0]] 

Upstream: Reported upstream. No feedback yet.

CC: @kcrisman @robert-marik @jasongrout

Component: calculus

Keywords: solve

Stopgaps: #12730

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

@sagetrac-casamayou sagetrac-casamayou mannequin added this to the sage-4.4.2 milestone May 3, 2010
@zimmermann6
Copy link

Changed author from Alexandre Casamayou to none

@burcin
Copy link

burcin commented May 4, 2010

comment:2

What is the expected improvement in this ticket?

The solve() function in Sage is just a wrapper around maxima for now. In this case we just return the result from maxima.

There are two problems here:

If this ticket is about improving the capabilities of solve to handle the given input properly, this is an enhancement request. Do we know of any algorithm that will help with this?

Otherwise, this ticket is a duplicate of #2617.

Comments?

@zimmermann6
Copy link

comment:3

the issue here is not only that Sage returns undefined points (which indeed duplicates #2617) but
that it fails to find the following (trivial) solutions, which is a defect:

sage: sys=[diff(f(x,y), x), diff(f(x,y), y)]
sage: map(lambda s: s.subs(x=0,y=1),sys)
[0, 0]
sage: map(lambda s: s.subs(x=0,y=-1),sys)
[0, 0]
sage: map(lambda s: s.subs(x=1/e,y=0),sys)
[0, 0]
sage: map(lambda s: s.subs(x=-1/e,y=0),sys)
[0, 0]

For example Maple finds:

> f := (x,y) -> (x^2 + y^2)^x:                                         
> solve({diff(f(x,y), x), diff(f(x,y), y)}, {x, y}, Explicit=true);
                                          exp(1)               exp(1)
  {x = 0, y = 1}, {x = 0, y = -1}, {x = - ------, y = 0}, {x = ------, y = 0}
                                          exp(2)               exp(2)

When some solutions are lost, at least a warning should be issued.

@burcin
Copy link

burcin commented May 6, 2010

comment:4

Replying to @zimmermann6:

the issue here is not only that Sage returns undefined points (which indeed duplicates #2617) but
that it fails to find the following (trivial) solutions, which is a defect:

> When some solutions are lost, at least a warning should be issued.

I don't think we can get that information out of maxima. Can someone more experienced in maxima comment on this? Or ask the maxima developers what they think about this problem?

Another option is to take this as an opportunity to start implementing some native solve() functionality in Sage. I have no idea how to (more or less algorithmically) find a solution to this system though. I'd appreciate any pointers.

@kcrisman
Copy link
Member

Upstream: Reported upstream. Little or no feedback.

@kcrisman
Copy link
Member

comment:5
Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) solve([(2*x^2/(x^2 + y^2) + log(x^2 + y^2))*(x^2 + y^2)^x,2*x*y*(x^2 + y^2)^(x - 1)],[x,y]);
(%o1)                          [[x = 0, y = 0]]

So still present in 4.7.alpha1.

This is a pretty straightforward Maxima bug/enhancement need.

The issue about it not being a critical point is irrelevant, since this is exactly equivalent to the uninterpreted

solve([(2*x^2/(x^2 + y^2) + log(x^2 + y^2))*(x^2 + y^2)^x,2*x*y*(x^2 + y^2)^(x - 1)],[x,y])

So the relevant problem is that it's returning something not in the domain of the functions in question, which is indeed a problem. In addition to not finding other solutions.

This is now Maxima bug 3216684.

@kcrisman kcrisman changed the title failing resolution of a nonlinear system by solve solve misses some solutions in a certain nonlinear system Mar 16, 2011
@roed314
Copy link
Contributor

roed314 commented Mar 22, 2012

Stopgaps: #12730

@roed314
Copy link
Contributor

roed314 commented Jun 1, 2012

Changed upstream from Reported upstream. Little or no feedback. to Reported upstream. No feedback yet.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@sagetrac-mafra
Copy link
Mannequin

sagetrac-mafra mannequin commented Oct 7, 2016

comment:12

Just a random comment: sympy can solve this. I tested it in the 'live shell' in their webpage:

solve([(x**2 + y**2)**x*(2*x**2/(x**2 + y**2) + log(x**2 + y**2)),2*(x**2 + y**2)**(x - 1)*x*y],x,y)
[(0,−1),(0,1),(−1/e,0),(1/e,0)]

(I edited the output because copy&paste mangled it).

It would be nice to have an 'algorithm=sympy' option to solve(). It seems that nobody is working in the Maxima bug.

@mkoeppe mkoeppe removed this from the sage-6.4 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

6 participants