From: cool-RR on
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.

From: cool-RR on
Thanks, it's working.

Ram.


On Tue, Mar 9, 2010 at 4:22 PM, dh <dh(a)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(a)metrohm.com>
> Internet:<http://www.metrohm.com>
>
>


--
Sincerely,
Ram Rachum


From: dh on


be used inside NMinimize. Here is an example:



fun[x_] := Norm[x0 - x]

On 09.03.2010 12:17, cool-RR wrote:

> I want to run this: `NMinimize[Distances[x, seq, z], x]` But x should

E-Mail:<mailto:dh(a)metrohm.com>

Internet:<http://www.metrohm.com>