Message Boards Message Boards

GROUPS:

Avoid "has evaluated to non-numerical values for all sampling points in"?

Posted 4 months ago
700 Views
|
2 Replies
|
0 Total Likes
|

I have the following code which gives an error message "NIntegrate::inumr: The integrand (E^(-(([Pi] r^2)/1000000)-1.58489*10^-10 r^2.09) [Pi] r laplaceTBLAB[r] laplaceTBNAB[r] laplaceTBTB[r])/500000 has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,10000}}."

parmtrTB[r_] := sinr/zetaTB*r^alfaTB;
funTBNAB[z_, 
   r_] := (1 - 
     1/(1 + parmtrTB[r]*zetaNAB*(z^2 + height^2)^(-alfaNAB/2)))*
   funNLoS[z];
      funTBLAB[z_, 
   r_] := (1 - (mparameter/(mparameter + 
          parmtrTB[r]*zetaLAB*(z^2 + height^2)^(-alfaLAB/2)))^
      mparameter)*funLoS[z];
      funTBTB[z_, r_] := 
  z*(1 - 1/(1 + parmtrTB[r]*zetaTB*z^(-alfaTB)));



distnceTBLAB = (zetaTB/zetaLAB)^(1/alfaTB)*height^(alfaLAB/alfaTB);
distnceTBNAB = (zetaTB/zetaNAB)^(1/alfaTB)*height^(alfaNAB/alfaTB);

NearstInterfcTBLAB[r_] := 
 Piecewise[{{height, 
    r <= distnceTBLAB}, {(zetaLAB/zetaTB)^(1/alfaLAB)*
     r^(alfaTB/alfaLAB), r > distnceTBLAB}}]; 
NearstInterfcTBNAB[r_] := 
 Piecewise[{{height, 
    r <= distnceTBNAB}, {(zetaNAB/zetaTB)^(1/alfaNAB)*
     r^(alfaTB/alfaNAB), r > distnceTBNAB}}];
NearstInterfcTBTB[r_] := r;

       lowerlimitTBNAB[r_] := Sqrt[NearstInterfcTBNAB[r]^2 - height^2];
lowerlimitTBLAB[r_] := Sqrt[NearstInterfcTBLAB[r]^2 - height^2];
       lowerlimitTBTB[r_] := NearstInterfcTBTB[r];


InteglaplaceTBNAB[r_?NumericQ] := 
  NIntegrate[
   funTBNAB[z, r], {z, lowerlimitTBNAB[r], lowerlimitTBLAB[Rmax]}];
InteglaplaceTBLAB[r_?NumericQ] := 
  NIntegrate[
   funTBLAB[z, r], {z, lowerlimitTBLAB[r], lowerlimitTBLAB[Rmax]}];
InteglaplaceTBTB[r_?NumericQ] := 
  NIntegrate[funTBTB[z, r], {z, lowerlimitTBTB[r], Rmax}];

laplaceTBNAB[r_] := Exp[-2*Pi*ABdensity*laplaceTBNAB[r]];
laplaceTBLAB[r_] := Exp[-2*Pi*ABdensity*laplaceTBLAB[r]];
laplaceTBTB[r_] := Exp[-2*Pi*TBdensity*laplaceTBTB[r]];
laplaceTB[r_] := laplaceTBNAB[r]*laplaceTBLAB[r]*laplaceTBTB[r];
xxTB1[r_] := Exp[-parmtrTB[r]*noisepow]*laplaceTB[r]*funPdfTB[r];

xxTB2 := NIntegrate[xxTB1[r], {r, 0, Rmax}];
2 Replies

Parameters are not defined. Can you publish the code with all the data for the parameters?

I see many errors here. When using Mathematica, you should test each function before using it as a building block. For example, try typing laplaceTBNAB[1].

You've done an excellent job of factoring the problem, so this approach to debugging should be very effective.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract