restart;
z := (x,y) -> exp(-(x-1)^2 - y^2) + exp(-(x+1)^2 - y^2);
solve({D[1](z)(x,y)=0, D[2](z)(x,y)=0}, {x,y});
This returns four solutions, two of which are:
{x = -1, y = 0}, {x = 3, y = 0}.
Surprisingly, these are far from being solutions
as evaluating D[1](z)(-1,0) and D[1](z)(3,0) shows.
Is this due to a Maple bug/feature or did I eat
too much Thanksgiving turkey?
[Tested on Maple 11, 12, 13].
--
Rouben Rostamian
I tried the optimization package, this is what I get:
With Maple12
===============
with(Optimization):
Minimize(exp(-(x-1)^2 - y^2) + exp(-(x+1)^2 - y^2));
[0.203708984379844490 * 10^-15 , [x = 1.16896322532382112, y =
6.00920669540742303]]
> Maximize(exp(-(x-1)^2 - y^2) + exp(-(x+1)^2 - y^2));
[1.01986581833111933, [x = 0.957503983154222250, y = 0.959583930651859228*
10^-8 ]]
in Mathematica
============
f=Exp[-(x-1)^2-y^2]+Exp[-(x+1)^2-y^2];
FindMinimum[f,{x,y}, Method->"ConjugateGradient"]
{3.05169*10^-275,{x->1.86789,y->25.1265}}
FindMaximum[f,{x,y}, Method->"ConjugateGradient"]
{1.01987,{x->0.957504,y->8.52452*10^-12}}
Some difference between the 2. But the max value is the same. Or may be I
made an error?
--Nasser
The function z does not achieve its minimum anywhere
because z(x,y)>0 for all x,y and z goes to zero at infinity.
This explains the discrepancy between the purported "minimum"
values computed by Mathematica and Maple but they cannot
be faulted for that. The maximum is computed correctly.
(Actually there are two points where z achieves the maximum
value because z(x,y is an even function of x.)
The location and value of z's maximum can be computed in a
number of different ways. For instance, it is easy to see
that it will occur at y=0, therefore it suffices to compute
the maximum of z(x,0) as a function of single variable which
is a much easier job.
The intent of my question was to find out whether Maple's
solve() is working as advertised or if its behavior in this
case should be considered a bug.
--
Rouben Rostamian
Yes, certainly it is a bug. I don't know how it arises in this case, but
there are times when solve produces spurious "solutions".
--
Robert Israel isr...@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
OK, thanks for confirming. I have reported this to Maplesoft support.
--
Rouben Rostamian
That analysis is partially correct. The function does achieve
a maximum at (x0,0) as you have calculated, but not at (-1,0).
--
Rouben Rostamian
I removed my message, but I guess some remnant of it remains out in
cyberspace somewhere.
R.G. Vickson