MathGroup Archive 1997

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

Search the Archive

RE: Merging InterpolatingFunctions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9770] RE: [mg9660] Merging InterpolatingFunctions
  • From: Jean-Marie THOMAS <jmthomas at cybercable.tm.fr>
  • Date: Tue, 25 Nov 1997 00:07:19 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

A few remarks:
- I unfortunately did not find more documentation on Interpolation that
you  did in the Mathematica book;
- Mind the fact that Interpolation, via option InterpolationOrder, 
garanties continuity of the function for a certain number of
derivatives,  and your code does not provide any mechanism to implement
this. See with  FullForm what happens when you set
InterpolationOrder->5, or when you try  to interpolate data with given
values of the derivatives.

This code works whatever interpolation functions are provided,
overlaping  of domains could be improved:

merge[f1_,f2_]:=(Module[{d1,d2},
d1=Interval at First@First at f1;d2=Interval at First@First at f2;
Which[IntervalMemberQ[d1,#],f1[#],IntervalMemberQ[d2,#],f2[#],True,0]])&

Hope this helps,
----------------------------------------------- Jean-Marie THOMAS
Conseil et Audit en Ingenierie de Calcul jmthomas at cybercable.tm.fr
+33 (0)3 88 32 93 64
www.cybercable.tm.fr/~jmthomas
=======================


-----Message d'origine-----
De:	Christian Zemlin [SMTP:christian at satchmo.physik.tu-berlin.de]
Date:	vendredi 21 novembre 1997 07:31 A:	mathgroup at smc.vnet.net
Objet:	[mg9660] Merging InterpolatingFunctions

Hi,

I have a set of InterpolatingFunctions, such that the endpoint of each
is the starting point of the next.  Is there any way to merge them into
one InterpolationFunction?  I tried myself and produced the following
program:

Merge[f1_,f2_] := Module[{Start,Stop}, Start=Extract[f1,{1,1,1}]; Stop =
Extract[f2,{1,1,2}];
Part1 = Extract[f1,2];
Part21=Extract[f1,{3,1}];
Part22=Delete[Extract[f2,{3,1}],1]; Part31= Extract[f1,4];
Part32=Delete[Extract[f2,4],1];
				InterpolatingFunction[{{Start,Stop}},Part1,{Join[Part21,Part22]},
      Join[Part31, Part32]]
		];

I guessed the meaning of the entries in an InterpolatingFunction from
looking at examples, and the program does work in many cases.  But
sometimes it produces an expression that looks to me like an
InterpolationFunction, but is not treated as one by Mathematica.
Unfortunately, I did not find a full documentation of
InterpolatingFunction Objects.
Can anybody help me with this?

Thanks,
Christian


Christian Zemlin
Sekretariat PN 7-1, Raum 706
Institut f=FCr Theoretische Physik
Hardenbergstr. 36
10623 Berlin
Telefon (030) 314 23 000

email: chr at sirius.physik.tu-berlin.de



  • Prev by Date: Re: FindRoot with complex roots
  • Next by Date: Re: Need help to a beginner.
  • Previous by thread: Merging InterpolatingFunctions
  • Next by thread: Re: Merging InterpolatingFunctions