express basis spline derivative in terms of interpolation values

3 次查看(过去 30 天)
x = [1 2 3 4 5];
y = randn(size(x));
f = spapi(5,x,y);
fdd = fnder(f, 2);
If we evaluate the second derivative at a given point x* as
xeval = 3.5;
val = fnval(fdd, xeval)
is there a way to express "val" as a linear combination of the interpolation values as
val = y(1)*c1 + ... + y(5)*c5
Then, the task is to find the coefficients ci.
Can this be done with symbolic differentiation or other techniques? Or is there an easy analytical representation for that?
Thank you!

采纳的回答

Bruno Luong
Bruno Luong 2024-3-28
x = [1 2 3 4 5];
y = randn(size(x));
k = 5;
f = spapi(k,x,y);
B = spapi(k,x,eye(length(x)));
fdd = fnder(f, 2);
Bdd = fnder(B,2);
xeval = 3.5;
val = fnval(fdd, xeval)
val = 1.5349
c = fnval(Bdd, xeval);
vcomb = y * c
vcomb = 1.5349
err = val-vcomb
err = 8.8818e-16
  34 个评论
SA-W
SA-W 2024-4-4

Honestly I dont understand what you want to achieve your code. Why do you put positive constraint on fdddd(x(end)) and not fddd(x(end))? I don't know what is your goal

Oh, you are right. To have s''(x)>0 for x>x(end), I thought the fourth derivative must be positive at x(end). But s'''(x(end)) is sufficient, right?

(I will not ask further after this and say thanks a lot for helping!! :-))

Bruno Luong
Bruno Luong 2024-4-4
You might need to impose both conditions of third and fourth derivative on x(end).

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spline Construction 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by