       Re: problem with LessEqual::nord:

• To: mathgroup at smc.vnet.net
• Subject: [mg115878] Re: problem with LessEqual::nord:
• From: Peter Pein <petsie at dordos.net>
• Date: Sun, 23 Jan 2011 17:32:47 -0500 (EST)
• References: <ihbjvn\$dl3\$1@smc.vnet.net> <ihe451\$q9r\$1@smc.vnet.net>

```On 22.01.2011 09:22, tarun dutta wrote:
> On Jan 21, 2:34 pm, tarun dutta<tarundut... at gmail.com>  wrote:
>> I am using "NMINIMIZE" to get the result of a function which contains
>> complex term.after executing the program it is showing the following
>> error--
>> LessEqual::nord: Invalid comparison with 155.698+0. I attempted.>>
>>
>> can you explain the reason and how will I be free from this kind of
>> error?
>> regards,
>> tarun
>
> n = 5;
> p = 86/1000;
> q = 1;
> Print["P= ", p, ";Q=", q];
> d[n + 1] = 0;
> d[i_] = re[i] + I*im[i];
> conj[a_] := ComplexExpand[Conjugate[a]]; f =
>   Together[Sum[
>     4*p*(Sqrt[i + 1]*d[i]*
>          conj[d[i + 1]]*(Sum[
>            Sqrt[i + 1]*conj[d[i]]*d[i + 1], {i, 0, n}]) +
>         Sqrt[i + 1]*conj[d[i]]*
>          d[i + 1]*(Sum[
>            Sqrt[i + 1]*d[i]*conj[d[i + 1]], {i, 0, n}])) + (-q*i +
>         i (i - 1))* d[i]*conj[d[i]], {i, 0, n}]];
> c = Expand@ComplexExpand[Sum[Abs[d[i]]^2, {i, 0, n}]] == 1;
> v = Join[Array[re, n + 1, 0], Array[im, n + 1, 0]];
...

Hi,

the value of f depends only on the radii of d[i]:

In:= fpolar =
Collect[f /. {re -> (r[#] Cos[#] &), im -> (r[#] Sin[#] &)},
r /@ Range[0, n],
FullSimplify[#,
cpolar =
And @@ Flatten[{Sum[r[k]^2, {k, 0, n}] == 1,
Table[0 <= r[k] <= 1 && -Pi <= t[k] <= Pi, {k, 0, n}]}]] &]

Out= 86/125 r^2 r^2 + r^2 (-1 + (172 r^2)/125) +
258/125 r^2 r^2 + r^2 (3 + (344 r^2)/125) + (
344 r r^2 r)/(25 Sqrt) + 15 r^2 +
r (344/125 Sqrt r^2 r +
172/25 Sqrt[3/5] r r r) + r^2 (8 + (86 r^2)/25) +
r (172/125 Sqrt r^2 r +
r (344/125 Sqrt r r + 172/25 Sqrt[2/5] r r)) +
r (172/125 Sqrt r^2 r +
r (172/125 Sqrt r r + 344/125 r r + (
172 r r)/(25 Sqrt)))

In:= Clear@target;
target[rr : {__?NumericQ}] :=
fpolar /. Thread[(r /@ Range[0, n]) -> rr]

In:= sol =
NMinimize[{target[r /@ Range[0, n]],
DeleteCases[cpolar, _t, \[Infinity]]}, r /@ Range[0, n]]

Out= {-1., {r -> 0., r -> 1., r -> 0., r -> 0.,
r -> 0., r -> 0.}}

so you are free to select any d on the unit-circle.

Cheers,
Peter

```

• Prev by Date: Re: Simple n-tuple problem - with no simple solution
• Next by Date: Re: Simple n-tuple problem - with no simple solution
• Previous by thread: Re: problem with LessEqual::nord:
• Next by thread: Re: problem with LessEqual::nord: