0
$\begingroup$

Here is the double integral, I want to evaluate and then plot.

Clear[z, k, t, tau];

N1 = 1; (*N1 is in fact infinity*)

alpha = 1; 

u[z_?NumericQ, t_?NumericQ, alpha_?NumericQ] := 2/Pi*NIntegrate[k*Sin[k*z]* 
NIntegrate[Cos[t - tau]*tau^(alpha - 1)*MittagLefflerE[alpha, alpha, -k^2*tau^alpha],
     {tau, 0, t}], {k, 0, N1}] 

One of the integral involves MittagLefflerE, which seems to be causing the warnings.

when I try,

u[1, Pi/2, 1]

I get

NIntegrate::inumr:

and then an output.

I even tried Normal[Series[MittagLefflerE[alpha, alpha, -k^2*tau^alpha], {tau, 0, 2}]].

But when I try to plot u for different values of t, accept all those warnings, it take ages.

Plot[{u[z, Pi/2, 1], u[z, 3*Pi/2, 1], u[z, Pi, 1], u[z, 2*Pi, 1]}, {z, -1, 1}]

But so far no luck. Any suggestion?

$\endgroup$
  • $\begingroup$ Why didn't you bundle it all up in a single NIntegrate[]? u[z_?NumericQ, t_?NumericQ] := With[{α = 1}, 2/π NIntegrate[k Sin[k z] Cos[t - τ] τ^(α - 1) MittagLefflerE[α, α, -k^2 τ^α], {k, 0, ∞}, {τ, 0, t}]]; Plot[Table[u[z, t], {t, π/2, 2 π, π/2}] // Evaluate, {z, -1, 1}] $\endgroup$ – J. M. will be back soon Sep 14 '17 at 7:07
  • $\begingroup$ @J.M. I am trying your suggestion for the last 10 mins and its still running.... $\endgroup$ – zhk Sep 14 '17 at 7:21
  • $\begingroup$ Well, I got it to plot, even tho it takes long. $\endgroup$ – J. M. will be back soon Sep 14 '17 at 7:29
1
$\begingroup$

Define a function of the inner integration an call it

nint1[t_?NumericQ, k_?NumericQ] := 
   NIntegrate[
     Cos[t - tau]*tau^(alpha - 1)*
     MittagLefflerE[alpha, alpha, -k^2*tau^alpha], {tau, 0, t}]


u[z_?NumericQ, t_?NumericQ, alpha_?NumericQ] := 
    2/Pi*NIntegrate[k*Sin[k*z]*nint1[t, k], {k, 0, N1}]

For me this workes very well.

$\endgroup$
  • $\begingroup$ This work flawlessly for this particular case. But when I change alpha=0.8 and {z,0,10}, then it is still running for the last 2 hours. $\endgroup$ – zhk Sep 14 '17 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.