express basis spline derivative in terms of interpolation values

3 vues (au cours des 30 derniers jours)
SA-W
SA-W le 28 Mar 2024
Commenté : Bruno Luong le 4 Avr 2024
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!

Réponse acceptée

Bruno Luong
Bruno Luong le 28 Mar 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 commentaires
SA-W
SA-W le 4 Avr 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 le 4 Avr 2024
You might need to impose both conditions of third and fourth derivative on x(end).

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Spline Construction dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by