Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding and Integrating Interpolation Functions

468 views
Skip to first unread message

Bayers, Alexander

unread,
Oct 7, 2009, 7:08:36 AM10/7/09
to
I have two interpolation functions, firstinterp and secondinterp, that I
wish to add. They are defined symbolically, i.e.

a = {1, 2, 3, 4, 5}

b = {b1, b2, b3, b4, b5}

c = {c1, c2, c3, c4, c5}

firstinterp = Interpolation[Transpose[{a, b}], InterpolationOrder -> 1]

secondinterp = Interpolation[Transpose[{a, b}], InterpolationOrder -> 1]

newinterp[t_]:= firstinterp[t] + secondinterp[t]

While I can evaluate newinterp at any point, and I am able to integrate
firstinterp[t] and secondinterp[t], when I run Integrate[newinterp[t],
{t, 2, 3}] I receive (InterpolatingFunction[{{1, 5}}, <>][t] +
InterpolatingFunction[{{1, 5}}, <>][t]) dt under an integral sign,
rather than the evaluated value. Does anyone know how to get this to
integrate to its real value?

Thanks,

Alex

DrMajorBob

unread,
Oct 8, 2009, 7:53:31 AM10/8/09
to
Use NIntegrate, not Integrate.

(I can only guess you're using Integrate, since you didn't send the code.)

Bobby


--
DrMaj...@yahoo.com

oshaughn

unread,
Oct 9, 2009, 7:20:32 AM10/9/09
to

> a = {1, 2, 3, 4, 5}
>
> b = {b1, b2, b3, b4, b5}
>
> c = {c1, c2, c3, c4, c5}
>
> firstinterp = Interpolation[Transpose[{a, b}], InterpolationOrder -> 1]
>
> secondinterp = Interpolation[Transpose[{a, b}], InterpolationOrder -> 1]
>
newinterp = Integrate[#, {t, 2, 3}] & /@ (firstinterp[t] + secondinterp
[t])

creates a symbolic result.

0 new messages