NormalSplines.jl package implements the normal splines method for interpolating a function based on data of the function values and its first or second derivatives known at a set of points.
The normal splines method consists in finding a solution of corresponding system of constraints having minimal norm in Hilbert space and is based on the following functional analysis results:
-
Embedding theorems (Sobolev embedding theorem and Bessel potential spaces embedding theorem)
-
The Riesz representation theorem for Hilbert spaces
-
Reproducing kernel properties.
Using these results it is possible to reduce original problem to solving a system of linear equations with symmetric positive definite matrix.
Normal splines are constructed in Sobolev space and in Bessel potential space.
Example usage
Construct a normal spline to some function and its first and second derivatives values:
using NormalSplines
x = [0.0, 1.0, 2.0] # Function knots
u = [0.0, 1.0, 4.0] # Function values
s = [2.0] # First derivative knot
v = [4.0] # First derivative value
t = [0.0, 1.0] # Second derivative knots
w = [2.0 ,2.0] # Second derivative values
interpolate(x, u, s, v, t, w, RK_W3())
Evaluate the spline, its first and second derivatives at some points:
p = [0.0, 0.5, 1.0, 1.5, 2.0]
σ = evaluate(p) # result = [0.0, 0.25, 1.0, 2.25, 4.0]
σ' = evaluate(p, 1) # result = [0.0, 1.0, 2.0, 3.0, 4.0]
σ'' = evaluate(p, 2) # result = [2.0, 2.0, 2.0, 2.0, 2.0]
Detailed explanation is given in the package documentation.
Kind regards,
Igor