The Mathematica Journal
Departments
Download This Issue
Home
Feature Articles
Graphics Gallery
Tricks of the Trade
In and Out
Columns
The Mathematica Programmer
New Products
New Publications
Classifieds
Calendar
News Bulletins
Editor's Pick
Mailbox
Letters
Write Us
About the Journal
Staff and Contributors
Submissions
Subscriptions
Advertising
Back Issues

Using Derivatives in Interpolation

Q: To the following data
[Graphics:../Images/index_gr_61.gif]
I apply the function
[Graphics:../Images/index_gr_62.gif]
and interpolate the result.
[Graphics:../Images/index_gr_63.gif]
Why is the resulting interpolation not smooth?
[Graphics:../Images/index_gr_64.gif]

[Graphics:../Images/index_gr_65.gif]

A: Jarl R. Sobel (jsobel@sdav01.seinf.abb.se) answers: By default, an InterpolationFunction varies smoothly between sample points. Under Interpolation the Mathematica Reference Guide says
Data can be given in the form [Graphics:../Images/index_gr_66.gif] to specify derivatives as well as values of the function at the points [Graphics:../Images/index_gr_67.gif]. You can specify different numbers of derivatives at different points.
Using this feature to specify the first derivatives of the function
[Graphics:../Images/index_gr_68.gif]
[Graphics:../Images/index_gr_69.gif]
and then interpolating
[Graphics:../Images/index_gr_70.gif]
gives what you want.
[Graphics:../Images/index_gr_71.gif]

[Graphics:../Images/index_gr_72.gif]

Alternatively, you can use splines.
[Graphics:../Images/index_gr_73.gif]
[Graphics:../Images/index_gr_74.gif]

[Graphics:../Images/index_gr_75.gif]


Converted by Mathematica      September 29, 1999

[Prev Page][Next Page]