Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Merging InterpolationFunctions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57308] Re: Merging InterpolationFunctions
  • From: Kerry Kim <kjkim at u.washington.edu>
  • Date: Tue, 24 May 2005 05:12:45 -0400 (EDT)
  • Organization: University of Washington
  • References: <200505200843.EAA00614@smc.vnet.net> <d6peal$1gq$1@smc.vnet.net> <d6s4gi$6q6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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).

Thanks!
-Kerry

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 u.washington.edu> 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:
>>>a3=Merge[a1,a2]
>>>{{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