Multivariate optimization subject to strange restraint

2 次查看(过去 30 天)
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