express basis spline derivative in terms of interpolation values

3 visualizaciones (últimos 30 días)
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!

Respuesta aceptada

Bruno Luong
Bruno Luong el 28 de Mzo. de 2024
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 comentarios
SA-W
SA-W el 4 de Abr. de 2024

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 el 4 de Abr. de 2024
You might need to impose both conditions of third and fourth derivative on x(end).

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spline Construction en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by