Re: ConstarinedMin Question

• To: mathgroup at smc.vnet.net
• Subject: [mg30908] Re: [mg30904] ConstarinedMin Question
• From: BobHanlon at aol.com
• Date: Mon, 24 Sep 2001 01:49:12 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```In a message dated 2001/9/23 2:30:51 AM, Moranresearch at aol.com writes:

>Why want this run? I don't undestand the error message. Thank you.
>
>In[28]:=
>c = {6.128, 6.129, 6.129,
>      6.130, 6.130, 6.130,
>      6.131, 6.130};
>In[29]:=
>d = {0.221, 0.452, 0.660, 0.890,
>      1.092, 1.320, 1.523,
>      1.748};
>In[30]:=
>f1[i_, j_] :=
>  Sum[Abs[Sqrt[(c[[1]] + i)^2 - j*d[[n]]^2] - c[[n]]], {n, 1, Length[c]}]
>In[31]:=
>ConstrainedMin[f1[i, j], {i < .1, j < 2}, {i, j}]

c = {6.128, 6.129, 6.129,
6.130, 6.130, 6.130,
6.131, 6.130};

d = {0.221, 0.452, 0.660, 0.890,
1.092, 1.320, 1.523,
1.748};

f1[i_, j_] :=
Sum[Abs[Sqrt[(c[[1]] + i)^2 - j*d[[n]]^2] - c[[n]]], {n, 1, Length[c]}];

FindMinimum[f1[i,j],{i,.05,.1}, {j,1.,2.}]

{0.0035030621249534377,
{i -> 0.0008671585637429163,
j -> -0.00797024374583214}}

The minimum occurs with a negative value of j.  The problem with
ConstrainedMin
may (?) be related to the statement in the documentation that ConstrainedMin
assumes
that all variables are non-negative; or, as in the case with FindMinimum,
that it cannot
symbolically determine the gradient of f1. The latter is the reason why two
starting
values are required for each variable in FindMinimum.

The function can be written more compactly as

f2[i_, j_] :=
Tr[Abs[Sqrt[(c[[1]] + i)^2 - j*d^2] - c]];

FindMinimum[f2[i,j],{i,.05,.1}, {j,1.,2.}]

{0.0035030621249534377,
{i -> 0.0008671585637429163,
j -> -0.00797024374583214}}

Bob Hanlon
Chantilly, VA  USA

```

• Prev by Date: Re: Use of Mathematica under UNIx
• Next by Date: RE: Oh Where, Oh Where Have My Values Gone?
• Previous by thread: ConstarinedMin Question
• Next by thread: Re: ConstarinedMin Question