Multi-Objective Optimization

Main.MultiObjectiveOptimization History

Hide minor edits - Show changes to output

November 17, 2021, at 12:57 AM by 10.35.117.248 -
Changed lines 108-111 from:
ax[0].plot(m.time,results['s.tr_hi'],'r-.',linewidth=2)
ax[0].plot(m.time,results['y.tr_hi'],'b:',linewidth=2)
ax[0].plot(m.time,results['z.tr_hi'],'--',color='orange',linewidth=2)
ax[0].plot(m.time,results['z'],'k-',linewidth=3)
to:
ax[0].plot(m.time,results['s.tr_hi'],'r-.',lw=2)
ax[0].plot(m.time,results['y.tr_hi'],'b:',lw=2)
ax[0].plot(m.time,results['z.tr_hi'],'--',color='orange',lw=2)
ax[0].plot(m.time,results['z'],'k-',lw=3)
Changed lines 115-117 from:
ax[0].plot(m.time,results['z.tr_lo'],'--',color='orange',linewidth=2)
ax[0].plot(m.time,results['y.tr_lo'],'b:',linewidth=2)
ax[0].plot(m.time,results['s.tr_lo'],'r-.',linewidth=2)
to:
ax[0].plot(m.time,results['z.tr_lo'],'--',color='orange',lw=2)
ax[0].plot(m.time,results['y.tr_lo'],'b:',lw=2)
ax[0].plot(m.time,results['s.tr_lo'],'r-.',lw=2)
Changed line 120 from:
ax[1].plot(m.time,u.value,'b-',linewidth=2)
to:
ax[1].plot(m.time,u.value,'b-',lw=2)
Deleted lines 18-19:
%width=550px%Attach:multiobjective_gekko.png
Added lines 128-129:

%width=550px%Attach:multiobjective_gekko.png
March 15, 2019, at 06:34 PM by 10.35.117.63 -
Added lines 18-129:

%width=550px%Attach:multiobjective_gekko.png

(:toggle hide gekko button show="Show Python GEKKO Source":)
(:div id=gekko:)
(:source lang=python:)
from gekko import GEKKO
import numpy as np
import matplotlib.pyplot as plt

m = GEKKO()
m.time = np.linspace(0,10,101)
 
# Dynamic control options
m.options.IMODE = 6
m.options.CV_TYPE = 1
m.options.MV_TYPE = 0
m.options.SOLVER = 3
m.options.MV_STEP_HOR = 1
m.options.NODES = 3

#Define Manipulated Variables
u = m.MV(name='u')
 
#Define Controled Variables
y = m.CV(1,name='y')
z = m.CV(1,name='z')
s = m.CV(1,name='s')
 
# Environmental Constraint
#setup CV
# tau is the speed of the CV response, 0=step, 1 = 63.2# of the way
#  to the new setpoint in 1 sec, only if tr_init is 1 or 2.
# with tr_init=0, it is just a pure dead-band
# specifying the speed to get to the set point
# get to 63.2# of sp withing tau seconds
y.TAU = 5
y.STATUS = 1
y.TR_INIT = 2
y.SPHI = 5
y.SPLO = 4
y.FSTATUS = 0
y.WSPHI = 100
y.WSPLO = 100
 
# Operational Constraint
z.TAU = 4
z.STATUS = 1
z.TR_INIT = 2
z.SPHI = 7
z.SPLO = 6
z.FSTATUS = 0
z.WSPHI = 50
z.WSPLO = 50
 
# Safety Constraint
s.TAU = 10
s.STATUS = 1
s.TR_INIT = 2
s.TR_OPEN = 3
s.SPHI = 11
s.SPLO = 10
s.FSTATUS = 0
s.WSPHI = 200
s.WSPLO = 200

#setup MV (u)
u.STATUS = 1
u.DCOST = 0
u.LOWER = 0
u.UPPER = 1000
u.COST = 0

# process model
tau = 1
K = 3
m.Equation(tau*y.dt()+y==u)
m.Equation(z==y)
m.Equation(s==y)

# solve problem
m.solve(disp=True)

# get additional solution information
import json
with open(m.path+'//results.json') as f:
    results = json.load(f)

# create plot
p, ax = plt.subplots(nrows=2, ncols=1, \
                    gridspec_kw={'height_ratios':[3,1]})

ax[0].plot(m.time,results['s.tr_hi'],'r-.',linewidth=2)
ax[0].plot(m.time,results['y.tr_hi'],'b:',linewidth=2)
ax[0].plot(m.time,results['z.tr_hi'],'--',color='orange',linewidth=2)
ax[0].plot(m.time,results['z'],'k-',linewidth=3)
ax[0].legend(['Priority 1: Safety Constraint',\
            'Priority 2: Environmental Constraint',\
            'Priority 3: Economic Constraint','Response'],loc=4)
ax[0].plot(m.time,results['z.tr_lo'],'--',color='orange',linewidth=2)
ax[0].plot(m.time,results['y.tr_lo'],'b:',linewidth=2)
ax[0].plot(m.time,results['s.tr_lo'],'r-.',linewidth=2)
ax[0].set_ylabel('Pressure (bar)')

ax[1].plot(m.time,u.value,'b-',linewidth=2)
ax[1].legend(['Manipulated Variable'])
ax[1].set_ylabel('MV')
ax[1].set_xlabel('Time (min)')

plt.show()
(:sourceend:)
(:divend:)
March 17, 2016, at 11:39 PM by 10.10.145.111 -
Added lines 20-23:

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/JlMVZmGgjDY" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
March 17, 2016, at 09:56 PM by 10.5.113.114 -
Changed line 13 from:
[[Attach:multi-objective_control.pdf|Multiple Objectives]]
to:
Attach:download.png [[Attach:multi-objective_control.pdf|Multiple Objectives Exercise (pdf)]]
March 17, 2016, at 09:55 PM by 10.5.113.114 -
Added lines 4-13:

Many optimization problems have multiple competing objectives. These competing objectives are part of the trade-off that defines an optimal solution. Sometimes these competing objectives have separate priorities where one objective should be satisfied ''before'' another objective is even considered. This especially arises in model predictive control or other types of dynamic optimization problems. There are competing objectives with a ranked hierarchy. The highest level objectives are satisfied first followed by lower ranked objectives if there are additional degrees of freedom available. The l1-norm objective is a natural way to explicitly rank objectives and simultaneously optimize multiple priorities with a single optimization problem.

!!!! Exercise

Consider examples of safety, environmental, and economic constraints or objectives. Which are most important and why?

For the following multi-objective optimization problem, sketch a possible optimal trajectory.

[[Attach:multi-objective_control.pdf|Multiple Objectives]]
March 17, 2016, at 09:49 PM by 10.5.113.114 -
Added lines 4-5:

Attach:multi-objective_control.png
March 16, 2016, at 04:55 PM by 10.5.113.210 -
Added lines 1-7:
(:title Multi-Objective Optimization:)
(:keywords multiple objectives, Python, MATLAB, Simulink, nonlinear control, model predictive control:)
(:description Multiple objectives are simultaneously optimized to follow the highest priority objectives:)

!!!! Solution

Attach:download.png [[Attach:multi-objective_control.zip|Multi-Objective Model Predictive Control]]