File Exchange

image thumbnail


version (230 KB) by Dmitrey Kroshko
nonSmoothSolve (similar to fsolve), non-smooth & noisy local + some global solvers; works in Octave


Updated 21 Jul 2009

View License

OpenOpt is a free MATLAB Toolbox, which is also run in Octave

Particularly, it contains non-smooth solvers
ralg (medium-scale, for nVars=1...1000)
ShorEllipsoid (small-scale, for nVars=1...10)
(both can handle lb, ub, Ax<=b, Aeq*x=beq, c(x)<=0, h(x)=0; providing gradients/sub gradients df, dc, dh is appreciated)

nonSmoothSolve - fsolve analog for nonsmooth & noisy funcs (try benchmarking in nonSmoothSolveEx.m).

Graphics output is also enabled (for Octave users still there are some problems).

2 lines are enough to solve your problem -
prob = ooAssign (ObjFun, x0, <optional params>)
r = ooRun (prob, solver)
Example of output structure r:
xf: [10x1 double] % x final
ff: -0.0719 % fval final
alg: 'Kennedy J., Eberhart R.C. (1995): Particle swarm optimization. In: Proc.'
author: 'Alexandros Leontitsis,, University of Ioannina, Greece'
(+some other fields)

Regrads, Dmitrey. 15.02.2007,
Cherkassy, Ukraine.

P.S. You are welcome to our homepage, where we have provided some more free numerical optimization software (however, non-MATLAB language).

Cite As

Dmitrey Kroshko (2019). OpenOpt (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

Very good. Works out of the box (on R2009b on Win7).

I recommend to start with the following steps:
1) Download and unzip (let's denote the directory <Dir>)
2) execute:
>> addpath(genpath('<Dir>\OpenOpt'))
>> ooexample1
If you see stuff being printed and a constantly changing plot, then installation was sucessfull and OpenOpt works on your PC.
3) Look at the examples to see how to use the toolbox:
>> open ooexample
>> open ooexample1
>> open ooexample2
>> open ooexample3
>> open ooexample4
4) Read documentation in the directory <Dir>\OpenOpt\doc

Yaco Yann

It's very hard to understand. Too many files and no comment

No, documentation is available for Python version only,


Is there further documentation available?

Dmitrey Kroshko

hi all,
I should inform you: some months ago OpenOpt had migrated to Python programming language, and no support and further development for MATLAB/Octave version will be provided.
Thanks all for your comments.
Regards, D.

Emmanuel FARHI

Works like a charm. However, I have a few remarks to improve the package. All suggested methods are available on Matlab Central:
1-a simplex method equivalent to fminsearch would be appreciated, suggesting the State Machine Simplex Minimizer.
2-a Levenberg Marquardt method would also be appreciated, e.g. LMFsolve.
3- a Genetic Algorithm method without constrains would also be nice, especially as GA is provided with the GAconstrain method. The gaevolv could also be good.
4- the powell method seems quite efficient and could be in OpenOpt
5- There are other swam optimizers, such as 'swarm' and 'PSO'. Are they slower/less efficient that the hPSO ?
Finally, thanks for this package. Probably a better documentation would be nice, e.g. regarding the many options in ooAssign, which depend on packages.

Luke Rosenberg

doesn't work at all - everything i tried returned errors! Not enough documentation to work out what was going on. nonSmoothSolve() does not work exactly the same as fsolve.

Paul Strefling

I have been using OpenOpt to solve both smooth and non smooth optimization problems with excellent success. It has outperformed all commertial solvers that I have tried, in both convergence time and optimal solution. It's perfromace is second to none, thank you Dmitery.


OpenOpt 0.35 is reliesed (download- from here, now will contain only pathces & previous OpenOpt versions. If you'll obtain a error "you must pass (size prob.n x 1) vector x to the iterfcn" please download and replace ooIter.m from the URL).

new functions: nonSmoothSolve() & ominsearch(), with same syntax as MATLAB fsolve & fminsearch;

now solver ralg() (non-smooth optimizer, fminsearch() analog, can handle ill-conditioned problems) can handle all types of linear & non-linear constraints:

lb<=x<=ub, A*x<=b, Aeq*x=beq, c(x)<=0, h(x)=0
(and ShorEllipsoid() too)

user-provided gradients/subgradients to constraints prob.dc(), prob.dh() also can be used in ralg;
prob.parallel.f=1 turnes on parallel calculation of objFun (sub)gradient via dfeval() (MDCE, jobmanagers, workers must be properly started). Octave users must provide func with similar to dfeval syntax in
prob.parallel.c & prob.parallel.h will be (I hope) in future OpenOpt version.

+LOTS of minor changes;


-new marker (right-pointing triangle), reporting that MaxTime, MaxCPUTime, MaxIter, MaxFunEvals or etc is exeeded;

-graphic output speed is increased.
(some problems in Octave graphics still remain, but it's because of temporary Octave incompabilities & problems with connecting to gnuplot)

Nas Maleki

OpenOpt is a fantastic Toolbox. Thanks Dmitrey for sharing it.

Dmitrey Kroshko

According to Mathworks rules, we can't update OpenOpt more than once per 2 monthes here. CVS/subversion is also under development.
So currently you can check for latest versions from
now (11/30/06) v 0.16 is available
+/- sign in ooAssign;
bugfix in the end of ooexample.m
new param prob.fEnough is available (solvers will stop if fEnough is reached)
prob.assert() implemented


If any bugs will be obtained, contact via icq 275976670


license changed to BSD

change license from GPL to BSD

bugfix (`Feb2007' undefined near line 4 column 5) while using graphics on

new funcs nonSmoothSolve & ominsearch
ralg (non-smooth,fminsearch analog) can handle: lb<=x<=ub, A*x<=b, Aeq*x=beq, c(x)<=0, h(x)=0
+user (sub)gradients can be used
graphic output speed is increased
+LOTS of minor changes

bugfix (`Feb2007' undefined near line 4 column 5) while using graphics on

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Exhaustive Search Method