6TH-ORDER RUNGE-KUTTA FORWARD-BACKWARD SWEEP ALGORITHM FOR SOLVING OPTIMAL CONTROL MODELS OF EPIDEMIOLOGICAL TYPE
6TH-ORDER RUNGE-KUTTA FORWARD-BACKWARD SWEEP ALGORITHM FOR SOLVING OPTIMAL CONTROL MODELS OF EPIDEMIOLOGICAL TYPE
AJE TEMITOPE*
ABSTRACT
This paper seeks to formulate a more accurate forward-backward algorithm for solving optimal control
problems using the 7-stage Runge-Kutta of order 6 (RK6) numerical scheme. The control variable were
approximated using the interpolating polynomial or spine while the RK6 forward and backward sweeps
were used in approximating the state and adjoint variables respectively because its A-stability, accuracy
and higher rate of convergence. Three numerical examples were simulated to ascertain the accuracy and
convergence of the 6th order Runge-Kutta forward-backward sweep method (K6FBSM). It was
discovered that the RK6FBSM performs better when compared with the Euler and the 4th order Runge-
Kutta Forward-Backward Sweep method RK4FBSM.
INTRODUCTION
Optimal control involves finding control inputs that optimize a particular performance criterion subject to
system dynamics and constraints[1]. The modern formulation of optimal control theory began in the mid-
20th century with contributions from Plethora of authors[2], The Forward Backward Sweep Method
(FBSM) is an indirect numerical method widely used for solving optimal control problems due to its
computational efficiency and ease of implementation[3]. Reviewed the FBSM for both bounded and
unbounded control problems, incorporating various numerical schemes such as Euler, trapezoidal, and
Runge-Kutta techniques[4]. The method iteratively solves the state equations forward in time and the
adjoint equations backward in time, updating the control inputs at each iteration[5]. The Forward-
Backward Sweep (FBS) method is a popular technique for solving optimal control problems, especially
those formulated as two-point boundary value problems by iteratively solving the state and costate
equations forward and backward in time, respectively[6]. According to the FBS method is particularly
effective because it directly integrates the state and costate equations while updating the control policy at
each iteration[7]. The method is proven to be robust and provides accurate solutions for a range of test
problems, demonstrating its utility in practical applications[8].
www.ajms.com
6TH-ORDER RUNGE-KUTTA FORWARD-BACKWARD SWEEP ALGORITHM FOR SOLVING OPTIMAL CONTROL MODELS
OF EPIDEMIOLOGICAL TYPE
METHODOLOGY
The solution to optimal control problems involves the derivation of the optimal control characterization
and the use of the forward and backward sweep for the state and control trajectories respectively[9]. By
the Pontryagin’s maximum, the optimal control can be analytically derived by the optimality condition
while the state and control variables can be derived numerically using the Runge-Kutta of order six
subject to the adjoint and transversality conditions[10].
(1)
subject to : x˙1 = g1(t,x1(t),x2(t),...,xn(t),u(t)) (2)
...
xn = gn(t,x1(t),x2(t),...,xn(t),u(t)) (4)
and the optimality, adjoint and transversality conditions are expressed below respectively as
(Optimality) (7)
(Adjoint) (8)
(Transversality), (9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
for the subscript of each argument i= 1,2,··· ,n, r = 1,2,··· ,m, the counter k = 1,2,··· ,N. and the functions
gl, l = 1, 2···7 are once continuously differentiable within the time interval [
and Kil denoting the dynamical function of the i−th component (argument) and the l−th stage. For the
control characterization, the optimal variable is derived using the optimality condition = 0 such that
(18)
The interpolating polynomial or spline [8] of the control variable us(.) can be computed as the formula;
(19)
The control variable for the forward(+) and backward (-) sweep are approximated respectively as follows;
(20)
The backward sweep of the adjoint variables using the proposed RK6 method requires the discretization
of the adjoint such that for any argument with a specific control variable us
attached to each state equation is expressed thus:
(21)
Deploying the 7-stage RK6 numerical scheme in the discretization of the backward sweep for the adjoint
variables yields the following:
Compute while k = 0,1,2,...,N do from equations (10) to (17) respectively and sequentially.
Step 6: Output xki,λji,u∗i(∀i,j) and end function Step 7: Return Repeat step 2
The Hamiltonian function H is defined as H = u(t)2 +λ(t)·(x(t)+u(t)) where λ(t) is the adjoint variable (or
costate). Using the optimality adjoint and transversality conditions yields the analytical (exact) optimal
solution below:
(32)
The derived costate equation using the adjoint conditions, , given by:
λ′(t) = −λ(t), λ(T) = 0 (33)
Applying the forward Euler, RK4 and the proposed RK6 forward -backward sweep methods (i.e
RK4FBSM and proposed RK6FBSM respectively) yields the results below.
Table 1: |xA− xE|, |xA− xK4|and|xA − xK6| ≡ errors of Euler RK4 & RK6 respectively
(34)
(35)
H(I(t),u(t),λ(t)) = ω1I(t) + u2(t) + λ(t)(β(N − I(t))I(t) − (µ + γ)I(t) − u(t)I(t)(37) The optimal control
obtained using the optimality condition, = 0, is given by
. (38)
The derived co-state equation using the adjoint conditions, , given by:
Applying the forward Euler, RK4 and the proposed RK6 forward -backward sweep methods (i.e
RK4FBSM and proposed RK6FBSM respectively) also yields the results in Table 2 below using the
following parameters: β = 0.05, µ = 0.01, γ = 0.5, N = 100, ω1 = 1 and T = 1.
RK6FBSM
RK4FBSM
6
Euler
0
0 2 4 6 8 10
Example 3: We considered the model on optimal control and comprehensive cost effectiveness analysis
for COVID-19 [2]
(40)
(41)
where ,
(42)
(43)
Simulating with the following parameters β1 = 0.1233;β2 = 0.0542;β3 = 0.0020;β4 = 0.1101;δ = 0.1980;τ =
0.3085;d = 1/(74.87 ∗ 365);d1 = 0.0104;γ1 = 0.3680;γ2 =0;ψ1 = 0.2574;ψ2 = 0.2798;ψ3 = 0.1584;ϕ = 0.3820
yields the results below.
EE EK4 EK6
Figure 3: Convergence of E(t) in 101 iterations. Fig 4: Convergence of B(t) in 101 iterations.
DISCUSSION OF RESULTS
In example 1, the rate of convergence of the 3 methods: Euler, RK4 and Rk6 were compared on the state
variable as demonstrated on table 1. It was discovered that the rate of convergence of the RK6 compares
favorably with RK4 with higher level of accuracy after 10 iterations. In similar manner, Table 2 and 3
were used to compare the Iterates for the Euler, RK4 and RK6 forward-backward sweep methods on the
state variables of examples 2 and 3 respectively. Figures 2, 3 and 4 were used to illustrate the rate of
convergences which shows that the RK6FBSM performs excellently well although the computational
efforts is more in terms of rigors of coding and process time.
CONCLUSION
The adaptation of the 6th order Runge-Kutta forward-backward sweep algorithm for solving generalized
optimal control problems with bounded control arrives at an accurate result at a faster rate of convergence
compared to the Runge-Kutta of order four (RK4), due to its stability and higher numerical order of
convergence. This adaptation is essential for handling mathematical models with large number of non-
linear dynamical equations. Therefore, the sixth order Runge-Kutta forward-backward sweep algorithm
seeks to provide a more effective and efficient method due to its speed, accuracy, higher rate of
convergence, suitability and versatility for real-time or practical applications such as the Epidemiological
and general Biomedical models (see MATLAB code in Appendix).
REFERENCES
1. Adamu, S. (2023). Numerical solution of optimal control problems using block method. Electronic
Journal of Mathematical Analysis and Applications, 11(2), 8. ISSN: 2090729X (online). Retrieved
from http://ejmaa.journals.ekb.eg
2. Asamoah, J. K., Okyere, E., Abidemi A., Moore, S. E., Sun, G.,, Jin,, Z., Acheampong, E. and
GordonOptimal, J. F. (2022), Control and comprehensive costeffectiveness analysis for COVID-19
3. Banu, M. S., Raju, I. and Mondal, S. (2021). A comparative study on classical fourth order and
Butcher sixth order Runge-Kutta methods with initial and boundary value problems. International
Journal of Material and Mathematical Sciences, 2(1), 8-21.
https://doi.org/10.34104/ijmms.021.08021
4. Berkovitz, L. D. (1962). On control problems with bounded state variables. Journal of Mathematical
Analysis and Applications, 5, 488-498. https://core.ac.uk/display/82704868
5. Guzman D´ıaz, D., Gomez-Aleixandre, J. and Coto, J. (2015). Direct backward/forward sweep
algorithm for solving load power flows in AC droopregulated microgrids. IEEE Transactions on
Power Systems, 30(6), 3151-3160. https://www.researchgate.net/publication/282530636
6. Kirk, D. E. (2004). Optimal control theory: An introduction . Dover Publications . 184-240.
Retrieved from https://dokumen.tips/documents/optimal-control-theoryan-introduction.html?page=2
7. La Torre, D., Kunze, H., Ruiz-Galan, M., Malik, T. and Marsiglio, S. (2015). Optimal Control:
Theory and Application to Science, Engineering, and Social Sciences. Abstract and Applied
Analysis, 890527. https://doi.org/10.1155/2015/890527
8. Lenhart, S., & Workman, J. T. (2007). Optimal control applied to biological models (Chapman &
Hall/CRC Mathematical and Computational Biology Series). Chapman and Hall/CRC. Retrieved
from https://dokumen.pub/download/optimalcontrol-applied-to-biological-models-9781322628394-
1322628394-978-1-4200-1141-8-
9. 1420011413 .html
10. Martcheva, M. (2015). An introduction to mathematical epidemiology (Texts in Applied
Mathematics 61). Springer Science+Business Media New York, p. 237. https://doi.org/10.1007/978-
1-4899-7612-3
11. Pontryagin,L. S., Boltyanskii, V. G., Gamkrelize, R. V. and Mishchenko, E. F. (1962). The
Mathematical Theory of Optimal Processes. Wiley, New York.
12. Rose, G. R. (2015). Numerical Methods for Solving Optimal Control Problems. Master’s Thesis,
University of Tennessee. Retrieved from https://trace.tennessee.edu/utkgradthes/3401.