YYnotesYYNotes

学习目标Learning Objectives - Note

#学习目标#关键概念#定义与公式#推导

第4周:从 Hermite 到三次样条连续性Week 4 - Hermite to Cubic Spline Continuity

在含导数条目的情况下使用牛顿差商表。Bilingual notes on endpoint-derivative interpolation and C2 spline junctions.

Week 4 connects single-interval Hermite interpolation to multi-interval cubic spline constraints.

第4周将单区间 Hermite 插值与多区间三次样条约束连接起来。

学习目标

Learning Objectives

  • Solve quadratic and cubic Hermite interpolation problems with endpoint derivatives.

  • 求解带端点导数条件的二次与三次 Hermite 插值问题。

  • 在含导数条目的情况下使用牛顿差商(Divided Difference)表。

  • Use Newton divided-difference tables with derivative entries.

  • Derive endpoint second-derivative formulas from cubic Hermite data.

  • 由三次 Hermite 数据推导端点二阶导公式。

  • 在样条构造中应用 C1C^1C2C^2 拼接条件。

  • Apply C1C^1 and C2C^2 junction conditions for spline construction.

关键概念

Key Concepts

  • 函数空间记号:C[a,b]C[a,b]C1[a,b]C^1[a,b]C2[a,b]C^2[a,b]

  • Function class notation: C[a,b]C[a,b], C1[a,b]C^1[a,b], C2[a,b]C^2[a,b].

  • Hermite data on [p,q][p,q]: values P,QP,Q and derivatives dp,dqd_p,d_q.

  • 区间 [p,q][p,q] 的 Hermite 数据:函数值 P,QP,Q 与导数 dp,dqd_p,d_q

  • 三次样条是分段三次函数,并在拼接点满足光滑性条件。

  • Cubic spline is piecewise cubic with required smoothness at junctions.

  • 拼接处通常要求 SSSS'SS'' 连续。

  • Junction smoothness typically enforces continuity of SS, SS', and SS''.

定义与公式

Definitions and Formulas

Let f[p,q]=QPqpf[p,q]=\dfrac{Q-P}{q-p} and h=qph=q-p.

f[p,q]=QPqpf[p,q]=\dfrac{Q-P}{q-p},步长 h=qph=q-p

Cubic Hermite form used in lecture:

课堂使用的三次 Hermite 形式:

H(x)=P+f[p,q](xp)+c(xp)(xq)+d(xp)2(xq)H(x)=P+f[p,q](x-p)+c(x-p)(x-q)+d(x-p)^2(x-q).

系数公式:

Coefficients:

c=dpf[p,q]pq,d=dp+dq2f[p,q](pq)2c=\dfrac{d_p-f[p,q]}{p-q}, \quad d=\dfrac{d_p+d_q-2f[p,q]}{(p-q)^2}.

端点曲率关系:

Endpoint curvature relation:

H(p)=4dp+2dq6f[p,q]h,H(q)=4dq+2dp6f[p,q]hH''(p)=\dfrac{4d_p+2d_q-6f[p,q]}{h},\quad H''(q)=\dfrac{4d_q+2d_p-6f[p,q]}{h}.

推导

Derivations

Quadratic Hermite from One Value Derivative Pair

从一个“值+导数”对构造二次 Hermite

Given f(1)=3f(1)=3, f(5)=7f(5)=7, f(1)=6f'(1)=6, write

给定 f(1)=3f(1)=3f(5)=7f(5)=7f(1)=6f'(1)=6,设

f(x)=3+f[1,5](x1)+c(x1)(x5)f(x)=3+f[1,5](x-1)+c(x-1)(x-5).

求导后代入 x=1x=1 解出 cc

Differentiate and set x=1x=1 to solve for cc.

Cubic Hermite with Both Endpoint Slopes

同时给定两端斜率的三次 Hermite

加入余项 d(x1)2(x5)d(x-1)^2(x-5),使 x=1x=1 处函数值与斜率约束保持不变。

Add gap term d(x1)2(x5)d(x-1)^2(x-5) so that value and slope constraints at x=1x=1 stay satisfied.

对表达式求导并代入 x=5x=5,可解出 dd

Differentiate and evaluate at x=5x=5 to solve for dd.

样条拼接方程

Spline Junction Equation

对节点 1,5,81,5,8,未知中间斜率 dq=S(5)d_q=S'(5) 由下式确定:

For nodes 1,5,81,5,8, unknown middle slope dq=S(5)d_q=S'(5) is found from

S(5)=S(5+)S''(5^-)=S''(5^+).

利用两侧端点斜率数据可得到关于 dqd_q 的一元线性方程。

