Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Gradient Option in FindMinimum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13223] Gradient Option in FindMinimum
  • From: "Chris Farr" <farr at brown.edu>
  • Date: Mon, 13 Jul 1998 07:43:12 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

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