Re: Using NMinimize on a vector
- To: mathgroup at smc.vnet.net
- Subject: [mg108183] Re: Using NMinimize on a vector
- From: cool-RR <cool-rr at cool-rr.com>
- Date: Wed, 10 Mar 2010 01:43:28 -0500 (EST)
- References: <hn5aok$6gt$1@smc.vnet.net> <4B96598F.4010303@metrohm.com>
Thanks, it's working. Ram. On Tue, Mar 9, 2010 at 4:22 PM, dh <dh at metrohm.com> wrote: > Hi Ram, > you want to minimize a scalar function of a vector argument. > I hope you are aware of the pitfalls of local and global minimas. > Let us call this function fun. > We now create a vector with variables with the requeste length, that can be > used inside NMinimize. Here is an example: > > x0 = {1, 2}; > fun[x_] := Norm[x0 - x] > x = Table[Unique[x], {Length[x0]}]; > NMinimize[fun[x], x] > > > On 09.03.2010 12:17, cool-RR wrote: > >> Hello, >> >> I want to run this: `NMinimize[Distances[x, seq, z], x]` But x should >> be a vector whose dimensions will only be known at run time. How can I >> do this? I know I could put vectors into NMinimize, but how to do it >> when the dimension isn't known until runtime? >> >> Thanks, >> Ram. >> >> > > -- > > Daniel Huber > Metrohm Ltd. > Oberdorfstr. 68 > CH-9100 Herisau > Tel. +41 71 353 8585, Fax +41 71 353 8907 > E-Mail:<mailto:dh at metrohm.com> > Internet:<http://www.metrohm.com> > > -- Sincerely, Ram Rachum