OCP Benchmarks

Main.MoreDynamicOptimizationBenchmarks History

Hide minor edits - Show changes to output

March 27, 2023, at 05:52 PM by 10.35.117.248 -
Added lines 33-34:
%width=300px%Attach:drone_flight.png
Added lines 39-40:
%width=300px%Attach:hanging_chain.png
Added lines 45-46:
%width=300px%Attach:integral_objective_Luus.png
Added lines 51-52:
%width=300px%Attach:economic_optimization.png
Added lines 57-58:
%width=300px%Attach:jennings.png
Added lines 62-63:

%width=300px%Attach:oil_shale_pyrolysis.png
March 27, 2023, at 05:43 PM by 10.35.117.248 -
Changed line 21 from:
%width=550px%Attach:batch_reactor.png
to:
%width=300px%Attach:batch_reactor.png
March 27, 2023, at 05:42 PM by 10.35.117.248 -
Added lines 20-21:

%width=550px%Attach:batch_reactor.png
March 27, 2023, at 05:41 PM by 10.35.117.248 -
Added lines 24-25:

%width=300px%Attach:bryson_denham.png
March 27, 2023, at 05:38 PM by 10.35.117.248 -
Added lines 14-15:

%width=300px%Attach:aircraft.png
March 26, 2023, at 01:28 PM by 136.36.4.38 -
Added lines 10-13:

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/AircraftControl|Aircraft Control]]
March 26, 2023, at 04:34 AM by 136.36.4.38 -
Added lines 18-21:

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/DroneFlight|Drone Flight]]
March 26, 2023, at 04:17 AM by 136.36.4.38 -
Added lines 34-37:

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/OilShalePyrolysis|Oil Shale Pyrolysis]]
March 26, 2023, at 03:26 AM by 136.36.4.38 -
Added lines 5-6:
Optimal Control Problem (OCP) solvers are a powerful tool for designing control strategies that optimize a given objective function subject to constraints. They are widely used in engineering, economics, finance, and management, and are applied to a wide range of problems to find optimal solutions that minimize costs, maximize profits, reduce risk, or achieve other desired outcomes. The control strategy is typically represented as a function of time that maps the control input (manipulated variable) to the state of the system. The state of the system is determined by a set of differential equations, and the objective function is a measure of the system performance over a time horizon.
Changed line 9 from:
'''Objective:''' Set up and solve several optimal control problem (OCP) benchmarks. Create a program to optimize and display the results. ''Estimated Time (each): 30 minutes''
to:
'''Objective:''' Set up and solve several OCP benchmarks. Create a program to optimize and display the results. ''Estimated Time (each): 30 minutes''
March 26, 2023, at 03:11 AM by 136.36.4.38 -
Added lines 16-19:

----

