MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

warning messages with Nintegrate and FindMinmum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65882] warning messages with Nintegrate and FindMinmum
  • From: "Ariel sumeruk" <ariel.sumeruk at gmail.com>
  • Date: Thu, 20 Apr 2006 05:15:17 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I am performing the following sequence of events. I am creating an
interpolating function to my data, which is a fairly smooth function. I then
use Nintegrate to define a function with a parameter Temp. I then construct
a function to minimize. And find the minimum



I am getting all kinds of errors and warning which don't make sense but I am
getting some results. How can I avoid getting these warning and have faith
in the results obtained? Is there a better way to do this?

The type of warnings are that the Nintegrate value is not numeric, or that
the integration is too slow. Both of which are not mathematically realistic
given that the functions are well defined.

\[Rho]fe=7.874;
(*fe= List of x and y values  which are fairly smooth;*)
xfe=Map[#[[1]]&,fe];
yfe[l_]=Map[Exp[-#[[2]]*\[Rho]fe*l]&,fe];
fe\[Rho][l_]=Thread[{xfe,yfe[l]}];
detector1[l_]:=Interpolation[Round[100000000*fe\[Rho][l]+1]/100000000.0,InterpolationOrder\[Rule]1]
(*The other detectors are similarly defined.*)
expdist[Ex_,kt_]:=Exp[-Ex/kt]/(kt);
radTransX1[Temp_] :=   NIntegrate[expdist[x, Temp]*detector1[x]*x, {x, 0. 001,
1}, AccuracyGoal -> \[Infinity]];
radTransX2[Temp_] :=    NIntegrate[expdist[x, Temp]*detector2[x]*x, {x,
0.001, 1},  AccuracyGoal -> \[Infinity]];
radTransX3[Temp_] :=    NIntegrate[expdist[x, Temp]*detector3[x]*x, {x,
0.001, 1},  AccuracyGoal -> \[Infinity]];
radTransX4[Temp_] :=    NIntegrate[expdist[x, Temp]*detector4[x]*x, {x,
0.001, 1},  AccuracyGoal -> \[Infinity]];
radTransX5[Temp_] :=    NIntegrate[expdist[x, Temp]*detector5[x]*x, {x,
0.001, 1},  AccuracyGoal -> \[Infinity]];
radTransX6[Temp_] :=    NIntegrate[expdist[x, Temp]*detector6[x]*x, {x,
0.001, 1},   AccuracyGoal -> \[Infinity]];
Theory[Temp_, \[Alpha]_] := \[Alpha]*{radTransX1[Temp],
radTransX2[Temp], radTransX3[Temp], radTransX4[Temp], radTransX5[Temp],
        radTransX6[Temp]};Experiment1={5.63,0.55,2.79,1.28,3.9,1.48};
FittingFunction[
Temp_,\[Alpha]_]:=(Theory[Temp,\[Alpha]]-
Experiment1).(Theory[Temp,\[Alpha]]-Experiment1)
results1=FindMinimum[FittingFunction[Temp,a],{Temp,.1,.3},{a,1.2,1.8}]

The type of error message which are generated are

\!\(\*  RowBox[{\(NIntegrate::"inum"\), \(\(:\)\(\ \)\), "\<\"Integrand \
\\!\\(\\(\\(expdist[\\(\\(x <file://!//(//(//(expdist%5B//(//(x>,
Temp\\)\\)]\\)\\)\\\\
\\(\\(detector1[x]\\)\\)\\\<file://(//(detector1%5Bx%5D//)//)///>
\\ x\\) is not numerical at \\!\\({x}\\ <file://!//(%7Bx%7D//>) =
\\!\\({0.7925`}\\ <file://!//(%7B0.7925%60%7D//>). \
\\!\\(\\*ButtonBox[\\\"More=85\\\ <file://!//(//*ButtonBox%5B///%22More=85///>",
ButtonStyle->\\\"RefGuideLinkText\\\", \
ButtonFrame->None, ButtonData:>\\\"NIntegrate::inum\\\"]\\)\"\>"}]\)

\!\(\*  RowBox[{\(NIntegrate::"ncvb"\), \(\(:\)\(\ \)\), "\<\"NIntegrate
failed to \converge to prescribed accuracy after \\!\\(7\\ <file://!//(7//>)
recursive bisections in \\\!\\(x\\ <file://!//(x//>) near
\\!\\(x\\<file://!//(x//>)
= \\!\\(0.29998046874999995`\\ <file://!//(0.29998046874999995%60//>). \
\\!\\(\\*ButtonBox[\\\"More=85\\\ <file://!//(//*ButtonBox%5B///%22More=85///>",
ButtonStyle->\\\"RefGuideLinkText\\\", \ButtonFrame->None,
ButtonData:>\\\"NIntegrate::ncvb\\\"]\\)\"\>"}]\)

*


  • Prev by Date: Re: Re: Named Formats? (followup question)
  • Next by Date: Re: Re: Named Formats? (followup question)
  • Previous by thread: Re: Re: Named Formats? (followup question)
  • Next by thread: wanna see something glaringly weird?