Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Mathematica: Convolution Integral

  1. May 20, 2017 #1
    Hi all! I'm new to Mathematica.
    I have written a code for performing a convolution integral (as follows) but it seems to be giving out error messages:

    My code is:

    a[x_?NumericQ] := PDF[NormalDistribution[40, 2], x]
    b[k_?NumericQ, x_?NumericQ] := 0.0026*Sin[1.27*k/x]^2
    c[k_?NumericQ, x_?NumericQ] := {a[x]*b[k, x]}
    d[k_?NumericQ] := NIntegrate[c[k, x], {x, 0, Infinity}]
    Plot [d[k], {k, 0, 350}]

    It gives the following error message multiple times:

    ntegrand c[0.00715,x] is not numerical at {x} = {124.67}


    And the plot dosen't show up..!
    Does anyone have any suggestions on how to fix it ?
     
    Last edited: May 20, 2017
  2. jcsd
  3. May 25, 2017 #2
    The argument of the sin function is wrong. It must be dimentionless, i.e. k multiplied by x not divided by x.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Loading...
Similar Threads for Mathematica Convolution Integral
Mathematica Storing Mathematica output
Mathematica Mathematica to MATLAB
Mathematica Cannot do the integral of the Hyper-geometric function?
Mathematica Cannot Plot This Function in Mathematica
Mathematica While Loop in Mathematica