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
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Breaks, Knots, and Sites에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!