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

MathGroup Archive 1997

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

Search the Archive

Re: FindMinimum var specification

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8870] Re: [mg8828] FindMinimum var specification
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Tue, 30 Sep 1997 20:16:35 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

"Bernd Gehrmann" <gehrmab at uni-muenster.de>
[mg8828] FindMinimum var specification
writes

>why does the following not work (and how can
> I make it work)?
>
> vars := Sequence[{x[1],0.1},{x[2],0.1}];
> FindMinimum[x[1]^2 + x[2]^2, vars];


Explanation: FindMinimum has attribute HoldAll and seems to be  
checking input before evaluating vars.

Solution: make it evaluate vars.

vars := Sequence[{x[1],0.1},{x[2],0.1}]

FindMinimum[x[1]^2 + x[2]^2,Evaluate[vars]]

	FindMinimum::"fmgz": "Encountered a vanishing gradient. The 	
	result returned may not be a minimum; it may be a maximum or 	
	a saddle point."

Out[33]=
{0.,{x[1]->0.,x[2]->0.}}

Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk/training.html
voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
Leicester,  UK



  • Prev by Date: FindRoot
  • Next by Date: Q: 3D convex hull?
  • Previous by thread: Re: FindMinimum var specification
  • Next by thread: [Help?] Integer/Decimal portion of a real number