Piecewise linear approximation: Difference between revisions

From Cornell University Computational Optimization Open Textbook - Optimization Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 32: Line 32:
Consider the trigonometric function <math>f(x)=sin(x), -\pi \leq x\leq \pi </math>, as an example. The approximation straight lines are very close to the original function with only 9 sampling points.
Consider the trigonometric function <math>f(x)=sin(x), -\pi \leq x\leq \pi </math>, as an example. The approximation straight lines are very close to the original function with only 9 sampling points.


[[File:Numerical example.jpg|thumb|center]]
[[File:Numerical example.jpg|18px|frameless|center]]





Revision as of 00:46, 25 November 2021

Authors: Tianhong Tan, Shoudong Zhu (CHEME 6800, 2021 Fall)

Introduction

Currently, approximating a complex non-linear function or smooth curve is very common in industry area. Like the very popular one, piecewise linear approximation, which is applied in a variety of real-world areas, such as signal processing and image processing in electronics information industry, pattern recognition in AI area[1]. The problem of piecewise linear approximation can be classified by which type of norms applied in approximating process, whether the length of segments is fixed or not and whether the approximation is continuity or discontinuity[2]. We can use piecewise linear approximation to represent any non-linear or linear function by any accuracy order by any accuracy by adding more nodes or segments until the accuracy is met[3]. The meaning of piecewise linear approximation's existence is it allow us to transform non-linear problem to be solved by linear formation, which is easier to be executed by machine and the amount of calculation is acceptable[4].

Theory, Methodology & Algorithms

Theory

For a function in a finite range , one can find sampling points to evaluate the function values. Then the can be approximated by a series of linear segments , where . Any given value between and can be written as the following form:

(1)

is a unique number between and .

The approximation of is calculated by a convex combination of and :

(2)

Methodology & Algorithms

For the ease of applications in a MILP solver, the above formulation is further developed to include both binary and continuous variables with several constraints to force the values become associated with the neighboring pair of consecutive break points. The constraints are listed below:

(3)

(4)

(5)

(6)

(4) indicates that only one takes the value of and all the other 's are . Therefore, (5) imposes that the only 's which is not are and , which are corresponding to the two neighbors of : and . (6) and (7) ensure that and , which is consistent with the expression of the approximation in (2) [5].

The above formulation utilizes the idea of Special Ordered Sets (SOSs), which are powerful tools to model piecewise linear approximation problems [6]. They are defined as ordered sets of variables. In type 1 SOS (S1), only one variable can be non-zero, and 's in (3) form an S1. In type 2 SOS (S2), only two neighboring variables can be non-zero, and 's in (4) form an S2.

Numerical Example

Consider the trigonometric function , as an example. The approximation straight lines are very close to the original function with only 9 sampling points.



Applications

Conclusion

References

  1. G. Manis, G. Papakonstantinou and P. Tsanakas, "Optimal piecewise linear approximation of digitized curves," Proceedings of 13th International Conference on Digital Signal Processing, 1997, pp. 1079-1081 vol.2, doi: 10.1109/ICDSP.1997.628552.
  2. J. G. Dunham, "Optimum Uniform Piecewise Linear Approximation of Planar Curves," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. PAMI-8, no. 1, pp. 67-75, Jan. 1986, doi: 10.1109/TPAMI.1986.4767753.
  3. Optimal Piecewise Linear Approximation of Convex Functions A. Imamoto, B. Tang, Member, IAENG, Proceedings of the World Congress on Engineering and Computer Science 2008 WCECS 2008, October 22 - 24, 2008, San Francisco, USA.
  4. Applied Mathematical Programming by Bradley, Hax, and Magnanti (Addison-Wesley,1977) http://web.mit.edu/15.053/www/AppliedMathematicalProgramming.pdf
  5. D’Ambrosio, C., Lodi, A., Martello, S. (2010). Piecewise Linear Approximation of Functions of Two Varibles in MILP Models, Operations Research Letters, 38, 39-46.
  6. Tomlin, J. A., “Special Ordered Sets and an Application to Gas Supply Operations Planning”, Ketron Management Science, Inc., Mountain View, CA 94040-1266, USA.