!!!! [[Main/HangingChain|Hanging Chain]]
March 26, 2023, at 03:10 AM by 136.36.4.38 -
Changed line 1 from:
(:title Optimal Control Benchmark Problems II:)
to:
(:title OCP Benchmarks:)
Changed line 7 from:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program to optimize and display the results. ''Estimated Time (each): 30 minutes''
to:
'''Objective:''' Set up and solve several optimal control problem (OCP) benchmarks. Create a program to optimize and display the results. ''Estimated Time (each): 30 minutes''
March 26, 2023, at 03:09 AM by 136.36.4.38 -
Changed line 103 from:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Catalyzed Reaction Optimized in MATLAB and Python]] and [[https://youtu.be/jB7WWGHFNIw|Video]]
to:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Catalyzed Reaction Optimized in MATLAB]] and [[https://youtu.be/jB7WWGHFNIw|Video]]
March 26, 2023, at 03:08 AM by 136.36.4.38 -
Changed lines 36-37 from:
Attach:download.png [[Attach:dynamic_optimization_alychan.zip|Dynamic Optimization Aly-Chan Solution in MATLAB and Python]]
to:
Attach:download.png [[Attach:dynamic_optimization_alychan.zip|Dynamic Optimization Aly-Chan Solution in MATLAB]] and [[https://youtu.be/tY8kyJq4BEY|Video]]
Deleted lines 90-93:
(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/tY8kyJq4BEY" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

Changed lines 95-100 from:
Attach:download.png [[Attach:dynamic_optimization_aly.zip|Aly Singular Control Solution in MATLAB and Python]]

(
:html:)
<iframe width="560" height="315" src="https:
//www.youtube.com/embed/cd0TkFtXfWs" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

to:
Attach:download.png [[Attach:dynamic_optimization_aly.zip|Aly Singular Control Solution in MATLAB]] and [[https://youtu.be/cd0TkFtXfWs|Video]]
Changed lines 103-107 from:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Catalyzed Reaction Optimized in MATLAB and Python]]

(
:html:)
<iframe width="560" height="315" src="https:
//www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
to:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Catalyzed Reaction Optimized in MATLAB and Python]] and [[https://youtu.be/jB7WWGHFNIw|Video]]
March 26, 2023, at 03:02 AM by 136.36.4.38 -
Added lines 11-30:
!!!! [[https://apmonitor.com/wiki/index.php/Apps/BatchReactor|Batch Reactor]]

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/BrysonDenhamProblem|Bryson-Denham Problem]]

----

!!!! [[Main/IntegralObjective|Integral Objective (Luus)]]

----

!!!! [[Main/EconomicDynamicOptimization|Maximize Profit (Commercial Fishery)]]

----

!!!! [[Main/MinimizeFinalTime|Minimize Final Time (Jennings)]]

----

Deleted lines 115-134:

----

!!!! [[Main/EconomicDynamicOptimization|Maximize Profit (Commercial Fishery)]]

----

!!!! [[Main/MinimizeFinalTime|Minimize Final Time (Jennings)]]

----

!!!! [[Main/IntegralObjective|Integral Objective (Luus)]]

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/BrysonDenhamProblem|Bryson-Denham Problem]]

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/BatchReactor|Batch Reactor]]
March 25, 2023, at 11:46 PM by 136.36.4.38 -
Added lines 112-115:

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/BatchReactor|Batch Reactor]]
November 17, 2021, at 12:55 AM by 10.35.117.248 -
Changed lines 58-60 from:
plt.plot(m.time,x1.value,'k:',LineWidth=2,label=r'$x_1$')
plt.plot(m.time,x2.value,'b-',LineWidth=2,label=r'$x_2$')
plt.plot(m.time,x2.value,'k-',LineWidth=2,label=r'$x_3$')
to:
plt.plot(m.time,x1.value,'k:',lw=2,label=r'$x_1$')
plt.plot(m.time,x2.value,'b-',lw=2,label=r'$x_2$')
plt.plot(m.time,x2.value,'k-',lw=2,label=r'$x_3$')
Changed lines 62-63 from:
plt.plot(m.time,u.value,'r--',LineWidth=2,label=r'$u$')
plt.plot(t,-np.sin(t),'k:',LineWidth=2,label='Exact')
to:
plt.plot(m.time,u.value,'r--',lw=2,label=r'$u$')
plt.plot(t,-np.sin(t),'k:',lw=2,label='Exact')
May 15, 2021, at 05:02 AM by 136.36.4.38 -
Changed line 1 from:
(:title More Optimal Control Problems:)
to:
(:title Optimal Control Benchmark Problems II:)
June 21, 2020, at 02:01 PM by 136.36.211.159 -
Added lines 116-117:

# Beal, L.D.R., Hill, D., Martin, R.A., and Hedengren, J. D., ''GEKKO Optimization Suite'', Processes, Volume 6, Number 8, 2018, doi: 10.3390/pr6080106. [[https://www.mdpi.com/2227-9717/6/8/106|Article]]
June 21, 2020, at 02:01 PM by 136.36.211.159 -
Changed lines 7-8 from:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program as shown in reference [1] to optimize and display the results. ''Estimated Time (each): 30 minutes''
to:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program to optimize and display the results. ''Estimated Time (each): 30 minutes''
Changed line 12 from:
* Solve the following nonlinear and constrained problem as shown in reference [2].
to:
* Solve the following nonlinear and constrained problem.
June 21, 2020, at 02:00 PM by 136.36.211.159 -
Changed lines 7-8 from:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program'^1^' to optimize and display the results. ''Estimated Time (each): 30 minutes''
to:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program as shown in reference [1] to optimize and display the results. ''Estimated Time (each): 30 minutes''
Changed lines 11-12 from:
!!!! Aly-Chan Singular Control Problem'^2^'
* Solve the following nonlinear and constrained problem.
to:
!!!! Aly-Chan Singular Control Problem
* Solve the following nonlinear and constrained problem as shown in reference [2].
June 21, 2020, at 01:59 PM by 136.36.211.159 -
Added lines 108-111:

----

