MathGroup Archive 2005

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

Search the Archive

V5.2 or 5.1 slower than v.5.0 for NIntegrate ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61055] V5.2 or 5.1 slower than v.5.0 for NIntegrate ?
  • From: "Toshiyuki \(Toshi\) Meshii" <meshii at mech.fukui-u.ac.jp>
  • Date: Sun, 9 Oct 2005 01:35:03 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello

I found out that NIntegrate applied for a function with a singurality point 
might become slow by upgrading from v5.0 to 5.1 or 5.2.
Here are some results.


Xeon-2.8GHz, ram 1024MB, winxp64
$B!!!!!!!!(Bv5.0$B!!!!!!!!(B      v5.1$B!!!!!!(B    v5.2
$B!!(B  362.31 sec      1006.48sec    1042.14 sec

P4-3.0GHzHT, ram 512MB, winxppro
$B!!!!!!!!(Bv5.0$B!!!!!!!!!!!!(B      v5.1
$B!!(B  385.16 sec         963.81 sec

Does someone have any idea about this inconvenience?

The benchmark time is the CPU time for calculating Kcyl in the below.
-Toshi
--------------------------
\!\(\*
  RowBox[{"\n", \( \), "\[IndentingNewLine]",
    RowBox[{\(Ri\  := \ 1000\
      ri\ ; \ Ro\  := \ 1000\ ro\ ; W = Ro - Ri; \ Rm\  = \ \((Ri\  + Ro)\)\ 
/
    2; w = ro - ri; rm = \((ri +
        ro)\)/2;\), "\[IndentingNewLine]", "\n", \( \), "\n", \
\(<< c:\\meshii\\Mathematica\\weight3.m;\),
        "\[IndentingNewLine]", "\n", "\n",
      RowBox[{
        RowBox[{\(Kcyl[t_, $B&N(B_]\), ":=",
          RowBox[{"Module", "[",
            RowBox[{\({T, Tavg, Mt, Z = W\^2/6, Ftfer,
      Kfer, sin = Sin[H\ $B&B(B], cos = Cos[H\ $B&B(B], sinh = Sinh[H\
        $B&B(B], cosh = Cosh[H\ $B&B(B], F1N, d$B&W(B = d$B&W(Bf[$B&N(B], c1 = Ri/W, X, F2N, \ 
$B&W(B = \ \
$B&W(Bf[$B&N(B], KNn, F1t, F2t, Ktn, Knl, d$B&K(B = \ $B&$&K(B[$B&N(B], Fm = \(\@\($B&P(B\ $B&N(B\ W\)\) 
FM[$B&N(B],
      EYt = \ \(EY\ $B&A(B\)\/\(1 - $B&M(B\), DYb = DY\
      $B&B(B\ }\), ",",
        "\[IndentingNewLine]", \( (*\ u[\ r\ m, \ t\ sec]\  = \ T[r] $B$NDj5A(B, 
\ $B&$(BT =
          1\ K*) \), "\[IndentingNewLine]",
              RowBox[{\(T[r_] = u[r, t]\), ";", "\[IndentingNewLine]",
            "\[IndentingNewLine]", \( (*$BJ?6Q29EY(B\ Tavg[t] $B!$G.JQ7AAjEv%b!<%a%s%H(BMt[t]
                           $B$NDj5A(B*) \), "\[IndentingNewLine]", \(Tavg = \
                2\/\((\ ro\^2 -
                   ri\^2)\)\ NIntegrate[Evaluate[r\ T[r]], \ {r, ri, ro}]\), 
\
";", "\[IndentingNewLine]", \(Mt = \ EYt\ \(10\^6\) \
\((NIntegrate[Evaluate[T[r]\ \((rm\  - \ r)\)], {r, ri,
                 ro}]\ )\)\), ";", "\n", "\[IndentingNewLine]", \( \
(*\($B@~7A29EYJ,I[AjEvJ,$N7W;;(B\ Kfer\  = \ Kfe\  + \ Kr\ \((
                      $B9bB.%"%k%4%j%:%`(B\)\)\($B!K(B\)*) \),
                        "\n", "\n", \(Ftfer = \((2\ DYb\ \((cos - cosh - 
sin\
                                sinh)\)\
                              d$B&K(B)\)/\((\((sin + sinh + DYb\ \((\(-2\) + cos 
+
                cosh)\)\ d$B&K(B)\)\ \((\(-
                cos\) + cosh + DYb\ \((sin + sinh)\)\ d$B&K(B)\))\)\), ";
                  ", "\[IndentingNewLine]", \(Kfer = \ Ftfer\ \((\(-Mt\)\/Z\
                        Fm)\)\), ";", "\n",
                         "\n", \( (*\($BHs@~7A29EYJ,I[AjEvJ,$N7W;;(B\ Knl\ \ 
from\ Ktn\
                    and\ KNn\ \(($B9bB.%"%k%4%j%:%`(B\)\)\($B!K(B\)*) \),
                "\[IndentingNewLine]", \(vnn[X_]\  = \ vn[X,
                          $B&N(B]\), ";", "\[IndentingNewLine]", \(F1N = \ d$B&W(B\ 
\
NIntegrate[\ Evaluate[\((
                      c1\  + \
                          X)\)\ \ vnn[X]], \ {X, 0,
                            $B&N(B}]\), " ", ";", "\n",
                        "\[IndentingNewLine]", \(dvnn[X_]\  = \ dvn[X, 
$B&N(B]\), ";", "\[
                          IndentingNewLine]",
                RowBox[{"F2N", "=", " ",
                  RowBox[{"$B&W(B", " ",
                    RowBox[{"NIntegrate", "[",
                      RowBox[{\(Evaluate[\((c1\  + \ X)\)\ \ dvnn[X]]\), 
",",
                      " ", \({X, 0, $B&N(B}\),
                       ",", "\n", "\t\t

                                   ", \(MinRecursion -> 3\), ",
                        ", "\n", "
                          ", \(MaxRecursion\  -> \ 10\), ",", "\n", "\t\t 
\
          ", \(SingularityDepth\  -> \ 10\), ",", "\n", "\t\t 
\
",
                        RowBox[{"MaxPoints", "->",
                          StyleBox[
                            RowBox[{
                              StyleBox["1",

                            FontColor->RGBColor[1, 0, 0]], "00000"}]]}]}], \
"]"}]}]}], ";", "\n", "\[IndentingNewLine]", \(KNn = \ \ Tavg\ \((\ F1N +
                          F2N)\)\), ";", "\[IndentingNewLine]",
                         "\[IndentingNewLine]", \(F1t = \ \ \ d$B&W(B\ 
NIntegrate[\
\ Evaluate[\((c1\  + \ X)\)\ T[ri + w\ X]\ vnn[X]], \ {X, 0, $B&N(B}]\), " ", 
";",
                        "\[IndentingNewLine]", "\n",
                RowBox[{"F2t", "=", "   ",
                  RowBox[{"$B&W(B", " ",
                    RowBox[{"NIntegrate", "[",
                      RowBox[{\(Evaluate[\((c1\  + \ X)\)\ \ T[ri + w\ X]\
                      dvnn[X]]\), ",", "
                      ", \({X, 0, $B&N(B}\), ",", "\n
                          ", "\t\t
                                                      ", \(MinRecursion ->
                        3\), ",", "\n", "
                                         ", \(MaxRecursion\  -> \ 10\), ",",
                         "\n", "\t\t               ", 
(SingularityDepth\  -> \
\ 10\), ",", "\n", "\t\t               ",
                        RowBox[{"MaxPoints", "->",
                          StyleBox[
                            RowBox[{
                              StyleBox["1",
                                FontColor->RGBColor[1, 0, 0]], "
                        00000"}]]}]}], "]"}]}]}], " ", ";", "\
\[IndentingNewLine]", "\n", \(Ktn = \ F1t + F2t\), ";", "\n", \(Knl = \
                        EYt \(\(\(\ \)\(W\)\)\/\((Ri\ /\ W + $B&N(B)\)\) 2 \
\((\(-Ktn\)\  + \ KNn)\)/\ \((\ $B&W(B\ Fm)\)\), ";", " ",
                        "\[IndentingNewLine]", \( (*$B:G=*7W;;(B*) \),
                         "\[IndentingNewLine]", \($B&$(BT \((Knl + 
Kfer)\)\)}]}],
                          "]"}]}], ";"}]}]}]\)
---------------------------------------------------------------




  • Prev by Date: Re: Re: MathML, Mozilla, fonts and Mathematica 5.2
  • Next by Date: Re: Pure Function for String Selection
  • Previous by thread: Re: Wick like theorem and "symbolic" compilation
  • Next by thread: Re: V5.2 or 5.1 slower than v.5.0 for NIntegrate ?