0
$\begingroup$
 bList = Table[b, {b, 0, 4.1, 0.1}]; 
 \[Chi][bList_] = (Z/K1)*NIntegrate[Subscript[f, pp1][q]*Subscript[F, pp1][q]*BesselJ[0, q*bList]*q, {q, 0, 1}] + 
(N/K1)*NIntegrate[Subscript[f, pn1][q]*Subscript[F, pn1][q]*BesselJ[0, q*bList]*q, {q, 0, 1}]; 

I want to do Thread and Interpolation to those values but always give me this error NIntegrate::inumr: The integrand (0.0131326 r Sin[q r])/(1+(E^(1.75439 Plus[<<2>>])+E^(1.75439 Plus[<<2>>])) (0.5 +0.0882389 Power[<<2>>])^1.5) has evaluated to non-numerical values for all sampling points in the region with boundaries {{[Infinity],0.}}.

 Subscript[f, pp1][q_] =(6.254736279890945*(1 - 1.4511668475476842*i)*i)/E^(0.2115*q^2)
 Subscript[F, pp1][q_] := ((4*Pi)/q)*NIntegrate[Subscript[\[Rho], p][r]*Sin[q*r]*r, {r, 0, Infinity}]; 
  Subscript[\[Rho], p][r_]=0.013132593248303927/(1 + (E^(1.7543859649122808*(-2.380427976610103 - r)) + E^(1.7543859649122808*(-2.380427976610103 + r)))*(0.5 + 0.08823886490842314*r^2)^1.5)

 Z = 6;N=6;K1 =1.55;
 Subscript[f, pn1][q_] =(18.25974896615874*(1 - 0.8748275119106319*i)*i)/E^(0.2115*q^2)
 Subscript[F, pn1][q_]:= ((4*Pi)/q)*NIntegrate[Subscript[\[Rho], n][r]*Sin[q*r]*r, {r, 0, Infinity}]; 
 Subscript[\[Rho], n][r_]=0.012100952740630248/(1 + (E^(1.8975332068311195*(-2.47 + r)) + E^(-1.8975332068311195*(2.47 + r)))*(0.5 + 0.08195512137553475*r^2))
$\endgroup$
3
  • $\begingroup$ What is i ? Do you mean Sqrt[-1] ? Then you should use I. $\endgroup$
    – flinty
    Commented Aug 3, 2020 at 22:51
  • 1
    $\begingroup$ I believe I've fixed your code in my answer. Could you please explain in more detail what "do Thread and Interpolation to those values" means? $\endgroup$
    – flinty
    Commented Aug 3, 2020 at 23:04
  • 1
    $\begingroup$ Thank you , I get the answer when I chang i to blod i $\endgroup$
    – user69941
    Commented Aug 7, 2020 at 22:08

1 Answer 1

1
$\begingroup$

I rewrote this without the subscripts, I added NumericQ in places where it was needed, I used SetDelayed (:=) for some of your functions, and I assumed by i you meant I the imaginary number:

Z = 6; n = 6; K1 = 1.55;
fpn1[q_?NumericQ] := (18.25974896615874*(1 - 0.8748275119106319*I)*I)/E^(0.2115*q^2)

Fpn1[q_?NumericQ] := ((4*Pi)/q)*NIntegrate[ρn[r]*Sin[q*r]*r, {r, 0, Infinity}];

ρn[r_?NumericQ] := 
 0.012100952740630248/(1 + (E^(1.8975332068311195*(-2.47 + r)) + 
  E^(-1.8975332068311195*(2.47 + r)))*(0.5 + 0.08195512137553475*r^2))

fpp1[q_?NumericQ] := (6.254736279890945*(1 - 1.4511668475476842*I)*I)/E^(0.2115*q^2)

Fpp1[q_?NumericQ] := ((4*Pi)/q)*NIntegrate[ρp[r]*Sin[q*r]*r, {r, 0, Infinity}];

ρp[r_?NumericQ] := 0.013132593248303927 / 
 (1 + (E^(1.7543859649122808*(-2.380427976610103 - r)) +
   E^(1.7543859649122808*(-2.380427976610103 + r)))*(0.5 + 
   0.08823886490842314*r^2)^1.5)

χ[b_?NumericQ] := 
  (Z/K1)*NIntegrate[fpp1[q]*Fpp1[q]*BesselJ[0, q*b]*q, {q, 0, 1}] + 
  (n/K1)*NIntegrate[fpn1[q]*Fpn1[q]*BesselJ[0, q*b]*q, {q, 0, 1}];

χlist = Table[χ[b], {b, 0, 4.1, 0.1}]

(* results:
{27.2062 + 26.6148 I, 27.1793 + 26.5886 I, 27.0987 + 26.5099 I, 
 26.9648 + 26.3791 I, 26.7782 + 26.1969 I, 26.5397 + 25.964 I, 
 26.2504 + 25.6814 I, 25.9115 + 25.3503 I, 25.5244 + 24.9723 I, 
 25.091 + 24.5489 I, 24.613 + 24.0821 I, 24.0925 + 23.5737 I, 
 23.5318 + 23.0261 I, 22.9333 + 22.4415 I, 22.2995 + 21.8224 I, 
 21.6331 + 21.1714 I, 20.9368 + 20.4913 I, 20.2137 + 19.7848 I, 
 19.4665 + 19.055 I, 18.6985 + 18.3047 I, 17.9126 + 17.5369 I, 
 17.1121 + 16.7548 I, 16.3001 + 15.9614 I, 15.4796 + 15.1598 I, 
 14.654 + 14.3531 I, 13.8262 + 13.5442 I, 12.9993 + 12.7362 I, 
 12.1763 + 11.9319 I, 11.3601 + 11.1342 I, 10.5536 + 10.346 I, 
 9.75937 + 9.56969 I, 8.98011 + 8.80796 I, 8.21823 + 8.06316 I, 
 7.47605 + 7.33756 I, 6.75573 + 6.63327 I, 6.05928 + 5.95225 I, 
 5.38852 + 5.29627 I, 4.74511 + 4.66696 I, 4.1305 + 4.06576 I, 
 3.546 + 3.49391 I, 2.99269 + 2.95249 I, 2.47149 + 2.44239 I} *)

If you need to interpolate these values, maybe you could try:

χlist = Table[{b, χ[b]}, {b, 0, 4.1, 0.1}];
intp = Interpolation[χlist];
ReImPlot[intp[b], {b, 0, 4.1}]

reim plot

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.