Code covered by the BSD License  

Highlights from
Table Breakpoint Optimization

4.33333

4.3 | 3 ratings Rate this file 44 Downloads (last 30 days) File Size: 605 KB File ID: #35194
image thumbnail

Table Breakpoint Optimization

by

 

04 Apr 2012 (Updated )

A set of tools for finding the best way to reduce the size of a table.

| Watch this File

File Information
Description

These tools find the best way to reduce the size of a table, given either the desired number of points or the maximum tolerable error. The resulting table allows faster interpolation and requires less memory.

Specifically, given an input 1D, 2D, or n-D table and a desirable number of breakpoints (or allowable mean squared error), these functions will calculate the best placement of the breakpoints to fit the input table. The user can specify how the table values should be interpolated using linear, spline, nearest methods, etc. The breakpoints, new table, and mean squared error of the fit are returned.

The optimal placement of breakpoints is taken to be the placement resulting in the minimum mean squared error of the new table evaluated at the original table's breakpoints with the specified interpolation scheme. For regularly sampled input tables, this acts as an integral of error over the table's area. This allows irregular sampling of the original table to focus on critical (e.g., rapidly changing) areas of the table.

To get started, either load the app and click "Help", enter "TableOptimizerGui" at the command prompt, or see find_best_table_demo.pdf.

Requires the Optimization Toolbox(TM).
Supports (but does not require) the Parallel Computing Toolbox(TM).
Generating Simulink(TM) lookup tables (Simulink is not required for normal operation)

Acknowledgements

Optimizing Breakpoints For Tables inspired this file.

This file inspired Natural Gas Storage Valuation.

Required Products Optimization Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
18 Nov 2014 ing-electrica electrica  
10 Jul 2014 Ameya Deoras

Excellent! Works great for approximating a curve with piecewise linear functions

06 Dec 2013 ths1104 Stenkhiste

Great code!

I am looking at find_best_table_1de. I have two comments:

(a) It seems there is a problem with max_iterations. Lets say we have length(x_0)=10. So max_iterations=10. In the first while loop, n_x could increase up to 3*2^10 = 3072. This is much higher than length(x_0)! The loop should stop when n_x>=length(x_0).

(b) Why dont you start directly the dichotomie using
n_x_left = 3;
n_x_right = length(x_0);
? This looks simpler because you can get ride of the first while loop.

Updates
25 Jun 2012

Tweak for improvements to stability in certain cases.

06 Aug 2012

Added ability to automatically find the smallest table satisfying a given mean squared error tolerance. Also added stability improvements.

20 Aug 2012

Added GUI

12 Sep 2012

Updated file to include as an App for R2012b

25 Apr 2013

Added n-dimensional table support and significant speed improvements.

Contact us