Abstract
In this article, a modified gradient approach, based on the adjoint method, is introduced, to deal with optimal control problems involving inequality constraints. A common way to incorporate inequality constraints in the adjoint approach is to introduce additional penalty terms in the cost functional. However, this may distort the optimal control due to weighting factors required for these terms and raise serious concerns about the magnitude of the weighting factors. The method in this article avoids penalty functions and can be used for the iterative computation of optimal controls. In order to demonstrate the key idea, first, a static optimization problem in the Euclidean space is considered. Second, the presented approach is applied to the tumor anti-angiogenesis optimal control problem in medicine, which addresses an innovative cancer treatment approach that aims to inhibit the formation of the tumor blood supply. The tumor anti-angiogenesis optimal control problem with free final time involves inequality and final constraints for control and state variables and is solved by a modified adjoint gradient method introducing slack variables. It has to be emphasized that the novel formulation and the special use of slack variables in this article delivers high accurate solutions without distorting the optimal control.
1 Introduction
In the realm of complex systems and dynamic processes, the quest for efficiency and optimal performance has always been a driving force. Optimal control theory offers a powerful framework for tackling a wide range of problems. Whether it is a robot, a spacecraft, or an application in medicine, the ability to navigate and manipulate systems in the most effective way possible holds immense value.
The roots of optimal control theory can be traced back to the early 20th century, while significant advancements were made during the Apollo moon program in the 1960s [1–3]. Among the works mentioned, the works by Kelley, Bryson, and Ho are today fundamental for modern optimal control theory.
Despite the long history of optimal control, there is still research potential by combining principles from optimal control theory, optimization, and novel computational methods. Moreover, algorithms are becoming more robust to account for the growing complexity of problems. Various authors have already discussed on the complexity and computational strategies of optimal control theory [4–6].
Beside classical mechanics, optimal control is becoming increasingly important in modern medicine and can make a significant contribution to cancer treatment [7]. It involves using mathematical models to find the best ways to treat cancer. Several mathematical models have been proposed in the open literature to study tumor anti-angiogenesis [8–12].
One of the first biologically validated models of tumor growth dynamics was introduced by Hahnfeldt et al. [8]. This model serves as the basis for subsequent modifications and simplifications aimed at better understanding the dynamic properties of the underlying mechanisms. In the article of Ledzewicz and Schättler [12], the problem of minimizing tumor volume by administering predetermined amounts of anti-angiogenic and cytotoxic agents is examined. Optimal and suboptimal solutions are presented for four variations of the problem.
Another medical application can be found in the work of Gao and Huang [13], where an optimal control model of tuberculosis is presented to minimize both disease burden and intervention costs. More recently, the COVID-19 pandemic posed significant challenges to health systems in managing the disease. The work by Hametner et al. [14] discusses epidemiological models, allowing the prediction of infection dynamics using a flatness-based design.
Despite the great variety of mathematical models, the fundamental premise of all optimal control problems is to find the optimal input that steers a system toward desired goals, while accounting for various constraints. Handling constraints on the control variables, e.g., Graichen et al. [15] have systematically transformed an inequality constraint into a new equality constraint by means of saturation functions. In this article, we present a novel approach to address optimal control problems including inequality constraints by introducing a modified gradient method based on the adjoint technique. The adjoint approach, as, e.g., [16–20], is meanwhile a well-established method for efficient gradient computation in optimization procedures.
Incorporating inequality constraints in the adjoint approach could be realized by the introduction of penalty terms in the cost functional. The novel method proposed in this article is an enhancement of Refs. [21] and [22] in order to circumvent the use of penalty functions. The basic idea of the proposed method traces back to a transformation of the inequality constraint to an equality constraint by the introduction of so-called slack variables [23 and 24]. The adjoint method coupled with the use of slack variables allows for an iterative computation of the optimal control, which ensures highly accurate solutions without biasing the optimal control. In order to show the robustness of the algorithm, the presented approach is applied to the tumor anti-angiogenesis optimal control problem. By avoiding the need for penalty terms and their associated weighting factors, the proposed method offers a promising avenue for addressing optimal control problems with inequality constraints effectively.
2 A Modified Gradient Approach for Optimization Problems With Inequality Constraints
As a simple example, we consider the objective function and the inequality constraint . Choosing and , an update of x, y, and , which reduces f and incorporates , can be computed from Eq. (9). In order to show the robustness of the proposed method, we consider two different cases summarized in Figs. 1 and 2. The contour lines of are shown in gray, while the contour lines of f are depicted in black. Moreover, the contour line indicates the border of the restricted area and is shown as a dashed line. Note that the update becomes very small near the optimum; thus, the gradient has been scaled in both figures.

