Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
kvalobs:kvoss:system:qc2:requirements:algorithms:akima_splines [2010-04-15 15:20:06]
gabrielk created
kvalobs:kvoss:system:qc2:requirements:algorithms:akima_splines [2022-05-31 09:29:32] (current)
Line 1: Line 1:
 ====== Akima algorithm ====== ====== Akima algorithm ======
    
-The approach uses a cubic fit between the data points, so the slope is required at each data+You are given a single independent variable x. The approach uses a cubic fit between the data points, so the slope is required at each data
 point in addition to the value of the point itself. The interpolating polynomial is written point in addition to the value of the point itself. The interpolating polynomial is written
 between the ith and i + 1st data points as: between the ith and i + 1st data points as:
  
-y = a<sub>0</sub> + a<sub>1</sub> (x − x<sub>i</sub>) + a<sub>2</sub> (x − x<sub>i</sub>)<sup>2</sup> + a<sub>3</sub> (x − x<sub>i</sub>)<sup>3</sup> ,+y = a<sub>0</sub> + a<sub>1</sub> (x − x<sub>i</sub>) + a<sub>2</sub> (x − x<sub>i</sub>)<sup>2</sup> + a<sub>3</sub> (x − x<sub>i</sub>)<sup>3</sup>(1)
  
 with coefficients defined by with coefficients defined by
Line 15: Line 15:
 a<sub>2</sub> = ( 3m<sub>i</sub> − 2y<sup>'</sup><sub>i</sub> − y<sup>'</sup><sub>i+1</sub> ) / ( x<sub>i+1</sub> − x<sub>i</sub> ) a<sub>2</sub> = ( 3m<sub>i</sub> − 2y<sup>'</sup><sub>i</sub> − y<sup>'</sup><sub>i+1</sub> ) / ( x<sub>i+1</sub> − x<sub>i</sub> )
  
-a<sub>3</sub> = +a<sub>3</sub>( y<sup>'</sup><sub>i</sub> y<sup>'</sup><sub>i+1</sub> − 2m<sub>i</sub> ) / x<sub>i+1</sub> − x<sub>i</sub>)<sup>2</sup> ,
-y0i y0i+1 − 2mi +
-(xi+1 − xi)2 ,+
  
 and, and,
  
-m<sub>i</sub> = +m<sub>i</sub>( y<sub>i+1</sub> − y<sub>i</sub> ) / ( x<sub>i+1</sub> − x<sub>i</sub> ) (2)
-yi+1 − yi +
-xi+1 − xi +
-,+
  
 which is the slope of the line segment passing through the points. which is the slope of the line segment passing through the points.
-The method of determining the derivatives, y0, is what makes the Akima methods unique. The derivative is+The method of determining the derivatives, y<sup>'</sup>, is what makes the Akima methods unique. The derivative is
  
-y0i = +y<sup>'</sup><sub>i</sub> ( Σ w<sub>k</sub>f<sup>'</sup><sub>k</sub> ) / ( Σ w<sub>k</sub> )  (3)
-+
-wkf0k P +
-wk+
  
-where f0k is the computed derivative at Pi of a third-order polynomial passing through Pi and+where f<sup>'</sup><sub>k</sub> is the computed derivative at P<sub>i</sub> of a third-order polynomial passing through P<sub>i</sub> and
 three other nearby points: three other nearby points:
  
-f01 = F (Pi−3, Pi−2, Pi−1, Pi) (16)+f<sup>'</sup><sub>1</sub> = F (P<sub>i−3</sub>P<sub>i−2</sub>P<sub>i−1</sub>P<sub>i</sub> (4)
  
-f02 = F (Pi−2, Pi−1, PiPi+1) (17)+f<sup>'</sup><sub>2</sub> = F (P<sub>i−2</sub>P<sub>i−1</sub>P<sub>i</sub>P<sub>i+1</sub> (5)
  
-f03 = F (Pi−1, PiPi+1, Pi+2) (18)+f<sup>'</sup><sub>3</sub> = F (P<sub>i−1</sub>P<sub>i</sub>P<sub>i+1</sub>P<sub>i+2</sub> (6)
  
-f04 = F (PiPi+1, Pi+2, Pi+3) . (19)+f<sup>'</sup><sub>4</sub> = F (P<sub>i</sub>P<sub>i+1</sub>P<sub>i+2</sub>P<sub>i+3</sub>).  (7)
  
-The weights are inversely proportional to the product of what Akima calls a volatility measure +The weights are inversely proportional to the product of what Akima calls a volatility measure and a distance measure,
-and a distance measure,+
  
-wk = +w<sub>k</sub> = 1 / v<sub>k</sub>d<sub>k</sub> (8)
-1 +
-vkdk +
-.+
  
-The distance factor is the sum of squares of the distance from Pi and the other three points:+The distance factor is the sum of squares of the distance from P<sub>i</sub> and the other three points:
  
-d1 = (xi−3 − xi)2 + (xi−2 − xi)2 + (xi−1 − xi)2+d<sub>1</sub> = (x<sub>i−3</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i−2</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i−1</sub> − x<sub>i</sub>)<sup>2</sup>
  
-d2 = (xi−2 − xi)2 + (xi−1 − xi)2 + (xi+1 − xi)2+d<sub>2</sub> = (x<sub>i−2</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i−1</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i+1</sub> − x<sub>i</sub>)<sup>2</sup>
  
-d3 = (xi−1 − xi)2 + (xi+1 − xi)2 + (xi+2 − xi)2+d<sub>3</sub> = (x<sub>i−1</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i+1</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i+2</sub> − x<sub>i</sub>)<sup>2</sup>
  
-d4 = (xi+1 − xi)2 + (xi+2 − xi)2 + (xi+3 − xi)2 .+d<sub>4</sub> = (x<sub>i+1</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i+2</sub> − x<sub>i</sub>)<sup>2</sup> + (x<sub>i+3</sub> − x<sub>i</sub>)<sup>2</sup> .
  
-The volatility factor, vk, is the sum of squares of deviation from a least-squares linear fit of the +The volatility factor, v<sub>k</sub>, is the sum of squares of deviation from a least-squares linear fit of the 
-four points.+four points. (the same sets of four points appearing in Equations 4 through 7).
  
 H. Akima. A method of univariate interpolation that has the accuracy of a third-degree H. Akima. A method of univariate interpolation that has the accuracy of a third-degree
 polynomial. ACM Trans. on Math. Softw., 17, 1991. polynomial. ACM Trans. on Math. Softw., 17, 1991.
 +(as copied from [[http://acdl.mit.edu/mdo/mdo_06/Single-variable.pdf]]
 +
  
 See also: See also:
 [[http://www.alglib.net/interpolation/spline3.php#header3]] [[http://www.alglib.net/interpolation/spline3.php#header3]]
  
  • kvalobs/kvoss/system/qc2/requirements/algorithms/akima_splines.1271344806.txt.gz
  • Last modified: 2022-05-31 09:23:18
  • (external edit)