0
|
3568 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# NIntegrate Error?

Posted 10 years ago
 Hi Iam trying to use Nintegrate but I keep getting an error. Can somone explain how I can use it correctly. THanks.Clear ["global'*"]Nc = 2.8*10^19;nexact [\[Eta]c_] :=  NIntegrate[   Nc*(2/\[Sqrt]\[Pi])*(x^(1/2))/(1 + e^(x - \[Eta]c)), {x, 0, 20}]; nexact
3 Replies
Sort By:
Posted 10 years ago
 David Reiss wrote:should beClear ["Global'*"] It would work better with a context mark, aka backtick: Clear["Global`*"]
Posted 10 years ago
 Just FYI, though the Clear function has no bearing on your quesiton, your Clear ["global'*"]should be Clear ["Global'*"]
Posted 10 years ago
 In:= Nc = 2.8*10^19; nexact[nc_] := NIntegrate[Nc*2/Sqrt[Pi]*(x^(1/2))/(1 + e^(x - nc)), {x, 0, 20}]; nexact  During evaluation of In:= NIntegrate::inumr: The integrand (3.15946*10^19 Sqrt[x])/(1+e^(-1+x)) has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,20}}. >>  Out= NIntegrate[(Nc 2 Sqrt[x])/(Sqrt[\[Pi]] (1 + e^(x - 1))), {x, 0, 20}]  In:= Nc = 2.8*10^19;nexact[nc_] := NIntegrate[Nc*2/Sqrt[Pi]*(x^(1/2))/(1 + E^(x - nc)), {x, 0, 20}];nexactOut= 4.41179*10^19Compare the two definitions of nexact character by character to find the difference.See the suggestion I added to the end of the new features suggestion list yesterday and a much older suggestion I made earlier about "novice mode".