Optimal knot distribution when specifying interpolating value and derivatives

2 次查看(过去 30 天)
Hi,
i'm using spapi to build interpolating splines where the y value and its first derivative are specified:
spline1=spapi(knots,5,[x x],[y yprime])
where (x,y) are my interpolating points and (x,yprime) are the first derivative of y at x.
I'd like to use optknt to improve the distribution of the knots in the spline but it requires the interpolating points to non decreasing.
optknt([x x],5,20)
Gives an error whilst
optknt(x,5,20)
Doesnt give the appropriate number of knots for the number of interpolating conditions.
Is there an different method, option or function that can optimise the knot placement in this situation?
With thanks,
Belinda

回答(1 个)

Unai San Miguel
Unai San Miguel 2020-9-18
The length of the knot vector knots should be equal to the length of your [x, x] vector plus the order of the spline, 5 in your case, because with spapi you try to solve a determined system, with the same number of equations (length([x, x])) as unknowns (length(knots) - 5). If you want to do oscullatory interpolation with x you need to make up a suitable knot vector. And you can always start with the suggestion from the function, eg spapi(5, [x, x], [y, yprime]), and modify the knot vector from there.

类别

Help CenterFile Exchange 中查找有关 Breaks, Knots, and Sites 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by