!!!! [[https://apmonitor.com/wiki/index.php/Apps/BrysonDenhamProblem|Bryson-Denham Problem]]
March 08, 2018, at 02:24 PM by 45.56.3.173 -
Changed line 99 from:
!!!! [[Main/EconomicDynamicOptimization|Commercial Fishery]]
to:
!!!! [[Main/EconomicDynamicOptimization|Maximize Profit (Commercial Fishery)]]
March 07, 2018, at 06:55 PM by 10.37.83.132 -
Changed lines 99-105 from:
!!!! Commercial Fishery

Attach:download.png [[Attach:dynamic_optimization_fishery.zip|Economic Optimization of Fishery in MATLAB and Python
]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
to:
!!!! [[Main/EconomicDynamicOptimization|Commercial Fishery]]
Changed lines 109-115 from:
!!!! Jennings Problem

Attach:download.png [[Attach:dynamic_optimization_jennings.zip|Jennings Problem in MATLAB and Python
]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
to:
!!!! [[Main/MinimizeFinalTime|Minimize Final Time (Jennings)]]
Added lines 17-69:

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

m = GEKKO()

nt = 1001
t = np.linspace(0,np.pi/2,nt)
m.time = t

# Variables
x1 = m.Var(value=0)
x2 = m.Var(value=1)
x3 = m.Var(value=0)

u = m.MV(value=0,ub=1,lb=-1)
u.STATUS = 1
u.DCOST = 0

p = np.zeros(nt)
p[-1] = 1.0
final = m.Param(value=p)

# Equations
m.Equation(x1.dt()==x2)
m.Equation(x2.dt()==u)
m.Equation(2*x3.dt()==x2**2-x1**2)

# Objective Function
m.Obj(x3*final)

m.options.IMODE = 6
m.options.NODES = 4
m.solve()

plt.figure(1)
plt.subplot(2,1,1)
plt.plot(m.time,x1.value,'k:',LineWidth=2,label=r'$x_1$')
plt.plot(m.time,x2.value,'b-',LineWidth=2,label=r'$x_2$')
plt.plot(m.time,x2.value,'k-',LineWidth=2,label=r'$x_3$')
plt.subplot(2,1,2)
plt.plot(m.time,u.value,'r--',LineWidth=2,label=r'$u$')
plt.plot(t,-np.sin(t),'k:',LineWidth=2,label='Exact')
plt.legend(loc='best')
plt.xlabel('Time')
plt.ylabel('Value')
plt.show()
(:sourceend:)
(:divend:)
Added lines 1-4:
(:title More Optimal Control Problems:)
(:keywords nonlinear control, optimal control, dynamic optimization, engineering optimization, MATLAB, Python, GEKKO, differential, algebraic, modeling language, university course:)
(:description More optimal control problems solved with Dynamic Optimization in MATLAB and Python.:)

Changed line 3 from:
'''Objective:''' Set up and solve several [[Attach:Dynamic_Optimization_Benchmarks.pdf|dynamic optimization benchmark problems]]. Create a program'^1^' to optimize and display the results. ''Estimated Time (each): 30 minutes''
to:
'''Objective:''' Set up and solve several optimal control benchmark problems. Create a program'^1^' to optimize and display the results. ''Estimated Time (each): 30 minutes''
Changed lines 62-68 from:
!!!! Luus Problem

Attach:download.png [[Attach:dynamic_optimization_luus.zip|
Luus Problem in MATLAB and Python]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/WIe31dTaW6g" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
to:
!!!! [[Main/IntegralObjective|Integral Objective (Luus)]]
February 10, 2016, at 07:04 AM by 174.148.96.184 -
Changed line 67 from:
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
to:
<iframe width="560" height="315" src="https://www.youtube.com/embed/WIe31dTaW6g" frameborder="0" allowfullscreen></iframe>
February 10, 2016, at 06:39 AM by 174.148.96.184 -
Added lines 55-64:

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

----

!!!! Luus Problem

Attach:download.png [[Attach:dynamic_optimization_luus.zip|Luus Problem in MATLAB and Python]]
February 10, 2016, at 06:36 AM by 174.148.96.184 -
Changed line 57 from:
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
to:
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
February 10, 2016, at 06:11 AM by 174.148.96.184 -
Changed lines 34-35 from:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Dynamic Optimization Catalyst Solution in MATLAB and Python]]
to:
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Catalyzed Reaction Optimized in MATLAB and Python]]
Changed lines 44-45 from:
Attach:download.png [[Attach:dynamic_optimization_fishery.zip|Dynamic Optimization Fishery Solution in MATLAB and Python]]
to:
Attach:download.png [[Attach:dynamic_optimization_fishery.zip|Economic Optimization of Fishery in MATLAB and Python]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

----

!!!! Jennings Problem

Attach:download.png [[Attach:dynamic_optimization_jennings.zip|Jennings Problem in MATLAB and Python]]
February 10, 2016, at 12:59 AM by 174.148.92.107 -
Deleted line 10:
->Attach:dynopt_alychan.png
February 10, 2016, at 12:59 AM by 174.148.92.107 -
Changed line 48 from:
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
to:
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
February 10, 2016, at 12:39 AM by 174.148.92.107 -
Changed lines 41-49 from:
to:
----

!!!! Commercial Fishery

Attach:download.png [[Attach:dynamic_optimization_fishery.zip|Dynamic Optimization Fishery Solution in MATLAB and Python]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
February 09, 2016, at 01:22 PM by 174.148.118.172 -
Added lines 28-29:

See [[https://youtu.be/5qY7WyngRbo|estimation example]] using the same model to explain estimator objectives.
February 09, 2016, at 01:19 PM by 174.148.118.172 -
Added line 26:
<iframe width="560" height="315" src="https://www.youtube.com/embed/cd0TkFtXfWs" frameborder="0" allowfullscreen></iframe>
February 09, 2016, at 12:49 PM by 174.148.118.172 -
Changed line 7 from:
!!!! Aly-Chan Problem'^2^'
to:
!!!! Aly-Chan Singular Control Problem'^2^'
Changed lines 21-24 from:
!!!! Catalyzed Reaction

Attach:download.png [[
Attach:dynamic_optimization_catalyst.zip|Dynamic Optimization Catalyst Solution in MATLAB and Python]]
to:
!!!! Aly Singular Control Problem

Attach:download.png [[Attach:dynamic_optimization_aly.zip|Aly Singular Control Solution in MATLAB and Python]]
Deleted line 25:
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
Added lines 27-38:

----

!!!! Catalyzed Reaction

Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Dynamic Optimization Catalyst Solution in MATLAB and Python]]

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

February 09, 2016, at 06:33 AM by 174.148.220.36 -
Deleted line 22:
!!!! Solution to Catalyzed Reaction Problem
February 09, 2016, at 06:33 AM by 174.148.220.36 -
Changed line 27 from:
to:
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
February 09, 2016, at 06:31 AM by 174.148.220.36 -
Added lines 5-6:
----
Changed line 12 from:
!!!! Solution to Aly-Chan Problem
to:
Added lines 17-27:
(:htmlend:)

----

!!!! Catalyzed Reaction

!!!! Solution to Catalyzed Reaction Problem
Attach:download.png [[Attach:dynamic_optimization_catalyst.zip|Dynamic Optimization Catalyst Solution in MATLAB and Python]]

(:html:)

Added lines 12-15:

(:html:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/tY8kyJq4BEY" frameborder="0" allowfullscreen></iframe>
(:htmlend:)
Changed line 5 from:
!!!! Aly-Chan Problem
to:
!!!! Aly-Chan Problem'^2^'
Changed line 7 from:
* The objective is to minimize final state ''x_3_(pi/2)'' by adjusting the value of ''u''.
to:
* The objective is to minimize final state ''x'_3_'(pi/2)'' by adjusting the value of ''u''.
Changed lines 6-8 from:
* Nonlinear, constrained, minimize final state
to:
* Solve the following nonlinear and constrained problem.
* The objective is to minimize final state ''x_3_(pi/2)'' by adjusting the value of ''u''.
* Compare to the exact solution of ''u(t)= -sin(t)''.
Added lines 1-17:
!!!! Exercise

'''Objective:''' Set up and solve several [[Attach:Dynamic_Optimization_Benchmarks.pdf|dynamic optimization benchmark problems]]. Create a program'^1^' to optimize and display the results. ''Estimated Time (each): 30 minutes''

!!!! Aly-Chan Problem
* Nonlinear, constrained, minimize final state
->Attach:dynopt_alychan.png
!!!! Solution to Aly-Chan Problem
Attach:download.png [[Attach:dynamic_optimization_alychan.zip|Dynamic Optimization Aly-Chan Solution in MATLAB and Python]]

----

!!!! References

# Hedengren, J. D. and Asgharzadeh Shishavan, R., Powell, K.M., and Edgar, T.F., Nonlinear Modeling, Estimation and Predictive Control in APMonitor, Computers and Chemical Engineering, Volume 70, pg. 133–148, 2014. [[https://dx.doi.org/10.1016/j.compchemeng.2014.04.013|Article]]

# Aly G.M. and Chan W.C. Application of a modified quasilinearization technique to totally singular optimal problems. International Journal of Control, 17(4): 809-815, 1973.