finding intersection of between surfaces and extended to n dimensions
2 次查看(过去 30 天)
显示 更早的评论
Hi there,
if given a main objective function (non-linear) f(x,y) and constraints (non-linear) g1(x,y)=C1 g2(x,y)=C2 ... gn(x,y)=Cn
I can plot contours of of all the above and find the intersection visually. What mathematical technique can I use to extract a matrix that has the points of all intersections between all the surfaces? I need something that is general to extend to from 1 to n dimensions if my functions have n design variables and n design constraints.
Thanks,
0 个评论
采纳的回答
John D'Errico
2015-1-24
A bit confusing here. You tell us about an objective function, but then tell us nothing about what you will do with it. Then you start talking about intersections between a set of constraint functions.
Anyway, it is not possible for several reasons. At least not as you describe. You are apparently asking for a general solution of n nonlinear equations in n unknowns.
- There many be a finite number of solutions, no solutions at all, or even an infinite number.
- Since the functions are nonlinear, they may be arbitrarily nasty. No technique can exist that will return the locus of all solutions to a general nonlinear problem.
There is no magical method that will do what you want.
2 个评论
John D'Errico
2015-1-25
With ONE constraint, in two dimensions, this becomes a simple problem, almost trivial.
- contourc returns a piecewise linear polygon that represents the desired contour of your constraint function, in (x,y). A single constraint of the form g1(x,y)=C1 will return what is essentially a path embedded in the (x,y) plane. Be careful here, since that contour may actually be several disjoint polygons. For example, a given contour may be several roughly circular polygons, that are completely disjoint.
- Given a single contour polygon, evaluate the objective function f(x,y) along that path in the (x,y) plane. Choose the point which yields the mininum value of the objective function along the polygon. You can use my tool interparc to generate additional points along the polygon. Again, since the contour polygon may be several disjoint segments, you may need to do this step several times. You can find interparc on the file exchange.
You should find that this works quite reasonably well, and would be quite doable in an automatic sense. Of course, it requires you generate an initial grid, on which to evaluate the function to generate that contour polygon (or set of polygons.)
The fine-ness of that initial grid will help to determine how accurately you can find that starting point. In fact, arguably one could completely eliminate the fmincon step, if you built a sufficiently fine grid. You could eliminate the call to fmincon, just taking the best point along the interpolated contour. Or just use fzero, then minimizing the parametric function f(x(t),y(t)) along the interpolated contour path.
Since interparc offers spline approximations to such a path (as long as it is a SINGLE path, not a disjoint set of them) you could then use fzero to minimize the function f(x(t),y(t)) along the smoothly interpolated path(s). Again, if there were multiple local solutions, these would be seen as separate local minima, so subject to the start point along each path.
In higher dimensions, then with potentially multiple constraints, this will get messy. I only claimed it would be easy for the simple case. Although it is POSSIBLE to do similar things in say 3 dimensions or even higher than that, the necessary slicing operations get harder to do. As well, evaluating a list of functions on complete grids in say 6 or 7 dimensions, then doing the slicing will get EXTREMELY computationally expensive. This is what I often refer to as the curse of dimensionality. Things get exponentially complicated, and that happens FAST as the number of dimensions rises.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!