From Dynamic Optimization

Main: More Optimal Control Problems

Exercise

Objective: Set up and solve several optimal control benchmark problems. Create a program1 to optimize and display the results. Estimated Time (each): 30 minutes


Aly-Chan Singular Control Problem2

Dynamic Optimization Aly-Chan Solution in MATLAB and 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()

Aly Singular Control Problem

Aly Singular Control Solution in MATLAB and Python

See estimation example using the same model to explain estimator objectives.


Catalyzed Reaction

Catalyzed Reaction Optimized in MATLAB and Python

Maximize Profit (Commercial Fishery)


Minimize Final Time (Jennings)


Integral Objective (Luus)


References

  1. 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
  2. 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.
Retrieved from http://apmonitor.com/do/index.php/Main/MoreDynamicOptimizationBenchmarks
Page last modified on March 08, 2018, at 02:24 PM