Hello everyone.(adsbygoogle = window.adsbygoogle || []).push({});

I would like to hear some suggestions on minimizing a function.

I have discrete 2D function (a grid, where each (x,y) point have some value), where I know only extreme points (more specifically - ridges. http://en.wikipedia.org/wiki/Ridge_detection).

I want to reconstruct this function just from these points by minimizing "smoothness function" (or cost function?).

My smoothness function looks like this:

for all points (x, y) in the grid (of course in border and corner points it's (3*f(x, y) - ...)^2 and (2*f(x, y) - ...)^2 ).Code (Text):sum[ ( 4*f(x,y) - f(x-1,y) - f(x+1,y) - f(x,y-1) - f(x, y+1) )^2 ]

I use fmincon by passing all extreme point values (as a vector) and upper and lower bounds. It works good and converges very good, but it takes much too long on minimizing grids that are bigger than 100x100.

Providing outside defined gradient and Hessian seems to help to converge, but runtime gets even much greater due to the many calculations.

I also use use sparse matrices and set Hessian to 'lbfgs', but it helps to certain size.

Any suggestions on how to make it run faster?

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 2D discrete function minimization if extreme points are known, using Matlab

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - discrete function minimization | Date |
---|---|

Mathematica How to add legends with 6 or more discrete entries? | Mar 6, 2018 |

3D Diffusion Equation in MATLAB | Jan 21, 2016 |

DFT matlab help | May 26, 2015 |

Discrete Fourier Transforms without using FFT function | Nov 5, 2011 |

Integrating a Discrete Function in MATLAB | Oct 5, 2011 |

**Physics Forums - The Fusion of Science and Community**