Re: Re: NIntegrate and Sequence
- To: mathgroup at smc.vnet.net
- Subject: [mg63506] Re: [mg63469] Re: [mg63459] NIntegrate and Sequence
- From: Pratik Desai <pdesai1 at umbc.edu>
- Date: Tue, 3 Jan 2006 01:25:50 -0500 (EST)
- References: <200601021049.FAA01309@smc.vnet.net> <43B94E48.8050009@umbc.edu>
- Sender: owner-wri-mathgroup at wolfram.com
Pratik Desai wrote:
> Bob Hanlon wrote:
>
>> Nintegrate has the attribute HoldAll.
>>
>> Attributes[NIntegrate]
>>
>> {HoldAll,Protected}
>>
>> Use Evaluate.
>>
>> NIntegrate[r,Evaluate[{r,14,Sequence@@{16,18},40}]]
>>
>> 702.
>>
>>
>> Bob Hanlon
>>
>>
>>
>>> From: Bruce Colletti <vze269bv at verizon.net>
To: mathgroup at smc.vnet.net
>>
>>> Date: 2006/01/01 Sun AM 01:16:12 EST
>>> Subject: [mg63506] [mg63469] [mg63459] NIntegrate and Sequence
>>>
>>> Re Mathematica 5.2 under WinXP.
>>>
>>> The first command works while the other returns the NIntegrate::nlim
>>> error.
>>
>> Yet {r, 14, Sequence @@ {16, 18}, 40} returns {r,14,16,18,40}.
>>
>>> NIntegrate[r, {r, 14, 16, 18, 40}]
>>> NIntegrate[r, {r, 14, Sequence @@ {16, 18}, 40}]
>>>
>>> What is causing the error?
>>>
>>> Thankx.
>>>
>>> Bruce
>>>
>>>
>>
> I tried using GaussianQuadrature, why is the error so high for this
> interval (see out 49)
>
>
> In[46]:=
> <<NumericalMath`GaussianQuadrature`
> data1=GaussianQuadratureWeights[5,14,40]
> ans=Table[Times@@data1[[r]],{r,1,Length[data1],1}]//Total
> GaussianQuadratureError[5,f,14,40]//InputForm
>
> Out[47]=
> {{15.2197,3.08005},{19.9999,6.22217},{
> 27.,7.39556},{34.0001,6.22217},{38.7803,3.08005}}
>
> Out[48]=
> 702.
>
> Out[49]//InputForm=
> -1447.938207040937*Derivative[10][f]
>
>
>
>
I found the problem, had to increase the number of Gauss points
GaussianQuadratureError[20, f, 14, 40] // InputForm
>>-1.6243254536030502*^-14*Derivative[40][f]
- References:
- Re: NIntegrate and Sequence
- From: Bob Hanlon <hanlonr@cox.net>
- Re: NIntegrate and Sequence