MathGroup Archive 2011

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115363] how to remove $RecursionLimit::reclim: and $IterationLimit::itlim:
  • From: tarun dutta <tarunduttaz at gmail.com>
  • Date: Sun, 9 Jan 2011 02:17:19 -0500 (EST)

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


  • Prev by Date: Re: Tensor cross vector
  • Next by Date: Re: original meaning of System` functions
  • Previous by thread: Re: Odd (to me) Context issue with Packages?
  • Next by thread: Re: how to remove $RecursionLimit::reclim: and $IterationLimit::itlim: