8
$\begingroup$

Let $$\textbf{Sphd}(\alpha;x)=\int_{0}^xt^{\alpha t}dt$$

I want make a graphic like this by using Mathematica

enter image description here

I tried:

Plot[Table[NIntegrate[t^(a t), {t, 0, x}], {a, -1, 10, 1}], {x, 1, 4}]

but it is very slow..

$\endgroup$
4
15
$\begingroup$

Reformulation as a ParametricNDSolve[] problem is very fast:

ff = 10;
pfun = ParametricNDSolveValue[{y'[t] == (t + $MachineEpsilon)^(a t), 
   y[0] == 1}, y, {t, 0, ff}, {a}]

LogPlot[Evaluate[
  Table[pfun[a][
    x], {a, {-50, -30, -20, -10, -5, -1, 0, 0.5, 1, 2, 3, 5, 
     10}}]], {x, 0, 10}, PlotRange -> {1, 10^10}]

sophomore's dream

$\endgroup$
4
  • 1
    $\begingroup$ I think y[0] should be 0. $\endgroup$ – george2079 Feb 6 '17 at 18:07
  • $\begingroup$ @george2079 I assume anything in power of 0 is 1, i.e. a^0 =1. Limit of t^t as t->0 is 1. $\endgroup$ – user18792 Feb 7 '17 at 7:53
  • $\begingroup$ absolutely, that makes y'[0]==1 so the integral is zero in the limit. compare your plot at zero to the original. $\endgroup$ – george2079 Feb 7 '17 at 12:13
  • $\begingroup$ @george2079. Ok, indeed, the initial condition should be replaced in order to match the original problem $\endgroup$ – user18792 Feb 7 '17 at 19:32
8
$\begingroup$

Perhaps slightly faster:

f[a_, x_] := NIntegrate[t^(a t), {t, 0, x}]
al = {-50, -30, -20, -10, -5, -1, 0, 0.5, 1, 2, 3, 5, 10};
tab[a_] := Table[{j, f[a, j]}, {j, 0, 10, 0.1}]
ListLogPlot[tab /@ al, Joined -> True, PlotRange -> {0.01, 10^10}, 
 PlotLegends -> LineLegend[Automatic, al], 
 GridLines -> {Range[10], PowerRange[1, 10^10, 10]}, Frame -> True]

enter image description here

$\endgroup$

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.