Piecewise linear approximation

What Is Piecewise Linear Approximation?

Piecewise linear approximation is a mathematical technique for representing a nonlinear function as a sequence of connected straight-line segments defined over adjacent sub-intervals of the domain. Rather than fitting a single global polynomial or closed-form expression to complex data, the method partitions the domain into regions, fits a linear function within each region, and joins these segments at shared boundary points called breakpoints or knots. The technique draws on numerical analysis, mathematical programming, and computational geometry, and it appears throughout engineering, signal processing, and operations research wherever nonlinear functions must be handled efficiently by linear solvers.

The core appeal of piecewise linear approximation is tractability. Many optimization and control problems become analytically or computationally intractable when a nonlinear function is involved, but a piecewise linear surrogate converts the problem into one that mixed-integer linear programming can solve exactly. Accuracy improves monotonically with the number of segments: as the Cornell Optimization Wiki notes, adding breakpoints can represent any function to any desired accuracy.

Mathematical Foundations

A piecewise linear function over an interval is specified by a set of breakpoints and the corresponding function values at those points. For any input between two adjacent breakpoints, the output is the linear interpolation between the two neighboring values, computed as a convex combination of the endpoint values. In optimization models, this interpolation is encoded using Special Ordered Set (SOS2) constraints, which enforce that at most two adjacent weight variables are nonzero simultaneously. This algebraic encoding allows a mixed-integer linear program to select the active segment and compute the interpolated value without introducing inherently nonlinear terms.

Segmentation and Breakpoint Selection

A central challenge in piecewise linear approximation is choosing the number and placement of breakpoints. Uniform spacing is the simplest strategy, but it allocates breakpoints inefficiently when the function changes rapidly in one region and slowly in another. Adaptive methods place more breakpoints where the approximation error, often measured in the L-infinity or L2 norm, exceeds a threshold. Research on optimal piecewise linear function approximation shows that dynamic programming can solve the optimal fixed-breakpoint problem efficiently, minimizing total approximation error for a given number of segments. For streaming data, online algorithms update segment boundaries incrementally as new observations arrive, which is important in sensor networks and real-time signal compression.

Continuous and Discontinuous Forms

Piecewise linear approximation exists in both continuous and discontinuous variants. The continuous form, in which segment endpoints match at every breakpoint, is most common in function approximation and optimization because it guarantees a well-defined unique output for each input. Discontinuous forms are used in threshold models and relay-type control systems, where the function is allowed to jump at breakpoints. The continuous form maps naturally to linear splines, which are the simplest member of the broader spline family studied in approximation theory. An overview in ScienceDirect Topics reviews continuous, discontinuous, and weighted variants across mathematical modeling contexts.

Applications

Piecewise linear approximation has applications across engineering, computing, and applied mathematics, including:

  • Signal compression and time-series data reduction in sensor networks and embedded systems
  • Mixed-integer linear programming formulations of nonlinear plant models in process optimization
  • Approximation of activation functions and loss surfaces in neural network training
  • GPU-accelerated function evaluation where lookup tables replace expensive nonlinear computations
  • Automatic control systems modeling relay and saturation characteristics in feedback loops
Loading…