Results 1 to 10 of 10

Math Help - Numerical integration with free parameters, Mathematica

  1. #1
    Member
    Joined
    Jul 2008
    From
    Sofia, Bulgaria
    Posts
    75

    Numerical integration with free parameters, Mathematica

    Hi all!

    I am trying to compute improper integrals as a function of additional parameters, where the integrand contains a special function, e.g.:

    f(a,t) := \int_0^{\infty}e^{-aq^2}S(a,q,t)dq

    where S(a,q,t) is the Mathieu sine (solution to Mathieu's ODE), cf:

    Mathieu function - Wikipedia, the free encyclopedia

    This special function is implemented in Mathematica under
    MathieuS[a, q, t]
    I am interested in the (approximate) dependence of the above improper integral on the parameters a and t. Since the integration is not possible analytically, I tried to do it numerically using
    NIntegrate
    but got an error, since I use parameters in the integrand and not numbers.

    Is there any way of getting the a and/or t dependence of such a function numerically? Taylor or Fourier expansions of them /to an arbitrary order/ are absolutely sufficient

    With regards,
    marin
    Last edited by Marine; March 30th 2011 at 07:18 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Why not just do

    f[a_,t_]:=NIntegrate[Exp[-a q^2] MathieuS[a,q,t],{q,0,Infty}]?

    (Your definition as f(q) is, perhaps, not terribly good, because the q is the dummy variable of integration!). Also, note that "Infty" stands for infinity. You should use the actual symbol, because "Infty" is not recognized as an appropriate upper limit of integration. I'm forgetting what the text version of Infinity is, since I always use the symbol from the palette.

    Now you can do plots or whatever you like with f.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Jul 2008
    From
    Sofia, Bulgaria
    Posts
    75
    Ackbeet, thanks for pointing it out, I also meant f(a,t) - the above post is now edited

    You should use the actual symbol, because "Infty" is not recognized as an appropriate upper limit of integration
    Thanks for the hint

    You're right that I can do plots with f, however I do not have an approximate expression for it, so I cannot make any analytical statement regarding the parameters a, t, which I would very much like to.

    It's almost sure, that f(a,t) may not be obtainable in terms of analytic functions, but I still have hopes for series Is there any way to do this?

    The main problem comes from the fact that I don't have the series expansions for the general Mathieu functions - I still wonder how they defined them in Mathematica at all..

    However, if I could do some kind of parametric plot of f, so that I can plot it against the one variable, say, a and vary t, this would also be very nice too but I'm not sure if it's possible
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    The link at MathWorld indicates that an analytic representation of the Mathieu functions "presents great difficulties".

    Are you sure you need to bark up this tree? What is the original problem? What are you ultimately trying to do?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member
    Joined
    Jul 2008
    From
    Sofia, Bulgaria
    Posts
    75
    I embarked on a problem of one-dimensional electrons subjected to a periodic potential, where the Mathieu eq. arises naturally.

    However, in order to compute the physically relevant quantities calculations of the above type have to be done.

    I also solved the equation approximately using perturbation theory, but then I noticed that it has its own name and the special solutions are implemented in the specific software, so now what I want to do is be as exact as possible.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    I'm guessing you're solving the Schrödinger equation in 1 dimension, then? Yeah, I can see how you'd get the Mathieu equation from the separation of variables. Like I said, though, I think you'd have a hard time getting a full series solution. You could always try, though. You could implement a series solution of the original Mathieu DE, substituting in the series expression for the cosine function. It'd be fairly messy, I think, but it is, in theory, doable. Have fun with that!
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Member
    Joined
    Jul 2008
    From
    Sofia, Bulgaria
    Posts
    75
    The point is, by plugging in the ODE a general Fourier expansion I only get a recursion formula for the coefficients which I cannot solve, the formula reads:

    A_n = Q/2\frac{A_{n+2}+A_{n-2}}{n^2-a}

    Q, and a the constants from the ODE - these are parameters which in my case will depend analytically on 'q' and this is the variable I want to integrate out

    does anyone know an analytical way of solving the recursion and thereby defining the coefficients - I guess it won't be doable this way?

    Maybe someone knows another way helping me with the initial issue?
    Follow Math Help Forum on Facebook and Google+

  8. #8
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    I'm not up enough on the theory of recurrence relations to be able to solve that. RSolve in Mathematica balks at solving it, as does WolframAlpha. I'm afraid I'm out of ideas. Sorry about that.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Member
    Joined
    Jul 2008
    From
    Sofia, Bulgaria
    Posts
    75
    Well, after all, no one ever expected me to solve this recurrence relation - the mankind couldn't do it in the last 200 years..

    But I am really impressed how poor the Mathieu functions are indeed understood - I could only find the series expansions in certain limits although various papers and books have been published on this topic through the years. And they still keep on popping up in most natural situations.

    I guess I'm back to good old perturbation theory now

    Thanks a lot for the help, Ackbeet!
    Follow Math Help Forum on Facebook and Google+

  10. #10
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    You're welcome for whatever help I could provide.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. a Multinomial-Dirichlet integration with two parameters
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: February 26th 2011, 01:10 PM
  2. Solve system in Mathematica in terms of parameters
    Posted in the Math Software Forum
    Replies: 6
    Last Post: February 25th 2011, 07:24 AM
  3. Numerical solution in mathematica
    Posted in the Math Software Forum
    Replies: 0
    Last Post: May 12th 2010, 10:22 AM
  4. Numerical Integration
    Posted in the Calculus Forum
    Replies: 1
    Last Post: February 8th 2010, 09:16 PM
  5. Example of Numerical Integration?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: November 7th 2009, 04:22 PM

Search Tags


/mathhelpforum @mathhelpforum