A Shape-Preserving Approximation by Weighted Cubic Splines
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Journal of Computational and Applied Mathematics 236 (2012) 4383–4397 Contents lists available at SciVerse ScienceDirect Journal of Computational and Applied Mathematics journal homepage: www.elsevier.com/locate/cam A shape-preserving approximation by weighted cubic splines Tae-wan Kim a,∗, Boris Kvasov b a Department of Naval Architecture and Ocean Engineering, Research Institute of Marine Systems Engineering, Seoul National University, Seoul 151-744, Republic of Korea b Department of Mathematical Modeling, Institute of Computational Technologies, Russian Academy of Sciences, Novosibirsk 630090, Russia article info a b s t r a c t Article history: This paper addresses new algorithms for constructing weighted cubic splines that are Received 25 August 2011 very effective in interpolation and approximation of sharply changing data. Such spline Received in revised form 3 April 2012 interpolations are a useful and efficient tool in computer-aided design when control of tension on intervals connecting interpolation points is needed. The error bounds for Keywords: interpolating weighted splines are obtained. A method for automatic selection of the Shape-preserving interpolation and weights is presented that permits preservation of the monotonicity and convexity of the approximation data. The weighted B-spline basis is also well suited for generation of freeform curves, in Differential multipoint boundary value problem the same way as the usual B-splines. By using recurrence relations we derive weighted Weighted cubic splines B-splines and give a three-point local approximation formula that is exact for first-degree Error bounds polynomials. The resulting curves satisfy the convex hull property, they are piecewise Adaptive choice of shape control cubics, and the curves can be locally controlled with interval tension in a computationally parameters efficient manner. Recurrence relations for weighted B-splines ' 2012 Elsevier B.V. All rights reserved. 1. Introduction C 2 cubic splines play a very important role in practical methods of spline approximation. However, such splines do not retain the shape properties of the data, a drawback known as the shape-preserving approximation problem. During the past few decades, different authors have developed various algorithms of spline approximation with both local and global shape control. They include exponential, hyperbolic, computationally more efficient rational splines [1–4], etc. The tension parameters are mainly viewed as an interactive design tool for manipulating the shape of a spline curve. A very detailed literature review of algorithms for passing a curve through data points so as to preserve the shape of the data is given in [5]. In this paper we consider the weighted cubic splines introduced in [6] (see also [7–12]). Such splines are C 1 piecewise cubic splines where weights are shape parameters. They are a natural generalization of cubic splines, describing from a physical point of view, an inhomogeneous elastic beam supported at some points. The idea is that the elastic property of the material is kept piecewise constant, and then it follows by variational arguments that C 2 continuity is lost, but is replaced by known jumps in second derivatives. The theory was steadily developed over years, and now weighted splines are known to possess a B-spline basis [10], optimal in a certain sense, and they are Chebyshev splines with sections in appropriate Extended Complete Chebyshev (ECC)-spaces [13,14]. To treat the weighted splines in a general setting we suggest using the approach of the second author (see [15–17]) in which such splines are defined as solutions of the differential multipoint boundary value problems. We give direct algorithms to construct the weighted cubic splines, prove error bounds, and show how to choose weight (tension) parameters automatically depending on the data monotonicity and convexity. Such algorithms for automatic selection of ∗ Corresponding author. Tel.: +82 10 2739 7364; fax: +82 2888 9298. E-mail addresses: [email protected] (T.-w. Kim), [email protected] (B. Kvasov). URL: http://caditlab.snu.ac.kr/ (T.-w. Kim). 0377-0427/$ – see front matter ' 2012 Elsevier B.V. All rights reserved. doi:10.1016/j.cam.2012.04.001 4384 T.-w. Kim, B. Kvasov / Journal of Computational and Applied Mathematics 236 (2012) 4383–4397 the weight parameters are based on the sufficient conditions of monotonicity and convexity for C 2 cubic splines [15]. Due to the simplicity and the reliability of the corresponding algorithms, their use in CAD systems can be considered. Normalized B-bases present optimal shape preserving properties for the representation of curves when control polygons are used [18,19]. Rational cubic B-spline bases with point and interval shape control parameters were suggested in [1,2]. The general approach in [20,15] is an alternative which permits to construct different kinds of tension B-splines, including rational, weighted, etc. This allowed us to give explicit formulas for normalized weighted B-splines in a simpler way than based on the Bernstein–Bézier representation in [10]. Each weighted B-spline is a non-negative cubic spline that is non-zero only on four intervals. The weighted B-splines form a partition of unity; that is, they sum to one. Curves generated by summing control points multiplied by the weighted B-splines have some desirable shape properties, including the local convex hull property. The different weights are built into the basis functions so that the resulting control point curve is a piecewise cubic with local control of interval tension. Recurrence formulas for weighted B-splines offer valuable insight into their geometric behavior. Knot insertion algorithms for weighted B-splines [21,22] produce numerically stable formulas for weighted B-splines. This paper is divided into eight sections. In Section2, we define weighted splines and give algorithms for their construction. Section3 provides error bounds for weighted splines. In Section4 a method for adaptive selection of weights is presented that allows the monotonicity and convexity of the data to be preserved automatically. In Section5 by using recurrence relations we construct weighted B-spline basis with tension properties and give a three-point formula for local approximation. Section6 uses a weighted B-spline basis to form a control point sum that will yield a curve with the convex hull property. We conclude with numerical examples of functional and curve interpolation and final comments in Sections7 and8. 2. Weighted splines Suppose that we are given the data .xi; fi/; i D 0;:::; N C 1; (1) where a D x0 < x1 < ··· < xNC1 D b. Define f Txi; xiC1UD .fiC1 − fi/=hi; hi D xiC1 − xi; i D 0;:::; N: Data (1) are called monotonically increasing if f Txi; xiC1U ≥ 0; i D 0;:::; N; and are called convex if f Txi−1; xi; xiC1U ≥ 0; i D 1;:::; N: The shape-preserving interpolation problem consists of constructing a sufficiently smooth function S such that S.xi/ D fi for i D 0;:::; N C 1 and S is monotonic and convex on the intervals of monotonicity and convexity of the input data. The shape-preserving interpolation problem can be very efficiently solved by using weighted splines. Suppose that w is a function on Ta; bU satisfying 0 < m ≤ w.x/ ≤ M for all x 2 Ta; bU. We will call w the weight function. Definition 1. The weighted spline S is defined as the solution to the differential multipoint boundary value problem (DMBVP) 2 2 d d S k w.x/ D 0 for all x 2 .xi; xiC1/; i D 0;:::; N; S 2 C Ta; bU; k ≥ 1: (2) dx2 dx2 If w.x/ ≡ 1 and k D 2, then we obtain a conventional C 2 cubic spline. 00 In the case when w is piecewise constant on the subdivision (w.x/ ≡ wi for x 2 Txi; xiC1/; i D 0;:::; N) S is a piecewise linear function and thus S is a piecewise cubic function, but since w is discontinuous, the solution is only C 1 (see [6,8,9,7,10, 11]). The second derivative satisfies the conditions 00 − D 00 C D wi−1S .xi / wiS .xi /; i 1;:::; N: (3) If we choose w.x/ D 1=q.x/, where q is a continuous piecewise linear function on a given subdivision, then solution S will be a piecewise polynomial function of degree 4 belonging to C 2. This solution is called a q-spline and is investigated in [23]. For a more general form of the weight function w the DMVBP can be solved by using a finite-difference method (see [24, 16,17]). An alternative and perhaps modern view is to refer to weighted cubic splines as to splines with cubic sections [25,26]. In this paper we shall study in detail the case k D 1 with w being a piecewise constant where the solution is a cubic spline belonging to C 1. We assume that cubic spline S satisfies the interpolation conditions S.xi/ D fi; i D 0;:::; N C 1: (4) T.-w. Kim, B. Kvasov / Journal of Computational and Applied Mathematics 236 (2012) 4383–4397 4385 To define a spline uniquely we also need boundary conditions. The most common are the following endpoint constraints: 0 D 0 0 D 0 1. First derivative endpoint conditions: S .a/ f0 and S .b/ fNC1. 00 D 00 00 D 00 2. Second derivative endpoint conditions: S .a/ f0 and S .b/ fNC1. .r/ D .r/ D 00 C D 00 − 3. Periodic endpoint conditions: S .a/ S .b/; r 0; 1, w0S .x0 / wN S .xNC1/. 4. ``Not-a-knot'' endpoint conditions where adjacent polynomials nearest to the endpoints of the interval Ta; bU coincide: ≡ ≡ 000 − D 000 C D D S0.x/ S1.x/ and SN−1.x/ SN .x/, that is, S .xi / S .xi /; wi−1 wi; i 1; N.