This yields one linear equation in dqd_q using endpoint slope data.

例题精讲

Worked Examples

Example Block 1: Quadratic Hermite 例题模块1:二次 Hermite

For f(1)=3f(1)=3, f(5)=7f(5)=7, f(1)=6f'(1)=6, we have f[1,5]=1f[1,5]=1.

f(1)=3f(1)=3f(5)=7f(5)=7f(1)=6f'(1)=6,有 f[1,5]=1f[1,5]=1

Then c=f(1)f[1,5]15=614=54c=\dfrac{f'(1)-f[1,5]}{1-5}=\dfrac{6-1}{-4}=-\dfrac{5}{4}.

于是 c=f(1)f[1,5]15=614=54c=\dfrac{f'(1)-f[1,5]}{1-5}=\dfrac{6-1}{-4}=-\dfrac{5}{4}

例题模块2:乘积导数快捷法

Example Block 2: Product Derivative Shortcut

Let g(x)=(x1)(x2)(x5)(x7)g(x)=(x-1)(x-2)(x-5)(x-7).

g(x)=(x1)(x2)(x5)(x7)g(x)=(x-1)(x-2)(x-5)(x-7)

在单根 x=2x=2 处,g(2)=r2(2r)=(21)(25)(27)=15g'(2)=\prod_{r\ne2}(2-r)=(2-1)(2-5)(2-7)=15

At a simple root x=2x=2, g(2)=r2(2r)=(21)(25)(27)=15g'(2)=\prod_{r\ne2}(2-r)=(2-1)(2-5)(2-7)=15.

例题模块3:样条中间斜率方程建立

Example Block 3: Spline Middle Slope Setup

Given S(1)=3S(1)=3, S(1)=2S'(1)=2, S(5)=7S(5)=7, S(8)=6S(8)=6, S(8)=9S'(8)=9.

给定 S(1)=3S(1)=3S(1)=2S'(1)=2S(5)=7S(5)=7S(8)=6S(8)=6S(8)=9S'(8)=9

Use left and right cubic Hermite pieces and enforce S(5)=S(5+)S''(5^-)=S''(5^+) to solve dq=S(5)d_q=S'(5).

分别构造左右三次 Hermite 段,并令 S(5)=S(5+)S''(5^-)=S''(5^+) 解得 dq=S(5)d_q=S'(5)

误差(Error)分析

Error Analysis

  • Hermite interpolation reduces local mismatch by using derivative data.

  • Hermite 插值通过加入导数信息降低局部失配。

  • 但导数数据噪声会传播到曲率项,可能导致样条形状不稳定。

  • However, derivative noise can propagate into curvature terms and destabilize spline shape.

  • 三次样条的光滑约束可提升跨区间的视觉与数值稳定性。

  • Cubic spline smoothness constraints improve visual and numerical stability across intervals.

常见错误

Common Mistakes

警示模块

Warning Block

  • 混用 h=pqh=p-qh=qph=q-p 且未跟踪符号。

  • Mixing h=pqh=p-q and h=qph=q-p without sign tracking.

  • Forgetting that repeated-node Hermite conditions imply squared factors.

  • 忽略重节点 Hermite 条件对应平方因子。

  • 只施加 C1C^1 连续而遗漏必需的 C2C^2 条件。

  • Applying only C1C^1 continuity and forgetting the required C2C^2 condition.

总结

Summary

总结模块

Summary Block

  • Week 4 translated Hermite formulas into spline-ready endpoint and junction constraints.

  • 第4周将 Hermite 公式转化为样条可用的端点与拼接约束。

  • 核心转变是从单区间拟合走向整体分段光滑建模。

  • The key transition is from one-interval fitting to global piecewise smooth modeling.

练习题

Practice Questions

  • Given f(1)=3f(1)=3, f(5)=7f(5)=7, f(1)=6f'(1)=6, f(5)=4f'(5)=4, construct the cubic Hermite polynomial explicitly.

  • 给定 f(1)=3f(1)=3f(5)=7f(5)=7f(1)=6f'(1)=6f(5)=4f'(5)=4,显式构造三次 Hermite 多项式。

  • 对节点 p<q<rp<q<r,推导用端点斜率表示的 S(q)S(q+)S''(q^-)-S''(q^+) 公式。

  • For nodes p<q<rp<q<r, derive a formula for S(q)S(q+)S''(q^-)-S''(q^+) in terms of endpoint slopes.

  • 求解本周样条例题中 [1,5][1,5][5,8][5,8] 的未知斜率 S(5)S'(5)

  • Solve the week example for unknown S(5)S'(5) in the spline problem on [1,5][1,5] and [5,8][5,8].