Need help for solving an Optimization problem with Nonlinear constraints
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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.
Answers (1)
Alan Weiss
on 6 Aug 2012
Edited: Alan Weiss
on 6 Aug 2012
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
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!