Visualization of the optimization procedure with an inequality constraint along the search direction
In the first case, the constraint is defined by and and the optimization procedure is initiated with , , and . Here, the inequality condition would be violated if the steepest descent of f to the minimum were followed. As depicted in Fig. 1, the method converges to the global minimum and , circumventing the forbidden area . In the second case, the constraint is given by and and the optimization procedure is started again with , , and . Thus, if the global minimum of f in lies in the region of the inequality constraint, the method converges to the constrained optimum as depicted in Fig. 2. At the optimal point, given by and , the contour line of is tangent to the boundary of the constraint . In summary, the method converges to the optimal solution in both scenarios, i.e., for constraints along the search direction and for constrained minima.
In the third case, the constraint is given by and and the initial values read , , and . Note that in this case the global minimum lies exactly on the boundary of the inequality constraint . As shown in Fig. 3, the method converges to the global minimum and .
3 Optimal Control Problem
In this section, we focus on the optimization of an optimal control problem minimizing a cost functional, which includes a scrap function. Moreover, we investigate two types of constraints imposing limitations on the system behavior, encompassing final conditions and inequality constraints.
3.1 Problem Formulation.
can now be used to put bounds on and . Hence, the optimal control problem is formulated as the problem of finding controls and slack variables in the time interval which minimize the functional in Eq. (11) and satisfy at the same time Eqs. (12) and (18). In order to apply a solution strategy to our optimal control problem, we first compute the variation of the cost functional in Eq. (11) with respect to the control signal. Moreover, we derive the variation of the final conditions in Eq. (12) and the variation of the constraints in Eq. (18), both with respect to the control signal. Finally, we consider how the variations can be combined in a reasonable way to obtain an update formula for applying a descent optimization algorithm.
3.2 Adjoint Equations.
which shows the influence of and on .
3.3 Influence Equations for the Final Conditions.
showing the direct influence of and on .
3.4 Influence Equations for the Inequality Constraints.
which directly relates the variation of the inputs , the variation of the slack variables and the variation of the free final time with the variation of the constraints .
3.5 Gradient Combination.
The linear system of equations can be readily solved for and , which can then be inserted into the update formulas in Eq. (38) for approaching the final conditions and inequality constraints.
4 Algorithm
Finally, we provide a summary of the steps involved in the modified gradient approach to compute optimal controls with final conditions and inequality constraints. To facilitate the process, a transformation into a unit interval is beneficial due to the free final time . Thus, we introduce a new time coordinate, , related with to the original time coordinate. Derivatives with respect to are denoted as and are defined as . The procedure for solving optimal control problems can be summarized as follows:
Before applying an optimization scheme, select a final time guess , an initial control signal , and a slack variable signal , where . Choose the weighting factors and and the parameters and . For the optimization problem conditioning, the scaling parameters and are chosen by balancing the magnitude of the update formulas , , and . Moreover, the values of the parameters and determine the convergence toward the final conditions and the fulfillment of the rewritten inequality constraints. The range of values for and is discussed in Ref. [22], but experience has shown that the setting of the parameters only has an influence on the convergence speed and not on the convergence success.
- Solve the state equationswith the initial condition in the interval .(48)
- Solve the adjoint differential equationswith the final condition from to .(49)
- Solve the influence differential equations Iwith the final condition from to .(50)
- Solve the influence differential equations IIwith the trivial final condition from to .(51)
- Compute the multipliers and by solving the linear system of equations(52)
- Select and update the final time, controls and slack variables byA constant step size can be chosen, but for improved convergence, utilizing a merit function is beneficial as described in Ref. [26].(53)
Check the gradient of J and the values of the final conditions and inequality constraints .
Repeat steps 1 through 6 until the gradient of the cost functional J is sufficiently small and the final conditions and inequality constraints in step 7 are satisfied. Note that if a merrit function, as described in Ref. [27, Sec. 15.5], is used to determine the update step size , the method is open for standard numerical gradient methods to minimize a function. In order to improve the algorithm convergence, the nonlinear conjugate gradient method can be applied, incorporating information from a prior update step.
5 Tumor Anti-Angiogenesis Optimal Control Problem
To demonstrate the application of the modified gradient approach, we consider the tumor anti-angiogenesis problem presented in Ref. [12]. The tumor anti-angiogenesis optimal control problem was selected as an example to test the algorithm with a variety of conditions, including terminal conditions, control inequality constraints, and free final time. Although state inequality constraints are not included in this example, in the authors' experience such problems show a similar convergence for this type of constraints.
The anti-angiogenic therapy is an innovative cancer treatment approach that aims to inhibit the formation of the blood supply system necessary for tumor growth.
Most cancer chemotherapy treatments fail due to a combination of intrinsic and acquired drug resistance. While cancer cells become increasingly resistant, the drugs continue to kill healthy cells, leading to therapy failure.
Therefore, finding cancer treatment methods that overcome drug resistance is crucial. One possible therapeutic approach offers anti-angiogenesis for the treatment of tumors. Above a certain tumor size, tumors form their own blood supply by developing a vascular system through a process called angiogenesis.
Angiogenesis is a signaling process between tumor cells and endothelial cells, i.e. cells that cover the inside of blood vessels. Tumor cells release a vascular endothelial growth factor to stimulate endothelial cell growth in blood vessels. In response, blood vessels provide vital nutrients to the tumor, supporting its growth.
However, endothelial cells possess specific receptors that make them responsive to inhibitors of angiogenesis, such as the naturally occurring inhibitor protein endostatin. In pharmacological therapies, the primary objective is often to target the growth factor vascular endothelial growth factor, with the aim of hindering the formation of new blood vessels and capillaries. By impeding the development of these vital structures, the growth of the tumor can be effectively blocked.
5.1 Problem Formulation.
in terms of the proposed algorithm.
5.2 Solution Strategy.
To demonstrate the proposed method and its algorithmic implementation, we follow the step-by-step procedure in Sec. 4 to show how the method can effectively solve the problem at hand.
- The adjoint differential equations in Eq. (49) for are given byand can be solved with the final conditions from to .(61)
- Note that we are dealing with only one final constraint, given by Eq. (57), hence, the first set of influence differential equations for from Eq. (50) are given bywhich may be also solved backward in time by starting at with the final conditions . Since no objective function h is defined in the present problem, here. Hence, the right-hand side of the adjoint equations in Eq. (61) correspond to the right-hand side of the influence equations in Eq. (62).(62)
Moreover, we have no state inequality constraints, hence, the final condition for is given by and in Eq. (51) is zero for the entire -domain and have therefore no effect on the gradient formula.
- Before we can compute a combined update for the system inputs, the multipliers and must be determined by Eq. (52). Thus, the components of the matrix in Eq. (41)1 readand can be determined by Eq. (41)2, yielding(63)Moreover, can be computed by Eq. (41)3 and is given by(64)where the boundary term is zero, since . The components of the matrix in Eq. (45)1 read(65)where . Moreover, can be determined by Eq. (45)2(66)Inserting in Eq. (45)3, reads(67)Arranging Eqs. (63)–(68) in matrix notation, the multipliers and can be computed by solving Eq. (52).(68)
- Finally, the gradient formulas are obtained from Eq. (53), where the update for the final time and the control signal are given byand the updates for the slack variables read(69)(70)
By adding the updates to the previous estimates, we receive an improvement by: as new final time, as new control signal, and as new slack variables.
5.3 Numerical Results.
For numerical computations we use the parameter set from Hahnfeldt et al. [8]. In summary, the parameters read , , , , and . Moreover, the initial conditions are given by and , and the final state of is prescribed by . For the initial guess, we choose a final time , a control history , and a slack variable history for .
The update formulas of the final time and the slack variables in Eq. (53) are scaled by and . Moreover, we set the update parameters to and , respectively. The presented algorithm is implemented in the software tool Matlab. The solution of the state and adjoint variables in Eqs. (48)–(51) are obtained by the ode45 routine using the default solver settings for accuracy and variable step size control. The control input is discretized with 200 data points and due to the step size control, the numerical grids in the forward and backward solutions are not equivalent. Hence, the state and control trajectories are interpolated by piecewise polynomials using the modified Akima algorithm makima, which is suited to handle rapid changes between flat regions that occur during bang-bang controls. The solution to the tumor anti-angiogenesis problem is shown in the figures below. The convergence history is depicted in Fig. 4 and shows that after 150 iterations, the cost functional value is reduced from to and the final constraint converges to zero.

