Re: FindMinimum for several variables
- To: mathgroup at smc.vnet.net
- Subject: [mg20863] Re: FindMinimum for several variables
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Thu, 18 Nov 1999 01:09:39 -0500 (EST)
- References: <80tqfc$2ou@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Adalbert,
FunctionalFindMinimum[f_, start_List] :=
(# /. Last[
FindMinimum[f[#],
Evaluate[Sequence @@ (Transpose[{#, start}])]]]) &[
Unique[x] & /@ start]
f[{x_, y_}] := (x - 1)^2 + (y - 2)^2;
FunctionalFindMinimum[f, {2, 0}]
{1., 2.}
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
<hanssen at zeiss.de> wrote in message news:80tqfc$2ou at smc.vnet.net...
> Hi, MathGroup,
>
> FindMinimum[f, {x,x0},{y,y0}, ( ] searches for a local minimum in a
function
> of several variables, x0, y0,... are the starting values for the search.
>
> How can I use FindMinimum without having to name the components. My f is
already of the
> form f[x_List] and I would like to start the search on a given starting
vector. The result,
> which one would normally obtain as
>
> {x,y} /@ FindMinimum[f, {x,x0},{y,y0}, ( ][[2]] should be returned
> as a vector.
>
> The application is, when I have several minimizing problems with different
number
> of parameters. I have found a way to construct names for the variables
> from strings using ToExpression, but I am looking for a more elegant
> solution for this problem.
>
> kind regards
>
> Dipl.-Math. Adalbert Hanszen
>
>