Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*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 2000

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

Search the Archive

First derivative of interpolated spline

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25221] First derivative of interpolated spline
  • From: Juerg Tschirren <jtschirr at engineering.uiowa.edu>
  • Date: Fri, 15 Sep 2000 02:21:53 -0400 (EDT)
  • Organization: University of Iowa
  • Sender: owner-wri-mathgroup at wolfram.com

I am interpolating a cubic spline through a list with pairs of real
numbers with the following command sequence:

  <<NumericalMath`SplineFit`
  data = Import["data.dat", "Table"];
  spline = SplineFit[data, Cubic]
  ParametricPlot[spline[u], {u,0,301}, PlotRange->All, Compiled->False]

The file data.dat contains 300 numberpairs (real numbers), which results
in 
data = {{0, 0}, {1, 55}, {2, 42}, {3, 52}, {4, 51}, ..., {300, 9}, {301,
0}}. The resulting plot looks like expected. Now I would like to
calculate the first derivative of the spline function and plot it. All
my attempts to do so failed (with the D and the Derivative function).
For example

ParametricPlot[D[spline[u],u], {u,0,301}, PlotRange->All,
Compiled->False]

results in messages like

  General::ivar: 0.0000125417 is not a valid variable.

  ParametricPlot::pptr: 
     D[spline[u], u] does not evaluate to a pair of real numbers at u = 
      0.0000125417.


What's wrong? Can anybody tell me how to do that?

Thanks

Juerg


  • Prev by Date: mathlink
  • Next by Date: Re: Add the Logarithms (error in integral)
  • Previous by thread: Re: How to display the desired numerical precision?
  • Next by thread: Re: Re: PseudoInverse for exact matrices: Comments...