MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Is this a problem in mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74643] Re: Is this a problem in mathematica?
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 29 Mar 2007 02:35:11 -0500 (EST)
  • References: <eud3g1$l0t$1@smc.vnet.net>


Hi,

Minimize searches the global minimum and if you read the manual, there 

you find: "Even if the same minimum is achieved at several points, only 

one is returned".

To get both x values, you can e.g. write the distance as a function of 

x: dist = x^2 + ((x^2 + 1) - 2)^2 and search extremal points like:

Solve[{D[dist,x]==0,D[dist,y]==0},{x}]

Daniel



traz wrote:

> Let's say I wanna solve this problem:

> 

> Determine point(s) on y = x^2 +1 that are

> closest to (0,2).

> 

> So in mathematica:

> 

> minDist = (x - 0)^2 + (y - 2)^2;

> Minimize[minDist, y == 1 + x^2, {x, y}]

> 

> Output will give you: x -> -1/Sqrt[2], y -> 3/2

> 

> but x also has another answer: +1/Sqrt[2]. Is this a problem in mathematica or can my code be changed to output the other value of x for the minimum distance?

> 




  • Prev by Date: 2X2 arrays
  • Next by Date: Re: comments in import files
  • Previous by thread: Re: Is this a problem in mathematica?
  • Next by thread: Re: Is this a problem in mathematica?