2
$\begingroup$

I'm attempting to understand how B-Spline derivatives work.

To do this, i've generated some data in MATLAB to plot sin(x) over 0 - 2*pi. I then use the splinetool to fit an order 2 spline to the data which it fits perfectly. However, when I look at the 1st derivative of this sine wave data it's max is 0.017 and it's min is -0.017.

I don't understand why the derivative of this data doesn't give exactly cos(x) with a max and min of 1, -1. Any insights please?

  • 0
    Unless you specified that the derivatives of your B-spline take specific values and derivatives at specific points, in general you cannot expect your B-spline to take the exact same values as the function you're approximating at points other than the points you derived your B-spline from.2010-11-29
  • 0
    The data points should be disclosed. Suppose a spline interpolates at the three points x = 0, pi, 2pi?2010-11-29

1 Answers 1

2

A B-spline of order 2 is a continuous piecewise-linear function that interpolates between the assigned data points ("knots").

If the slopes of such a function vary between +0.017 and -0.017 on the interval $[0,2\pi]$, then by the Mean Value Theorem there cannot be more than $0.034\pi$ or about 0.1 between the minimum and maximum function values.

So either there are no data points near the minimum and maximum of $sin(x)$ on this interval or else some error has been made in computation (perhaps a mistake in scaling the x-axis that stretches everything out).

  • 0
    Turns out it was an error in scaling, thanks...I was converting degrees to radians for the sin function, then plotting with degrees. So thats why I got 0.017 (pi / 180) as my max.2010-12-01