Convergence of the optimization: Decreasing scrap function value in ratio to (top) and decreasing constraint value (bottom)
The identified system inputs are presented in Fig. 5. Based on Pontryagin's minimum principle [28], the optimal control for bounded inputs, which appear linear in the Hamiltonian, is either a bang-bang or a singular control. In the tumor anti-angiogenesis problem, the angiogenic dose rate is of the bang-bang type. The optimal control is depicted in Fig. 5(a) and shows that the control input is either at its maximum or minimum value. The slack variables and associated with the control, which are used to account for the control limitations, are shown in Fig. 5(b). Here, and are associated with the upper and lower limits of the control.
At the beginning, the control input remains in the upper constraint bound, resulting in a positive value of . As the lower bound is not active, remains zero. When the control input switches from the upper to the lower constraint bound, we observe that changes to zero, while .
In Fig. 6(a), the optimal dosage decreases the volume of the primary tumor from to approximately after . Figure 6(b) shows that the carrying capacity of the vasculature decreases during the administration of angiogenic agents and increases after discontinuation of therapy.

State histories for the tumor anti-angiogenesis: (a) primary tumor volume, (b) carrying capacity of the vasculature, and (c) total amount of agents
Furthermore, in Fig. 6(c), the total amount of angiogenic agents administered over the whole period is monitored. While the maximum dose of drug is administered, the total amount of angiogenic agents increases linearly and remains constant after drug therapy is suspended.
The solution in Fig. 5(a) and in Figs. 6(a)–6(c) is compared with the solution obtained by the software tool GPOPS-II presented in Ref. [29, Sec. 4.3.16]. GPOPS-II is a method used for solving nonlinear, continuous, and multiphase optimal control problems. It utilizes the Gauss pseudo-spectral method to transform the optimal control problem into a sparse, finite nonlinear programing problem. The results of the proposed gradient method shows good agreement for the states v, w and the control u with the presented results of GPOPS-II [29, Fig. 60]. Note that during the control change a discontinuity occurs both in the control and in the state derivative. Hence, in Ref. [29] the tumor anti-angiogenesis problem served as a test example to analyze convergence properties of various mesh refinement methods. The article describes that the GPOPS-II software tool is facing a large number of mesh points around the discontinuity. In contrast to the latter discussion in Ref. [29], a rapid change of control is not a problem in the presented method, as the number of control points can be chosen as required. The discontinuity of the carrying capacity w in Fig. 6(b) is handled by the automatic step size control of ode45.
6 Conclusion
In summary, the proposed method has several advantages over classical solution strategies using a penalty approach. It allows the use of initial controls that do not a priori satisfy the end conditions and inequality constraints. Moreover, no penalty terms are required, which provides more accurate solutions and makes it more robust in solving the underlying two-point boundary value problem. Despite the trivial choice of the initial control, the method converges to the optimal solution. Since the method enables an automatable process to find optimal solutions, its applicability covers even more challenging problems in optimal control. However, there are a few disadvantages to consider. Typical for gradient-based procedures, the method requires a high number of iterations near the optimum to achieve accurate results. Furthermore, the choice of process parameters, i.e., update and scaling parameters, demands experience and expertise.
Overall, the advantages of the proposed method, including flexibility in initial control, robustness, convergence, and applicability to complex systems, outweigh its drawbacks, thus making it a promising approach for solving optimal control problems in various domains, e.g., as shown here for optimal dose control in drug therapies. In many cases, it is difficult to derive the state equations of complex systems using a set of minimal independent coordinates. Therefore, many multibody systems are modeled by commercial software tools dealing with index-three differential algebraic equations (DAEs). A modified gradient approach tailored for multibody systems, however without applicability to inequality constraints, has been investigated in a previous work [30]. The prework is also based on the adjoint method including a backward differentiation formula scheme to solve the resulting adjoint DAE system. Building on the prework along with the knowledge acquired in this article, the theory can be extended for DAE systems to handle control problems with inequality constraints in multibody dynamics.
Acknowledgment
This research was funded in whole or in part by the Austrian Science Fund (FWF): P 37110-NBL (No. 10.55776/P37110) Karin Nachbagauer acknowledges also support from the Technical University of Munich – Institute for Advanced Study.
Conflict of Interest
The authors have no competing interests to declare that are relevant to the content of this article.