Multivariate optimization subject to strange restraint

조회 수: 1 (최근 30일)
Karl
Karl 2015년 4월 25일
답변: Alan Weiss 2015년 4월 27일
Hello, I have a multivariate optimization problem with, with what I think is a strange restraint. Essentially I have a function f(t1,t2,t3,t4,t5,t6) that I want to minimize subject to the constraint that t1+t2+t3+t4+t5+t6 = T. Essentially it's a function of several time points such that the total time must be a constant. Does anyone have any idea on how to do this? I looked into the function fmincon, however it seems like usually it constrains one variable, for example t1, to be some within some bound. I could rewrite t6 = T-t1-t2-t3-t4-t5, which essentially makes it so that t6 is constrained to be a function fo the other choices of t1,t2,t3,t4,t5 (T is a known constant). I guess I'm not sure how to (or if it's possible) to constrain the choice of one variable based on the other variables. Any insight or help would be greatly appreciated.

답변 (1개)

Alan Weiss
Alan Weiss 2015년 4월 27일
This type of constraint is called a linear equality constraint. Assuming that your function f is really a function of the single vector t = [t1,t2,t3,t4,t5,t6], then you use the Aeq and beq arguments in fmincon with
A = ones(1,6);
b = T; % I assume that T is already defined
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Solver 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