Search for Stationary Points of Constrained Nonlinear Function
8 views (last 30 days)
Show older comments
I have a nonlinear function F(x1,x2). I have evaluated analytically the gradient vector of F and also the Hessian matrix. The function, its gradient and Hessian are stored in separate m-files: NUMF, NUMGRAD, and NUMHESS, respectively.
My task now is to perform a search for all stationary points of F subject to the following 3 constraints on x1 and x2 (i.e. within the region bounded by the following inequalities):
x1>=0
x2>=0
x1+x2<=1
Can someone please suggest a suitable optimization/other tool for solving the above problem? I had thought I may be able to use fsolve at various starting points to obtain stationary points one at a time, but I am not sure how and where to specify the constraints.
Thanks for your time,
Dean
3 Comments
Bruno Luong
on 26 Jan 2011
What you have described Walter seems to me a fixed point. A stationary points are point where the gradient is 0 (in large sense), or local optima in a more restrict sense.
Answers (3)
Bruno Luong
on 26 Jan 2011
A generic tool is to solve stationary points is FMINCON. If we know more about objective function, we might orient you towards more appropriate method.
Bruno
2 Comments
Bruno Luong
on 26 Jan 2011
As I wrote earlier, use FMINCON. The stationary points are minimum or maximum under the constraints. The gradient are 0 if no constraint is active, and verifies KKT otherwise.
Walter Roberson
on 26 Jan 2011
If you have the gradient analytically, then if you have the Symbolic Toolkit, you might be able to solve for gradient 0 in terms of one of the two variables (symbolically). You could then find the boundaries of the constraint region.
Not every function is suitable for analytic solutions for 0, of course, but you might find that what the toolbox is able to say about the form of the solutions might narrow the search considerably -- might turn it in to the solution of an expression that is comparatively easy to solve numerically. And if not that, then at least the symbolic toolbox might be able to isolate one of the variables, allowing you to fsolve() against an expression in one variable instead of minimizing in two variables.
0 Comments
John D'Errico
on 26 Jan 2011
I would suggest a completely different approach. How do you define a stationary point? Clearly, this is where both elements of gradient are zero. So simply do TWO contour plots, overlaid on top of each other.
Look for contours of dfdx, where the contour level is zero. Color those lines red.
On top of that plot, overlaid by using hold on, plot a second set of contours perhaps in green, of the function df/dy, again where that operator is zero.
Where red and green lines intersect, this is a solution in that domain. A nice thing is, all solutions will magically appear. The accuracy of the solution is defined by the fineness of the grid used to generate the contour plots.
If you wish to actually find the list of solutions, just generate the contours temselves, using a tool like contourc. Then use a tool off the file exchange that will find intersections of piecewise linear polygonal curves. There are many such tools, but I like the one provided by Doug Schwarz:
Edit: I forgot that your problem is defined on a TRIANGULAR domain. This is easy enough to solve anyway, by defining the upper triangular part of the rectangle to be NaNs when you build the contour plots. Alternatively, I have tools that can work on triangulated domains.
0 Comments
See Also
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!