I need a nonlinear solver for optimizing a given function. I tried the inbuilt solvers for Excel and OpenOffice. The problem is Excel gives me only the local maximal and not the global one. OpenOffice has a very small step and take too much time.
I'll give a try to Matlab's "Global Optimization Toolbox". I dont know if it could take more than 2 variables.
Please if you know a good solver/optimizer gimme a shout. Thanks in advance

Hi Trepatch,

The general answer is that no nonlinear solver can give you the global optimum. Most nonlinear solvers will give you a local optimum. In theory you could combine with some sort of generic algorithm, which would increase your chances of finding the global optimum (which is what I suspect Matlab does).

However, it would be easier to answer your question if you told us more about the function. It could for example be that the function is a concave/convex function, in which case a nonlinear solver will give you the global optimum.

Cheers,
Erik

Thank you for the answer, Erik. I dont know what a concave/convex function is, since min(f)==max(-f). The thing is, my function have a multiple extremes and I dont know how much exactly. There are more than 20 variables in it.

All the tutorials I've seen for MatLab are with one or two variables. How can I pass more into the MatLab function?

Hi again,

You can have as many variables you want with Matlab's toolbox. If you for example wants modify the "Example: Nonlinear Constrained Minimization" to take a function with 20 variables what you do is:

function f = rosenbrock(x)
f = sum(x.^2); // Minimised the sum of the squared elements in the vector x.

If you use gradients this function must also be adjusted:

function gradient = dfdx(x)
gradient = 2*x; // gradient(i) = 2*x(i)

Finally, the starting point must be set to something like:

[0 0 0 0 0 0 0 0 0 0 0 0 0 ....] or zeros(1,20)

Cheers,
Erik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.