MathGroup Archive 2006

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

Search the Archive

Re: Reasonable integration speed? (24 hrs and counting)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68025] Re: Reasonable integration speed? (24 hrs and counting)
  • From: "Mark Westwood" <markc.westwood at gmail.com>
  • Date: Fri, 21 Jul 2006 05:37:10 -0400 (EDT)
  • References: <e9nkvm$9vo$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Alex

I think you have a problem.  My Mathematica installation solved the
integral in about 3 seconds,  here's the solution (in CellExpression
form)

Cell[BoxData[
    RowBox[{
      SubsuperscriptBox["\[Integral]",
        RowBox[{"-",
          FractionBox["d", "2"]}],
        FractionBox["d", "2"]],
      RowBox[{
        RowBox[{
          RowBox[{"Cos", "[",
            FractionBox[
              RowBox[{
                RowBox[{"(",
                  RowBox[{"1", "+",
                    RowBox[{"2", " ", "n"}]}], ")"}], " ", "\[Pi]",
                " ", "x"}], "d"], "]"}], " ",
          RowBox[{"(",
            RowBox[{"p", "+",
              RowBox[{
                FractionBox["1",
                  RowBox[{"8", " ",
                    SuperscriptBox["\[Pi]", "2"], " ", "w", " ",
                    SuperscriptBox[
                      RowBox[{"f", "[", "x", "]"}], "5"]}]],
                RowBox[{"(",
                  RowBox[{"\[ImaginaryI]", " ", "d", " ",
                    SuperscriptBox["\[ExponentialE]",
                      RowBox[{
                        RowBox[{"-", "\[ImaginaryI]"}], " ", "k", " ",

                        RowBox[{"f", "[", "x", "]"}]}]], " ",
                    RowBox[{"(",
                      RowBox[{
                        RowBox[{
                          SuperscriptBox["a", "2"], " ",
                          SuperscriptBox["k", "2"], " ",
                          SuperscriptBox[
                            RowBox[{"f", "[", "x", "]"}], "2"]}], "+",

                        RowBox[{
                          RowBox[{"(",
                            RowBox[{"1", "+",
                              RowBox[{
                              "\[ImaginaryI]", " ", "k", " ",
                                RowBox[{"f", "[", "x", "]"}]}]}],
                            ")"}], " ",
                          RowBox[{"(",
                            RowBox[{
                              RowBox[{
                                RowBox[{"-", "3"}], " ",
                                SuperscriptBox["a", "2"]}], "+",
                              RowBox[{"2", " ",
                                SuperscriptBox[
                                  RowBox[{"f", "[", "x", "]"}],
                                  "2"]}]}], ")"}]}]}], ")"}]}],
                  ")"}]}]}], ")"}]}],
        RowBox[{"\[DifferentialD]", "x"}]}]}]], "Output",
  CellLabel->"Out[1]="]

and again as plain text, which you may prefer

Out[1]=
\!\(\[Integral]\_\(-\(d\/2\)\)\%\(d\/2\)\(Cos[\(\((1 + 2\ n)\)\ \[Pi]\
\
x\)\/d]\ \((p + \(\(1\/\(8\ \[Pi]\^2\ w\ f[x]\^5\)\)\((\[ImaginaryI]\
d\ \
\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ k\ f[x]\)\ \((a\^2\ k\^2\
f[x]\^2 + \
\((1 + \[ImaginaryI]\ k\ f[x])\)\ \((\(-3\)\ a\^2 +
                          2\ f[x]\^2)\))\))\)\))\)\)
\[DifferentialD]x\)

Hope this helps

Mark Westwood
Parallel Programmer

axlq wrote:
> I downloaded the trial version of Mathematica to see if it could
> solve a complex integral. After getting comfortable with solving
> simple integrals, I input my target problem:
>
> In[1]:= f[x] = Sqrt[a^2+(q-x)^2]
>
> In[2]:= Integrate[Cos[(2*n + 1)*Pi*x/d]*
>   (Exp[-I*k*f[x]]/(4*Pi*f[x]^5)*((1 + I*k*f[x])*(2*f[x]^2 - 3*a^2)
>     + (k*a*f[x])^2) * I*d/(2*Pi* w) + p), {x, -d/2, d/2}]
>
> Observations:
>
> 1. It's been sitting there for over 24 hours now.
>
> 2. Task Manager shows Mathematica's CPU usage at a constant 50%.
>
> 3. The "Kernel" pull-down menu has "Interrupt Evaluation" grayed out.
>    I can abort it.
>
> 4. Mathematica won't solve any subsequent problem in another window
>    (seems like the first one is occupying a queue).
>
> Earlier I tested some simple function-reference integrals (e.g.
> defining f[x] first and then integrating f[x]dx) and they worked.
>
> What sort of speed can I expect from this?  Is 24 hours too long to
> solve a problem like this on a 2.6 GHz Windows XP platform with 1.25
> GB RAM?  Is Mathematica hung up on something?  Is the fact that I'm
> using the trial version make any difference?  Did I do something
> wrong?
> 
> Thanks.
> -Alex


  • Prev by Date: Re: Re: Norm
  • Next by Date: Re: Reasonable integration speed? (24 hrs and counting)
  • Previous by thread: Re: Reasonable integration speed? (24 hrs and counting)
  • Next by thread: Re: Reasonable integration speed? (24 hrs and counting)