OCP Benchmarks
Main.MoreDynamicOptimizationBenchmarks History
Show minor edits - Show changes to markup






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.
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
Objective: Set up and solve several OCP benchmarks. Create a program to optimize and display the results. Estimated Time (each): 30 minutes
(:title Optimal Control Benchmark Problems II:)
(:title OCP Benchmarks:)
Objective: Set up and solve several optimal control benchmark problems. Create a program to optimize and display the results. Estimated Time (each): 30 minutes
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
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/tY8kyJq4BEY" frameborder="0" allowfullscreen></iframe> (:htmlend:)
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/cd0TkFtXfWs" frameborder="0" allowfullscreen></iframe> (:htmlend:)

(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Batch Reactor
Bryson-Denham Problem
Integral Objective (Luus)
Maximize Profit (Commercial Fishery)
Minimize Final Time (Jennings)
Maximize Profit (Commercial Fishery)
Minimize Final Time (Jennings)
Integral Objective (Luus)
Bryson-Denham Problem
Batch Reactor
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.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$')
plt.plot(m.time,u.value,'r--',LineWidth=2,label=r'$u$') plt.plot(t,-np.sin(t),'k:',LineWidth=2,label='Exact')
plt.plot(m.time,u.value,'r--',lw=2,label=r'$u$') plt.plot(t,-np.sin(t),'k:',lw=2,label='Exact')
(:title More Optimal Control Problems:)
(:title Optimal Control Benchmark Problems II:)
- 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. Article
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
Objective: Set up and solve several optimal control benchmark problems. Create a program to optimize and display the results. Estimated Time (each): 30 minutes
- Solve the following nonlinear and constrained problem as shown in reference [2].
- Solve the following nonlinear and constrained problem.
Objective: Set up and solve several optimal control benchmark problems. Create a program1 to optimize and display the results. Estimated Time (each): 30 minutes
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
Aly-Chan Singular Control Problem2
- Solve the following nonlinear and constrained problem.
Aly-Chan Singular Control Problem
- Solve the following nonlinear and constrained problem as shown in reference [2].
Commercial Fishery
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Jennings Problem
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe> (:htmlend:)
(: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:)
(: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.:)
Objective: Set up and solve several dynamic optimization benchmark problems. Create a program1 to optimize and display the results. Estimated Time (each): 30 minutes
Objective: Set up and solve several optimal control benchmark problems. Create a program1 to optimize and display the results. Estimated Time (each): 30 minutes
Luus Problem
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/WIe31dTaW6g" frameborder="0" allowfullscreen></iframe> (:htmlend:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/WIe31dTaW6g" frameborder="0" allowfullscreen></iframe>
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Luus Problem
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/yuj217itTa8" frameborder="0" allowfullscreen></iframe>
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Jennings Problem
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/MA53XPp-a7I" frameborder="0" allowfullscreen></iframe>
Commercial Fishery
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe> (:htmlend:)
See estimation example using the same model to explain estimator objectives.
<iframe width="560" height="315" src="https://www.youtube.com/embed/cd0TkFtXfWs" frameborder="0" allowfullscreen></iframe>
Aly-Chan Problem2
Aly-Chan Singular Control Problem2
Catalyzed Reaction
Aly Singular Control Problem
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
Catalyzed Reaction
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe> (:htmlend:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/jB7WWGHFNIw" frameborder="0" allowfullscreen></iframe>
Solution to Aly-Chan Problem
(:htmlend:)
Catalyzed Reaction
Solution to Catalyzed Reaction Problem
(:html:)
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/tY8kyJq4BEY" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Aly-Chan Problem
Aly-Chan Problem2
- The objective is to minimize final state x_3_(pi/2) by adjusting the value of u.
- The objective is to minimize final state x3(pi/2) by adjusting the value of u.
- Nonlinear, constrained, minimize final state
- 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).
Exercise
Objective: Set up and solve several dynamic optimization benchmark problems. Create a program1 to optimize and display the results. Estimated Time (each): 30 minutes
Aly-Chan Problem
- Nonlinear, constrained, minimize final state

Solution to Aly-Chan Problem
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. 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.