# \[ANN\] NormalSplines.jl: 1-D Interpolating Normal Splines

**URL:** <https://discourse.julialang.org/t/ann-normalsplines-jl-1-d-interpolating-normal-splines/36811>\
**Category:** Package Announcements\
**Tags:** interpolations, splines\
**Created:** [March 31, 2020, 6:37pm UTC](https://discourse.julialang.org/t/ann-normalsplines-jl-1-d-interpolating-normal-splines/36811 "2020-03-31T18:37:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igorkohan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/igorkohan/32/13759_2.png) [@igorkohan](https://discourse.julialang.org/u/igorkohan)\
**Post date:** [March 31, 2020, 6:37pm UTC](https://discourse.julialang.org/t/ann-normalsplines-jl-1-d-interpolating-normal-splines/36811/1 "2020-03-31T18:37:21Z")

</div>

[NormalSplines.jl](https://github.com/IgorKohan/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:

```julia-auto

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:

```julia-auto

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](https://igorkohan.github.io/NormalSplines.jl/stable).

Kind regards,  
Igor
