can anyone show me examples or reviews for constrained nonlinear optimization in Microsoft Solver foundation 3.0? How's it compared to Matlab's fmincon? Or is there any better .net library for constrained nonlinear optimization? thanks,
x = fmincon( fun , x0 , A , b , Aeq , beq , lb , ub ) defines a set of lower and upper bounds on the design variables in x , so that the solution is always in the range lb ≤ x ≤ ub .
Broadly speaking, the constrained nonlinear programming problem involves minimization of a smooth nonlinear function subject to smooth constraints on a finite set of continuous variables. This problem can be stated in several forms whose appropriateness varies with the context.
The sqp algorithm combines the objective and constraint functions into a merit function. The algorithm attempts to minimize the merit function subject to relaxed constraints. This modified problem can lead to a feasible solution.
Microsoft Solver Foundation is set of math tools that allows you to solve some mathematical problems you face in real-world applications.
IMPORTANT UPDATE on Feb 25, 2012:
MSF 3.1 now supports nonlinear optimization with bounded variables via its NelderMeadSolver solver: http://msdn.microsoft.com/en-us/library/hh404037(v=vs.93).aspx
For general linear constraints, Microsoft solver foundation only support linear programming and quadratic programming via its interior point solver. For this solver, please see the SVM post mentioned by Tomas.
MSF has a general nonlinear programming solver, Limited-Memory-BFGS, however which does not support any constraint. This solver also requires an explicit gradient function. For this solver, please see:
Logistic regression in F# using MSF
F# ODSL mentioned by Tomas only supports linear programming. I have a QP extension for it, available at codexplex.
Back to your question - optimize f(x) with linear constraints (similar to fmincon
), I haven't seen any free library which has this ability. NMath.NET (commercial) seems to have one. I tried that for solving a highly nonlinear optimization, but it does not work for me. At last I resorted to B-LBFGS implemented in DotNumerics.
I think you will also be interested in the following SO question:
Open source alternative to MATLAB's fmincon function?
The answers point to SciPy.optimize.cobyla
, which seems to be something similar to fmincon
. But the main message is that for your specific problem, maybe fmincon
is too general. You can use a more specific solver, e.g. LBFGS or QP. Also general solvers sometimes do not work if your initial value is not good.
I don't have much experience with Microsoft Solver Foundation myself, but there is a nice article that demonstrate how to use it from F#:
For F#, there is also an embedded modeling language - this allows you to just write your constraints as ordinary F# expressions (wrapped in quotations) and the interpreter for this language calls Microsoft Solver Foundation with appropriate constraints created (I think this is totally awesome!):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With