Need help for solving an Optimization problem with Nonlinear constraints

Does someone can help me for the problem below, any answer will be appreciated.
whether the function 'fmincon' or other function in matlab can solve the following problem:
% N
% minimize ∑ {C(i)*V(i)} % objective function
% i=1
% subject to:
% -1 ≤ V(i) ≤ 1;
% 0 ≤ Y(i) ≤ 1;
% 0.6 ≤ Y(N) ≤ 1;
% Y(i+1)-Y(i)=(1-Y(i))*V(i)/20;
%
given Y0=0.3; N=30; vector C is given;
while N is small, like 3 or 4, I can represent Y(3) with Y0,V(1),V(2),V(3). However, when N is big, it's hard to formulate the constrained function.

回答 (1 件)

Alan Weiss
Alan Weiss 2012 年 8 月 6 日
編集済み: Alan Weiss 2012 年 8 月 6 日
It seems to me that your Y vector is a deterministic function of your V vector, and that you minimize over a set of V vectors.
If this is corrrect, you should write a function that gives Y as a function of V, and then write your Y constraints as a set of nonlinear inequalities, and give the V constraints as bounds. Something like the following
function Yout = Ycalc(V)
Yout = zeros(size(V));
Yout(1) = .3 + .7*V(1)/20;
for ii = 2:length(V)
Yout(ii) = Yout(ii-1) + (1-Yout(ii-1))*V(ii)/20;
end
Now that you have this function, write the nonlinear constraints:
-Y(ii)
Y(ii) - 1
Be sure to include both nonlinear equalities and inequalities; see the documentation.
Alan Weiss
MATLAB mathematical toolbox documentation

この質問は閉じられています。

質問済み:

nan
2012 年 8 月 5 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by