0
$\begingroup$

I want to compute this function for different values of Kappa, so that I don't have to change Kappa manually. Some kind of Manipulate expression.

Integralfunc[t_] :=  
  NIntegrate[a^-2(Exp[-1/a^2]*BesselI[0, 1/a^2], {a, 0. 02, Kappa*t}]
SetAttributes[Integralfunc, Listable]
DeFunc = IntegralFunc[Range[0.1, 250, 1.25]]
ListPlot[DeFunc, PlotStyle Red]
$\endgroup$
6
  • 2
    $\begingroup$ Why not just Integralfunc[t_, Kappa_] := NIntegrate[a^-2 (E^(-1/a^2))*BesselI[0, 1/a^2], {a, 0.02, Kappa*t}]? Then you can, for example, Integralfunc[47, 23] which gives 2.36619. You can make a Table of the values or plot it with, e.g., Plot3D[Evaluate@Integralfunc[t, k], {t, 0.1, 10}, {k, 1, 15}, PlotRange -> All]. Or, if you insist on a Manipulate: Manipulate[Integralfunc[t, k], {t, 0.1, 250, 1.25}, {k, 1, 100}]. $\endgroup$ – corey979 Nov 20 '16 at 17:36
  • $\begingroup$ You are trying to numerically integrate to a variable, that doesn't make sense. $\endgroup$ – Feyre Nov 20 '16 at 17:37
  • $\begingroup$ Actually If I change the value of Kappa manually, than there is an answer for this problem, But I want to change Kappa like in Manipulate Function. $\endgroup$ – Amanullah Malik Nov 20 '16 at 17:37
  • $\begingroup$ @AmanullahMalik corey's comment allows you to do that, then you can just run Manipulate[Integralfunc[t, k], {t, 0.1, 10, 0.1}, {k, 1, 15}]. $\endgroup$ – Feyre Nov 20 '16 at 17:40
  • $\begingroup$ actually fact is for a certain value of kappa graph is in our favor it coulb be any value in an interva $\endgroup$ – Amanullah Malik Nov 20 '16 at 17:42
0
$\begingroup$
ClearAll[Integralfunc, DeFunc]

Functions that directly or indirectly use numeric techniques should have their arguments restricted to numeric values.

IntegralFunc[t_?NumericQ, Kappa_?NumericQ] :=

  NIntegrate[a^-2 (E^(-1/a^2))*BesselI[0, 1/a^2],
   {a, 0.02, Kappa*t}];

DeFunc[Kappa_?NumericQ] :=
 IntegralFunc[#, Kappa] & /@ Range[0.1, 250, 1.25]

Use a fixed PlotRange to make it easier to see the effect of changing Kappa

Manipulate[
 ListPlot[DeFunc[Kappa],
  PlotStyle -> Red,
  PlotRange -> {2.3, 2.37}],
 {{Kappa, 5}, 1, 10, .01, Appearance -> "Labeled"}]

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.