HERMITE_CUBIC
Hermite Cubic Polynomial Evaluation, Interpolation, Integration, Splines
HERMITE_CUBIC
is a MATLAB library which
demonstrates the use of cubic polynomials in the Hermite form.
The Hermite Cubic
The Hermite form of a cubic polynomial defines the polynomial p(x)
by specifying two distinct points x1 and x2, and
providing values for the following four items:
f1 = p(x1)
d1 = p'(x1)
f2 = p(x2)
d2 = p'(x2)
The locations of the abscissas and the four data values are enough
to uniquely define a cubic polynomial, known as the Hermite cubic.
From the Hermite cubic representation, it is possible to determine
the standard power series form:
p(x) = c_{0} + c_{1} * x + c_{2} * x^{2} + c_{3} * x^{3}
It is possible, given any value of the argument x and the
data values that define the Hermite cubic polynomial, to determine the
value of p(x), as well as the values of the first, second and third
derivatives.
It is possible, given two values of the argument x3 and
x4, and the data values that define the Hermite cubic polynomial,
to determine the value of the integral of p(x) over the interval
[x3,x4].
Hermite Cubic Splines:
A sequence of Hermite cubic polynomials can be used to produce a
piecewise cubic Hermite interpolant, if we are given a strictly
increasing sequence of n nodes x(1:n), and corresponding
data vectors f(1:n) and d(1:n). This is done by
defining n1 cubic Hermite polynomials, with the ith
polynomial defined using the data at nodes x(i) and x(i+1).
The resulting function interpolates the value and derivative data,
and is continuous and continuously differentiable everywhere,
and in particular, at the nodes.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
HERMITE_CUBIC is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
BERNSTEIN_POLYNOMIAL,
a MATLAB library which
evaluates the Bernstein polynomials,
useful for uniform approximation of functions;
DIVDIF,
a MATLAB library which
computes divided difference polynomials from data;
HERMITE,
a MATLAB library which
computes the Hermite interpolant, a polynomial that matches function values
and derivatives.
SPLINE,
a MATLAB library which
includes many routines to construct
and evaluate spline interpolants and approximants.
TEST_INTERP_1D,
a MATLAB library which
defines test problems for interpolation of data y(x),
depending on a 1D argument.
Reference:

Fred Fritsch, Ralph Carlson,
Monotone Piecewise Cubic Interpolation,
SIAM Journal on Numerical Analysis,
Volume 17, Number 2, April 1980, pages 238246.
Source Code:

hermite_cubic_integral.m,
evaluates the integral of a Hermite cubic polynomial over
the interval [X1,X2].

hermite_cubic_integrate.m,
evaluates the integral of a Hermite cubic polynomial over an
arbitrary interval [A,B].

hermite_cubic_lagrange_integral.m,
computes the integral of the four Lagrange polynomials
associated with a Hermite cubic polynomial over the definition interval [X1,X2].

hermite_cubic_lagrange_integrate.m,
computes the integral of the four Lagrange polynomials
associated with a Hermite cubic polynomial over an arbitrary interval [A,B].

hermite_cubic_lagrange_value.m,
computes the value and derivatives of the four Lagrange polynomials
associated with a Hermite cubic polynomial.

hermite_cubic_spline_integral.m,
evaluates the integral of a Hermite cubic spline over
the interval [X(1),X(N)].

hermite_cubic_spline_integrate.m,
evaluates the integral of a Hermite cubic spline over an
arbitrary interval [A,B].

hermite_cubic_spline_quad_rule.m,
returns a quadrature rule for Hermite cubic splines on a particular grid.

hermite_cubic_spline_value.m,
evaluates a Hermite cubic spline function.

hermite_cubic_to_power_cubic.m,
converts a Hermite cubic to power form.

hermite_cubic_value.m,
evaluates a Hermite cubic polynomial.

power_cubic_to_hermite_cubic.m,
converts a power cubic to Hermite form.

r8_uniform_01.m,
returns a unit pseudorandom R8.

r8vec_uniform_01.m,
returns a unit pseudorandom R8VEC.

timestamp.m,
prints the current YMDHMS date as a time stamp.
Examples and Tests:

hermite_cubic_test.m, calls all the tests;

hermite_cubic_test_output.txt,
the output file.

hermite_cubic_test01.m,
tests HERMITE_CUBIC_VALUE;

hermite_cubic_test02.m,
tests HERMITE_CUBIC_VALUE;

hermite_cubic_test03.m,
tests HERMITE_CUBIC_INTEGRATE;

hermite_cubic_test04.m,
tests HERMITE_CUBIC_SPLINE_VALUE;

hermite_cubic_test05.m,
tests HERMITE_CUBIC_TO_POWER_CUBIC;

hermite_cubic_test06.m,
tests HERMITE_CUBIC_INTEGRATE using vectors;

hermite_cubic_test07.m,
tests HERMITE_CUBIC_INTEGRAL;

hermite_cubic_test08.m,
tests HERMITE_CUBIC_SPLINE_INTEGRAL;

hermite_cubic_test09.m,
tests HERMITE_CUBIC_SPLINE_INTEGRATE;

hermite_cubic_test10.m,
tests HERMITE_CUBIC_SPLINE_INTEGRAL, demonstrating that for
equally spaced data, the derivative values D(2:N1) have no
effect on the computed integral estimate at all.

hermite_cubic_test11.m,
tests HERMITE_CUBIC_LAGRANGE_VALUE, which evaluates the four
Lagrange basis functions associated with a Hermite cubic polynomial.

hermite_cubic_test12.m,
tests HERMITE_CUBIC_LAGRANGE_INTEGRAL, which returns the integrals
of the four Lagrange basis functions associated with a Hermite
cubic polynomial over the definition interval [X1,X2].

hermite_cubic_test13.m,
tests HERMITE_CUBIC_LAGRANGE_INTEGRATE;

hermite_cubic_test14.m,
tests HERMITE_CUBIC_SPLINE_QUAD_RULE;

hermite_cubic_test15.m,
tests HERMITE_CUBIC_SPLINE_QUAD_RULE;

cubic_value.m,
returns the value and derivatives of a particular cubic polynomial.

cubic_integrate.m,
returns the integral of a particular cubic polynomial from A to B.

cubic_antiderivative.m,
evaluates the antiderivative function of a particular cubic polynomial.
You can go up one level to
the MATLAB source codes.
Last modified on 29 March 2011.