MathGroup Archive 2005

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

Search the Archive

Re: Merging InterpolationFunctions

  • To: mathgroup at
  • Subject: [mg57308] Re: Merging InterpolationFunctions
  • From: Kerry Kim <kjkim at>
  • Date: Tue, 24 May 2005 05:12:45 -0400 (EDT)
  • Organization: University of Washington
  • References: <> <d6peal$1gq$> <d6s4gi$6q6$>
  • Sender: owner-wri-mathgroup at

Thanks for your help.  I'm trying to avoid combining the 
interpolatingFunctions with an if (or Which) statement because I have 
several hundred to combine.  I was wondering if anyone knows if it's 
possible to go into the InterpolatingFunction structure and directly 
modify (or create) an InterpolatingFunction out of two others.  Though 
if InterpolatingFunction doesn't allow discontinuities in the 
derivatives, this won't work (I'm using version 5.0 unfortunately and 
can't use Piecewise).


dh wrote:
> Hi Kerry and Chris,
> If your functions are only C0 at the boundary, then 
> FunctionInterpolation will distort the merged function near the 
> boundary. In version 5.1 there is "Piecewise" that takes care of this 
> problem.
> However, depending of what you want to do with the merged function, 
> there may be a much simplier solution:
> a3[x_]= If[x<=10,a1[x],a2[x]]
> Sincerely, Daniel
> Chris Chiasson wrote:
>>You can use UnitStep (or Which) and FunctionInterpolation to make a
>>new interpolating function.
>>On 5/20/05, Kerry Kim <kjkim at> wrote:
>>>Is there a way to combine two InterpolatingFunctions which share a
>>>common boundary, and are C0 continuous at the common boundary (the
>>>values are continuous but the derivatives are NOT continuous at the
>>>common boundary)?
>>>For example, I'm trying to combine the following:
>>>a1=NDSolve[large differential equation system, {t,0,10}]
>>>{{e2f -> InterpolatingFunction[{{0., 10.}}, <>], E2F -> \
>>>InterpolatingFunction[{{0., 10.}}, <>], etc...}}
>>>a2=NDSolve[large differential equation system, {t,10,20}]
>>>{{e2f -> InterpolatingFunction[{{10., 20.}}, <>], E2F -> \
>>>InterpolatingFunction[{{10., 20.}}, <>], etc...}}
>>>and the combine a1 and a2 so that I get the following:
>>>{{e2f -> InterpolatingFunction[{{0., 20.}}, <>], E2F -> \
>>>InterpolatingFunction[{{0., 20.}}, <>], etc...}}
>>>I've read that the InterpolatingFunction internals may be version
>>>specific, and I can't quite infer what they all mean.  I'm using
>>>Mathematica version 5.0
>>>Thank you!
>>>-Kerry Kim

  • Prev by Date: Re: Solve or Reduce on a monstrosity of an expresssion (and a prize!)
  • Next by Date: Re: How to get an answer as a Root object?
  • Previous by thread: Re: Merging InterpolationFunctions
  • Next by thread: four approaches to do a simple sum