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

Interpolation between two functions

0 views
Skip to first unread message

luno...@gmail.com

unread,
Apr 30, 2007, 5:41:37 AM4/30/07
to
Hello all. I need to construct a smooth function interpolating
between two functions of which I know the asymptotic behaviour at x<<1
(f1(x) ) and x>>1 (f2(x) ).
I tried using something like
f(x) = [f1(x)+f2(x)+(f1(x)-f2(x))*erf(x-1)]/2
the problem is that I get a "bump" at x~1 which is an artifact of the
interpolation
(see
http://th.physik.uni-frankfurt.de/~torrieri/papers/lnzoutput.eps ).
The "real" function I am trying to reproduce is monotonically varying.

Does anyone know an interpolation technique that gets rid of this
problem?

Thanks, and best regards

Peter Spellucci

unread,
Apr 30, 2007, 6:03:10 AM4/30/07
to

In article <1177926097....@h2g2000hsg.googlegroups.com>,

just an idea (didn't try it)
define a grid and set g(x)=max(f1(x),f2(x)) on that grid.
then interpolate by a monotonic increasing spline.
literature:

Wolberg, George; Alfy, Itzik
An energy-minimization framework for monotonic cubic spline
interpolation. (English)
J. Comput. Appl. Math. 143, No.2, 145-188 (2002). MSC2000: *65D07 65D05 65D10

Oja, Peeter
Rational spline interpolation to monotonic data. (English)
Proc. Est. Acad. Sci., Phys. Math. 48, No.1, 22-30 (1999).
MSC2000: *41A15 41A20, Reviewer: Manfred Tasche (Rostock)

Sakai, Manabu; López de Silanes, M.C.
A simple rational spline and its application to monotonic
interpolation to monotonic data. (English)
Numer. Math. 50, 171-182 (1986). MSC2000: *65D07 65D05 41A15, Reviewer: S.Ogawa

Delbourgo, R.; Gregory, J.A.
$C\sp 2$ rational quadratic spline interpolation to monotonic data. (English)
IMA J. Numer. Anal. 3, 141-152 (1983). MSC2000: *65D07 41A15


hth
peter

Martin Brown

unread,
Apr 30, 2007, 7:34:38 AM4/30/07
to
On Apr 30, 10:41 am, lunog...@gmail.com wrote:
> Hello all. I need to construct a smooth function interpolating
> between two functions of which I know the asymptotic behaviour at x<<1
> (f1(x) ) and x>>1 (f2(x) ).
> I tried using something like
> f(x) = [f1(x)+f2(x)+(f1(x)-f2(x))*erf(x-1)]/2
> the problem is that I get a "bump" at x~1 which is an artifact of the
> interpolation
> (seehttp://th.physik.uni-frankfurt.de/~torrieri/papers/lnzoutput.eps ).

> The "real" function I am trying to reproduce is monotonically varying.
>
> Does anyone know an interpolation technique that gets rid of this
> problem?

It isn't really interpolation as such, but you can blend between two
assymptotic forms and remain monotonically increasing on a wing and a
prayer with something ad hoc like:

h(x) = ( f(x) + g(x).k.x^n)/(1+k.x^n)

For suitable choices of k and n this will smoothly change from one
function to the other as x increases. Try k=n = 4 as a rough starting
point. Whether or not the intermediate values of the resulting
function h(x) are reasonable is an open question since you are
blending two functions together that are well outside their region of
assymptotic validity.

Ideally you should use the right functional form to match the
underlying physics.

Regards,
Martin Brown

Olin Perry Norton

unread,
Apr 30, 2007, 10:22:10 AM4/30/07
to
luno...@gmail.com wrote:

To some degree the answer depends on the behavior of your
functions f1 and f2. Does one of them become large or small
compared to the other for small x or large x?

For example, if you want a function that behaves like Ax for
small x and behaves like B/x for large x, then the function

( 1/(Ax) + x/B )^(-1) does the trick.

The answer to your problem is not unique. The function could
do anything for x ~ O(1), so whether a given interpolation formula
is "right" or not depends on how well it matches the
"real" function, assuming it is known.

For the example above,

( 1/(Ax)^2 + (x/B)*2 )^(-1/2) also has the desired asymptotic

properties, but behaves a bit differently in the transition region.

Olin Perry Norton

Olin Perry Norton

unread,
Apr 30, 2007, 10:29:49 AM4/30/07
to
Olin Perry Norton wrote:

That last formula should read ( 1/(Ax)^2 + (x/B)^2 )^(-1/2) .

Richard Harter

unread,
Apr 30, 2007, 11:00:32 AM4/30/07
to

You might consider using

f(x) = f1(x)*p(x) + f2(x)*q(x)

where p(x) and q(x) are complementary sigmoid functions, e.g.,

p(x) = 1/(1+exp(k*x))
q(x) = exp(k*x)/(1+exp(k*x))

where k is chosen to match the region where signifant mixing must occur.


luno...@gmail.com

unread,
May 2, 2007, 8:35:57 AM5/2/07
to
On Apr 30, 5:00 pm, c...@tiac.net (Richard Harter) wrote:

I just wanted to thank you all for your suggestions. For my
particular case, the one I am responding to worked the best. For the
record, I am trying to reproduce the equation of state of Quantum
Chromodynamics (with no phase transition but a smooth cross-over, as
seems to be happening).

Best

GT

0 new messages