Multivariate optimization subject to strange restraint
2 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Alan Weiss
on 27 Apr 2015
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
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!