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.
0 个评论
回答(1 个)
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
Alan Weiss
MATLAB mathematical toolbox documentation
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!