MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim:

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115403] Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim:
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Mon, 10 Jan 2011 02:37:49 -0500 (EST)

It helps if you put ";" after "conj[a_] := ComplexExpand[Conjugate[a]]".

Bobby

On Sun, 09 Jan 2011 01:17:19 -0600, tarun dutta <tarunduttaz at gmail.com>  
wrote:

> Do[Print[n = 5;
>   q = 1;
>   Print["P= ", p, " Q=", q];
>   d[n + 1] = 0; g[n + 1] = 0;
>   d[i_] = re[i] + I*im[i];
>   g[i_] = ree[i] + I*imm[i];
>   conj[a_] := ComplexExpand[Conjugate[a]]
>     f1 = Together[
>       Sum[6*p*Sqrt[i + 1]*d[i]*
>          conj[d[i + 1]]*(Sum[
>            Sqrt[i]*g[i]*conj[g[i - 1]], {i, 0, n}]) +
>         6*p*Sqrt[i]*d[i]*
>          conj[d[i - 1]]*(Sum[
>            Sqrt[i + 1]*g[i]*conj[g[i + 1]], {i, 0, n}]) + (-q*i +
>            i (i - 1))* d[i]*conj[d[i]], {i, 0, n}]];
>   f2 = Together[
>     Sum[6*p*Sqrt[i + 1]*g[i]*
>        conj[g[i + 1]]*(Sum[
>          Sqrt[i]*d[i]*conj[d[i - 1]], {i, 0, n}]), {i, 0, n}] +
>      Sum[6*p*Sqrt[i]*g[i]*
>         conj[g[i - 1]]*(Sum[
>           Sqrt[i + 1]*d[i]*conj[d[i + 1]], {i, 0, n}]) + (-q*i +
>           i (i - 1)) g[i]*conj[g[i]], {i, 0, n}]];
>   f = Plus[f1, f2];
>   c = Expand@
>      ComplexExpand[
>       Sum[d[i]*conj[d[i]] + g[i]*conj[g[i]], {i, 0, n}]] == 1;
>   v = Join[Array[re, n + 1, 0], Array[im, n + 1, 0],
>     Array[ree, n + 1, 0], Array[imm, n + 1, 0]];
>   Timing[NMinimize[{f, c}, v,
>     Method -> {"RandomSearch", Method -> "InteriorPoint"}]]], {p, 0,
>   2/10, 1/1000}]
> (*table=Table[Block[{p=pi,q=qi},min=First[NMinimize[{f,c},v,Method->{\
> "RandomSearch",Method->"InteriorPoint"}]];
> Print[p,Tab,q,Tab,min];{p,q,min}],{pi,0,2},{qi,0,2}];*)
>
> P= 0 Q=1
>
> $RecursionLimit::reclim: Recursion depth of 256 exceeded. >>
>
> $RecursionLimit::reclim: Recursion depth of 256 exceeded. >>
>
> $RecursionLimit::reclim: Recursion depth of 256 exceeded. >>
>
> General::stop: Further output of $RecursionLimit::reclim will be
> suppressed during this calculation. >>
>
> $IterationLimit::itlim: Iteration limit of 4096 exceeded. >>
>
> $IterationLimit::itlim: Iteration limit of 4096 exceeded. >>
>
> $IterationLimit::itlim: Iteration limit of 4096 exceeded. >>
>
> General::stop: Further output of $IterationLimit::itlim will be
> suppressed during this calculation. >>
>
>
>
> my problem is that how will I remove this kind of error?
> give some valuable insight
> regards,
> tarun
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: 2 obvious
  • Next by Date: Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim:
  • Previous by thread: Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim:
  • Next by thread: Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim: