Re: Interpolatingfunction
- To: mathgroup at smc.vnet.net
- Subject: [mg9760] Re: [mg9712] Interpolatingfunction
- From: Allan Hayes <hay at haystack.demon.co.uk>
- Date: Tue, 25 Nov 1997 00:07:08 -0500
- Mmdf-warning: Parse error in original version of preceding line at post.mail.demon.net
- Sender: owner-wri-mathgroup at wolfram.com
[mg9712] Interpolatingfunction
From: Tama's Kalma'r-Nagy, tk43 at cornell.edu To:
mathgroup at smc.vnet.net
>I have two InterpolatingFunction objects (f1,f2) on the same interval. I
>would like to get a third one which is Min(f1,f2). Any idea would be
>appreciated.
Tama:
FunctionInterpolation is one way
Suppose
f1= Interpolation[{{1,2},{1.5,1},{2.3,3}, {3,1}}];
f2= Interpolation[{{1,1},{1.9,2},{2.7,1}, {3,2}}];
Then get
fmin =FunctionInterpolation[Min[f1[x],f2[x]], {x,1,3}];
Compare
Plot[{f1[x],f2[x], fmin[x]},{x,1,3},
PlotStyle -> {Hue[0],Hue[.35],Hue[.7]}];
For a closer fit we can use more points:
fmin2 =FunctionInterpolation[Min[f1[x],f2[x]], {x,1,3},
InterpolationPoints-> 55];
Plot[{f1[x],f2[x], fmin2[x]},{x,1,3},
PlotStyle -> {Hue[0],Hue[.35],Hue[.7]}];
Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642