Maximizing two functions simultanously
Show older comments
Hi everyone,
I am a bit stuck and don't really know where to start. I want to maximize two independent objective functions given by
(1) Max x - b(z(1)+z(2)-s3)^2 s.t. x,z(1) >= 0 and (1-alpha) = z(1) + x
(2) Max y - b(z(1)+z(2)-s3)^2 s.t. y,z(2) >= 0 and alpha = z(2) + y
Equation (1) should be maximized wrt x and z(1), and Equation (2) wrt y and z(2). b, s3 and alpha are parameters. (I know I can calculate this specific function by hand - but I am going to make it more complicated and then it is much more difficult to calculate by hand!).
Any ideas about where to start?
Thanks!
Answers (2)
Walter Roberson
on 5 Jul 2016
It looks like a job for fmincon() with lower bounds and with linear equality constraints
I would suggest, though, that you eliminate z(1) and z(2) from the equation by rewriting:
(1-alpha) = z(1) + x implies z(1) = 1 - alpha - x
alpha = z(2) + y implies z(2) = alpha - y
so
b*(z(1)+z(2)-s3)^2 = b*(1 - alpha - x + alpha - y - s3)^2 = b*(1 - x - y - s3)^2
and then impose constraints to ensure that the appropriate values are non-negative. For example z(1) = 1 - alpha - x implies that x has an upper bound of 1 - alpha, and x >= 0 gives a lower bound for x of 0. Likewise y has an upper bound of alpha and a lower bound of 0.
You did say you want to maximize and fmincon is a minimizer, so use the old trick that to maximize a function, minimize the negative of the function.
1 Comment
charlotte88
on 5 Jul 2016
QUADPROG would be the most appropriate optimizer given the form of your functions.
However, it's not quite clear why you consider your objective functions "independent". In particular, z(1) and z(2) appear in both. If you are maximizing wrt z(1) in the first objective, what determines its value in the second objective? Are they completely different variables that have simply been labeled the same?
If the objectives truly are independent, just apply QUADPROG to each one separately. Otherwise, I don't think the problem is well-defined. However, maybe what you really want is to maximize the sum of these objectives, or equivalently to minimize,
min. 2*b*(z(1)+z(2)-s3)^2 - x- y
subject to all the constraints you posted. Here again, QUADPROG would apply.
4 Comments
charlotte88
on 5 Jul 2016
John D'Errico
on 5 Jul 2016
Edited: John D'Errico
on 5 Jul 2016
But z(1) is NOT decided in the first. It is part of the second also, and you cannot optimize one problem without doing the other at the same time. Likewise, z(2) is a part of both objectives.
So optimize the sum.
Torsten
on 5 Jul 2016
My guess is that Charlotte is looking for Pareto-optima:
Best wishes
Torsten.
Walter Roberson
on 5 Jul 2016
Pareto was what came to mind for me as well.
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!