MathGroup Archive 1998

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

Search the Archive

Gradient Option in FindMinimum


Math Group:

Is the following a bug?

First, I set nameofgrad equal to 2*x.

In[32]:= nameofgrad = {2*x}
Out[32]= {2 x}

Second, I show that if {2*x} is put directly into the FindMin. 
expression everything works okay.

In[33]:= FindMinimum[x^2,{x,1.},Gradient->{2* x}] Out[33]= { 0.,{x-> 0.} }

Third, here is the bug (I think), when I put nameofgrad into the 
FindMin. expression (which is just equal to {2*x}), I get an error 
message!

In[34]:= FindMinimum[x^2,{x,1.},Gradient->nameofgrad]

FindMimimum::fmgl : Gradient {{2.}} is not a length 1 list of real 
numbers at {x} = {1.}

Can anyone duplicate this on their machine?  Any ideas?

Thanks in advance,

Chris Farr

P.S. This causes problems in the MultiplierMethod.m package listed on 
MathSource.


  • Prev by Date: Re: Re: declaring integers
  • Next by Date: Electrical Engineering package
  • Previous by thread: Training in the French Alps
  • Next by thread: Re: Gradient Option in FindMinimum