How to constrain distance between points in optimization?
5 ビュー (過去 30 日間)
古いコメントを表示
For example in the matlab problem of placing 10 electrons:
In a similar problem I want to constrain the minimum distance between electrons to 0.1. Would you know how to do that with elecprob.Constraints.spherec?
Thank you very much for your time
2 件のコメント
Alan Weiss
2020 年 3 月 29 日
I'm sorry, but I do not understand your constraint. Are you constraining the minimum distance between any pair of electrons to be greater than 0.1? Or the maximum distance to be 0.1? Or that all electrons are exactly 0.1 distance away from each other? Or that some particular pairs of electrons are exactly 0.1 distance from each other?
Alan Weiss
MATLAB mathematical toolbox documentation
採用された回答
Matt J
2020 年 3 月 29 日
編集済み: Matt J
2020 年 3 月 30 日
It can be set up this way, but keep in mind that this is a highly non-convex feasible set. It may be challenging to find a global optimum.
IJ=nchoosek(1:N,2); I=IJ(:,1); J=IJ(:,2);
elecprob.Constraints.MinDist=(x(I)-x(J)).^2+(y(I)-y(J)).^2 +(z(I)-z(J)).^2 >=0.1^2;
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Nonlinear Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!