As per Gekko documentation, multiple objective functions are summed and an overall objective value is solved for. Does this mean that all objective functions have to have the same dimension or unit (m3 or USD or kg)? If so, is there a way to have multiple objectives with differing units? Also, side question, is there an easy extract the optimal objective value for each objective function (aside from the overall objective value given by the solver)?
Gekko adds the objective functions together into a single objective statement. Gekko doesn't track units so something like Maximize(flow1)
in kg/hr
and Maximize(flow2)
in gm/hr
are not scaled by Gekko. Here is a simple example problem that shows how a multi-objective function statement can be solved:
from gekko import GEKKO
m = GEKKO(remote=False)
x = m.Var()
obj1 = m.Intermediate((x-3)**2)
obj2 = m.Intermediate((x-2)**2)
m.Minimize(obj1)
m.Minimize(obj2)
m.solve(disp=False)
print('Obj Total: ',m.options.OBJFCNVAL)
print('Obj1: ',obj1.value[0])
print('Obj2: ',obj2.value[0])
print('x: ',x.value[0])
The solution is x=2.5
, as expected:
Obj Total: 0.5
Obj1: 0.25
Obj2: 0.25
x: 2.5
The two objectives are added together to create the overall objective.