Dynamic Control Objectives
The dynamic control objective function is a mathematical statement that is minimized or maximized to find a best solution among all possible feasible solutions for a controller. The form of this objective function is critical to give desirable solutions for driving a system to a desirable state or along a desired trajectory. Common objective statements relate to economic, safety, operability, environmental, or related objectives.
Two common objective functions are shown below as squared error and l1-norm forms1.
Squared Error Objective
The squared error objective is the most common form used in the literature. It penalizes deviation of the current measured value of the controlled variable from the desired target value.
minx,y,uΦ=(y−yt)TWt(y−yt)+yTwy+uTwu+ΔuTWΔuΔu
subjectto
0=f(dxdt,x,y,u)
0≤g(dxdt,x,y,u)
τcdytdt+yt=sp
l1-norm Objective
The l1-norm objective is the absolute value of the difference between the current measured value of the controlled variable and the desired target value. The absolute value operator (abs(x)) does not have a continuous first and second derivative at x=0 (see absolute value function alternatives). Slack variables give the same absolute value function but with continuous first and second derivatives.
minx,y,uΦ=wThiehi+wTloelo+yTwy+uTwu+wTΔu(ΔuU+ΔuL)
subjectto
0=f(dxdt,x,y,u)
0≤g(dxdt,x,y,u)
τcdyt,hidt+yt,hi=sphi
τcdyt,lodt+yt,lo=splo
ehi≥y−yt,hi
elo≥yt,lo−y
ΔuU≥ui−ui−1
ΔuL≥ui−1−ui
ehi,elo,ΔuU,ΔuL≥0
Nomenclature
Φ=ObjectiveFunction
y=modelpredictions
yt,yt,hi,yt,lo=referencetrajectoryorrange
Wt,whi,wlo=penaltyoutsidereferencetrajectory(WSP,WSPHI,WSPLO)
WΔu,wΔu=manipulatedvariablemovementpenalty(DCOST)
wu,wy=weightoninputandoutput(COST)
y,x,u=outputs,states,andinputs
Δu=manipulatedvariablechange
f,g=equalityandinequalityconstraints
ehi,elo=upperandlowererroroutsidedead−band
ΔuU,ΔuL=upperandlowermanipulatedvariablechange
In formulating an objective function and model equations follow the following tips for improved convergence.
- Rearrange to equation in residual form to:
- Avoid divide by zero
- Minimize use of functions like sqrt, log, exp, etc.
- Have continuous first and second derivatives
- Fit the equation into a linear or quadratic form
- Bounds
- Include variable bounds to exclude infeasible solutions
- Variable bounds to avoid regions of strong nonlinearity
- Caution: watch for infeasible solutions
- Scaling:
- Scale absolute value of variables to 1e-3 to 1e3
- Scale absolute value of equation residuals to 1e-3 to 1e3
- Better that 1st derivative values are closer to 1.0
- Good initial conditions:
- Starting near a solution can improve convergence
- Try multiple initial conditions to verify global solution (non-convex problems)
- Explicitly calculate intermediate values
- Check iteration summary for improved convergence
Custom Reference Trajectory
Some applications require a custom reference trajectory that does not fit a standard form. A custom reference trajectory is specified by creating a new error (e) variable that is the difference between the specified trajectory (sinusoidal, sawtooth, random, etc) and the model output. This error is specified as a controlled variable (CV) with an upper and lower dead-band denoted as SPHI and SPLO. The CV can also be a value of zero with a squared error objective (e.SP=0, m.options.CV_TYPE=2) to drive to a target instead of a dead-band range.

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