Questions tagged [cubic-spline]

A cubic spline is a smooth 3-order polynomial function that is piecewise-defined, and possesses a high degree of smoothness at the knots where the polynomial pieces connect.

A cubic spline is a smooth 3-order polynomial function that is piecewise-defined, and possesses a high degree of smoothness at the knots where the polynomial pieces connect. The most common cubic splines are Hermite, B-splines and Bezier splines.

Further details can be found at the sites below:

  1. wikipedia
  2. mathematica
170 questions
1
vote
0 answers

cubic spline not working in scipy?

I try to interpolate some data points generated by a self-defined function. All points should like very similar to a sine curve. When I run fit_curve = spitpl.interp1d(u,v,kind="cubic") x=gamma*np.linspace(-3,3,3000) plt.plot(x,fitcurve(x),…
Physicist
  • 2,848
  • 8
  • 33
  • 62
1
vote
1 answer

cubic spline to get smooth python line curve

I need to make a smooth line in python using cubic spline, I followed the scipy tutorial and got a little confused. I used the following code: import matplotlib.pyplot as plt from scipy import interpolate tck = interpolate.splrep(time,…
bhjghjh
  • 889
  • 3
  • 16
  • 42
1
vote
1 answer

SciPy's interp1d endpoints

In SciPy's interpolation module there is a function called interp1d. The documentation says that it is a spline interpolation: http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html I could however nowhere find what is…
Botond
  • 2,640
  • 6
  • 28
  • 44
1
vote
0 answers

How can I make a B spline with specific values of 1st derivative at breakpoints (not only ends) using MATLAB?

I used csape function in curve fitting toolbox, it enables the user of choosing derivative values at the both ends. Is there a way to control the value of the derivative a specific breakpoint? I want to set one of the values of the derivatives to be…
Robotawi
  • 11
  • 2
1
vote
0 answers

spline interpolation using a fixed-size temporal window

I would like to do a spline interpolation, but not the general way. My data is unevenly distributed and filled with gaps. data to interpolate on What I would like the spline to do is not take into account a certain number of observations for…
1
vote
0 answers

Spline curve fitting and smoothing it

I am trying to fit curve using Spline. As I studied it, knots and control points are important factor for making curve. However functions which support to make spline curve, there is no argument on control points. (includes arguments on…
Sujin Kwon
  • 11
  • 1
1
vote
1 answer

What algorithm used in interp1d function in scipy.interpolate

So i was writing a python program for my numerical course, and I had to code a cubic spline program. So i implement the formula for cubic spline given in books like Numerical methods by Chapra and canale and Numerical mathematics by chenny and…
Eular
  • 1,707
  • 4
  • 26
  • 50
1
vote
1 answer

Clampled cubic splines with flat extrapolation

I am trying to implement a clamped cubic spline with a zero slope (flat extrapolation) at the boundary knots, but I am unable to obtain the desired results. For instance setting: x = [3 4 7 9]; y = [2 1 2 0.5]; I can use the CSAPE function to…
sets
  • 169
  • 7
1
vote
1 answer

How to solve an equation with 3 unknown coefficients in Matlab?

I have this cubic spline function: s(x) = 4 + k1*x + 2x^2 - (1/6)*x^3 for x in [0,1] s(x) = 1 - (4/3)*(x-1) + k2*(x-1)^2 - (1/6) * (x-1)^3 for x in [1,2] s(x) = 1 + k3*(x-2) + (x-2)^2 - (1/6) * (x-2)^3 for x in [2,3] I would like to implement a…
ZelelB
  • 1,836
  • 7
  • 45
  • 71
1
vote
0 answers

Approximate function following interpolation

How do you approximate a function for interpolated points? I use the natural cubic spline to interpolate points as follows for n = 500 points: t=[0; 3; 6; 9] z=[0; 6; 6; 0] plot(t,z,'ro') ti=linspace(0,9,500) zn = natcubicspline(t,z,ti) yn =…
kathystehl
  • 831
  • 1
  • 9
  • 26
1
vote
3 answers

Cubic spline interpolation get coefficients

Say I have two arrays in python and I wish to get (and actually use) the cubic spline interpolation between those points. (IE: I wish to integrate the function). I would strongly prefer a way using numpy scipy. I know about…
paul23
  • 8,799
  • 12
  • 66
  • 149
1
vote
2 answers

MPAndroid Chart how to get a list of all points on a Cubic LineChart

I am using MPAndroid chart to plot a cubic graph using a few points. Currently, the library joins those points and plots a smooth graph. The code I am using is : ArrayList xVals = new ArrayList(); for (int i = 0; i < count; i++) { …
Shivam Bhalla
  • 1,879
  • 5
  • 35
  • 63
1
vote
1 answer

Algorithm for finding control points of cubic bezier (implementation details)

I've googled a lot, but all algorithms I found used equations for finding control points. I've thought there is simpler solution to do it and found some implementation in ExtJS source code:…
Guy Fawkes
  • 2,313
  • 2
  • 22
  • 39
1
vote
1 answer

using CubicTo to draw Bezier curve

The following code generates BezierCurves and creates a Path object to be drawn on the canvas. I converted this code from C#.Net to Android. Issue : When I draw the points the points do not formulate a continuous curve. it breaks in the middle and…
1
vote
1 answer

Spline curves using achartengine with cubic line chart doesnt pass through all points

I am using achartengine with cubic line chart, but it doesnt seem to work. The cubic line chart doesnt pass through all the points in the series. In this example, the graph is far away from the points. What am I doing wrong, or is this an actual…
Zeezer
  • 1,503
  • 2
  • 18
  • 33