Re: Integration of InterpolatingFunction
- To: mathgroup at smc.vnet.net
- Subject: [mg108413] Re: Integration of InterpolatingFunction
- From: dh <dh at metrohm.com>
- Date: Wed, 17 Mar 2010 04:38:03 -0500 (EST)
- References: <hnnk7o$cl4$1@smc.vnet.net>
Hi benjamin, I can not answer why Wolfram implemented it as it is, but here is a work around. With FunctionInterplation you may combine several interpolation functions to a new one. Note that there are differences with the options of "InterpolationOrder". E.g.: timevector = Table[i*0.1, {i, 0, 10}]; discretesolution = Table[Random[], {i, 0, 10}]; spline = Interpolation[Thread[{timevector, discretesolution}], InterpolationOrder -> 1]; Integrate[spline[t], {t, 0, 1}] fun = FunctionInterpolation[spline[t] + 2, {t, 0, 1}, InterpolationOrder -> 2] Integrate[{fun[t], spline[t]}, {t, 0, 1}] Daniel On 16.03.2010 10:49, Benjamin Hell wrote: > Hi, > I would like to use Integrate with on an InterpolatingFunction, which is > a spline. As the Interpolating function is a spline this should be > possible. And indeed it is, as long as I do not combine the > Interpolating function with any other function. Here is a simple example: > > Define > /timevector = Table[i*0.1, {i, 0, 10}]; > discretesolution = Table[Random[], {i, 0, 10}]; > spline = Interpolation[Thread[{timevector, discretesolution}], > InterpolationOrder -> 1]; > / > Then the following works fine: > /Integrate[spline[t], {t, 0, 1}]/ > > But the following does not: > /Integrate[spline[t]+2, {t, 0, 1}]/ > > Why is that? > > Thanks in advance, > Benjamin > > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>