フィルターのクリア

About optimization tool box question

4 ビュー (過去 30 日間)
Ho Chun
Ho Chun 2015 年 3 月 11 日
コメント済み: Karthikeyan Nainar 2019 年 1 月 16 日
How can I do so that the summation in the constraint can be applied in the fmincon function which used in optimization tool box?
Plz, help and thanks a lot!!
  1 件のコメント
Ho Chun
Ho Chun 2015 年 3 月 14 日
Thanks for all your help!!
Re: Johan Löfberg
Does the CVX mean convex optimization? If I use that tool, is there any suggestion where I can get the tool cuz I only get Matlab. BTW, how can I apply the constraint in CVX? For example, how to apply the summation in the CVX. Thanks for your help!

サインインしてコメントする。

回答 (5 件)

Alan Weiss
Alan Weiss 2015 年 3 月 11 日
I am not sure that I understand the difference between p_i and p_i^h. But the constraints look like bounds and linear equality constraints.
Alan Weiss
MATLAB mathematical toolbox documentation

John D'Errico
John D'Errico 2015 年 3 月 11 日
What confuses me is that if p_i is in the interval [0,1] then usually p_i^h (assuming that is a power we are talking about) is also in that interval. So those bound constraints all reduce to the simple
0 <= p_i <= 1
Again, this assumes that p_i^h is p_i raised to the power h. I suppose that superscript might be defined in any way you like, but if you want us to understand mathematics, then you need to either let us assume that your notation is consistent with standard mathematical notation, or tell us how it is not.
Next, the first equality constraint does not seem to be linear, since it also has powers of the p_i in the sum.
Finally, we don't know what values M and H take on, but there are apparently M unknowns to search over, but we see M+H equality constraints. And that ignores the bound constraints. This is a recipe for a situation with no possible solutions that satisfy the equality constraints.

Johan Löfberg
Johan Löfberg 2015 年 3 月 12 日
Looks like a QP to me (i.e., you should not use fmincon, but quadprog, or some other quadratic programming solver)
You have two sets of variables, the vector p, and a matrix P (the one you index with i and h). You have bound constraints on all elements in P, the equality p = P*q and sum of rows equals 1, sum(P,1)=1. To get this into a numerical format for quadprog, you have to introduce a vectorized notation where your decision variables are x =[p;P(:)], and then simply write all constraints in terms of this vector.
Alternatively, you can use a MATLAB based modelling layer such as YALMIP or CVX. Here is the YALMIP code to solve the problem
p = sdpvar(M,1);
P = sdpvar(M,H,'full');
Constraints = [p == P*q, 0 <= P <= 1, sum(P,1) == 1];
Objective = p'*p;
optimize(Constraints,Objective)
value(p)
value(P)
  5 件のコメント
Johan Löfberg
Johan Löfberg 2015 年 3 月 15 日
Precisely as the code I gave. To minimize Objective subject to Constraints, you do optimize(Constraints,Objective)
Please study the YALMIP Wiki with all the examples and tutorials
Karthikeyan Nainar
Karthikeyan Nainar 2019 年 1 月 16 日
The equality sum(P,1)=1 looks like sum of columns and not rows.

サインインしてコメントする。


Ho Chun
Ho Chun 2015 年 3 月 14 日
編集済み: Ho Chun 2015 年 3 月 14 日
Thanks for all your help!!
Re: Johan Löfberg
Does the CVX mean convex optimization? If I use that tool, is there any suggestion where I can get the tool cuz I only get Matlab. BTW, how can I apply the constraint in CVX? For example, how to apply the summation in the CVX. Thanks for your help!

Ho Chun
Ho Chun 2015 年 3 月 14 日
BTW, M is a user input value, which can be 3 or 5. H can be 20.

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by