 Research
 Open access
 Published:
A new computational approach for optimal control of switched systems
Journal of Inequalities and Applications volume 2024, Article number: 53 (2024)
Abstract
The combination of the timescaling transformation and control parameterization has proven to be an effective approach in addressing optimal control problems involving switching systems with predefined subsystem sequences. However, this approach has certain limitations. First, the number of control switchings is required to be no less than the number of subsystem switchings. Second, the switching of the subsystem must be accompanied by the switching of the control. Third, this scheme introduces many hyperparameters, leading to combinatorial explosion. To address these drawbacks, we introduce a novel computational approach such that the control switching can be independent of subsystem switching. The superiority of this novel approach can be clearly observed from the solutions obtained using the proposed method for solving two illustrative examples.
1 Introduction
A switching system is a dynamic system composed of multiple modes (often called subsystems). The system transitions between these modes based on defined rules or conditions. More specifically, a transition between subsystems can be triggered by predefined events, specific time instances, or conditions tied to the system state. Due to their inherent adaptability, such systems can dynamically shape their behavior and control strategies to adeptly respond to changes in environmental conditions or system requirements. Switching systems are encountered in a variety of areas such as robots [1, 2], power systems [3], and communication networks [4, 5]. The success of these applications demonstrates the versatility and importance of switching systems. The challenge in solving the optimal control problem of switching systems (SOCP) lies in intelligently determining the control inputs and switching laws. The switching law serves as a blueprint outlining the detailed sequence of active subsystems and their corresponding switching times. This sequence encapsulates the precise moments when the system transitions smoothly from one subsystem to another, coordinating the interaction of modes to optimize overall performance.
Early theoretical advances to address this problem can be found in [6] and [7], where dynamic programming and the maximum principle were adopted, respectively. However, they do not provide effective numerical methods to obtain optimal solutions. In [8], Xu and Antsaklis introduced a bilevel optimization approach to address SOCPs. This approach breaks down the problem into two levels and solves them iteratively. The lower level focuses on fixing the switching sequence and optimizing the control inputs and switching times to minimize the cost function. On the other hand, the upper layer optimizes the switching sequence and performs the lower layer optimization for each switching sequence. This is much more complex. In [9–13], it was generally assumed that the switching sequence is predetermined, and the focus is on optimizing the lower level. This consideration applies to scenarios where the order of switching sequences is predetermined and only lowerlevel issues are performed. See, for example, [8]. In addition, the research results of the lower level will lay the foundation for the research of the upper level. Therefore, this paper also studies the switching optimal control problem of fixed switching sequence.
Most existing strategies for addressing the lowerlevel problem resort to discretizing the control function and/or state variable. Then, a search algorithm is applied to the resulting discrete model to find the optimal solution [14]. However, these discretization methods can lead to combinatorial explosion. To address this issue, a novel method is proposed in [8] to decompose the lowerlevel problem into two subproblems. The first subproblem focuses on minimizing the cost function with fixed switching instants, where decision variables are limited to control inputs. This process converts the problem into a nonlinear optimization problem. For the second subproblem, it aims to minimize the cost function with respect to switching instants. For this, the gradient of the cost function with respect to the switching times is derived. This approach has been improved in [15–17].
In [18], a novel technique is introduced to address the lowerlevel problem without the need for decomposition. This method works by first approximating the control function using a piecewise constant function where the control heights and the control switching times become the new optimization variables. Then, with the aid of the timescaling transformation [19, 20], the switching times of the control and subsystems are mapped into fixed knots within a newly defined time horizon. This process leads to the approximation of the original optimal control problem as a nonlinear optimization problem. Since then, this technique has been widely adopted for solving optimal control problems involving switching systems over the past decade [21–23]. However, it is worth noting that this scheme requires that (i) the number of control switchings must be no less than the number of switchings between subsystems, and (ii) the switching of the subsystem must be accompanied by the switching of the control. These predetermined requirements may not be strictly adhered to for many practical problems. This is because the control switching times and the subsystem switching times are usually independent of each other.
In [24, 25], within the computational paradigm of control parameterization, an effective strategy called Sequential Adaptive Switching Time Optimization (SASTO) is proposed to solve standard optimal control problems. The SASTO approach is applicable to scenarios where the optimization is to be carried out on multiple sets of mutually independent switching times. It is achieved through the systematic introduction of new time domains. Motivated by the success of this approach, our aim is to devise a new method that efficiently addresses the limitations faced when solving switching optimal control problems.
The remainder of the paper is structured as follows. The problem formulation is presented in Sect. 2. Moving on to Sect. 3, we delve into the shortcomings of employing traditional time scale transformations and devise an efficient approach to address this challenge. A new computational method is constructed to solve the resulting transformed problem. In Sect. 4, the gradient formulas of the cost/constraint functions are given. In Sect. 5, two numerical examples are solved. Finally, concluding remarks are provided in Sect. 6.
2 Problem formulation
Consider the following nonlinear switched system with N subsystems:
where \(\boldsymbol {x}(t)\in \mathbb{R}^{n}\) and \(\boldsymbol {u}(t)\in \mathbb{R}^{m}\) are the state and control vectors of the system at time t, respectively; \(\boldsymbol {x}_{0}\in \mathbb{R}^{n}\) is the given initial state; \(\boldsymbol {f}^{j}: \mathbb{R}^{n}\times \mathbb{R}^{m}\rightarrow \mathbb{R}^{n}\), \(j=1, \ldots ,N\), is the given continuously differentiable function representing the jth subsystem; \(t_{0}, t_{1},\ldots , t_{N}\) are the switching instants of subsystems where \(t_{0}=0\), \(t_{N}=T>0\) are the initial and terminal times, respectively. Let \(\boldsymbol{\tau}=[t_{0},t_{1},\dots ,t_{N}]^{\top}\) be such that \(t_{j1}< t_{j}\), \(j=1,\dots ,N\). Let \(\mathcal{T}\) be the set consisting of all such τ.
Let \(\boldsymbol {u}: [0, T]\rightarrow \mathbb{R}^{m}\) be a Borel measurable function satisfying \(\boldsymbol {u}(t)\in U\) for almost all \(t\in [0, T ]\), where U is a compact and convex set in \(\mathbb{R}^{m}\). Such a u is termed an admissible control. Denote the set of all such admissible controls as \(\mathcal{U}\). The formal definition of the optimal control problem for the switched system is as follows:
Problem (P1)
Given the switched system (1)–(2), find \(\boldsymbol {u}\in \mathcal{U}\) and \(\boldsymbol{\tau}\in \mathcal{T}\) such that the cost function
is minimized subject to the canonical constraints
Here, \(N_{b}\) and \(N_{d}\) represent the counts of inequality and equality constraints, respectively; \(\Phi _{l}: \mathbb{R}^{n} \to \mathbb{R}\), \(\mathcal{L}_{l}:\mathbb{R}^{n}\times \mathbb{R}^{m}\to \mathbb{R}\), \(l=0,1, \dots ,N_{b}+N_{d}\), are specified realvalued functions.
We presume that the conditions outlined in [20] are satisfied throughout this paper:

A1.
Function \(\boldsymbol {f}^{j}\), \(j=1,\ldots ,N\), is twice continuously differentiable.

A2.
For \(j=1,\ldots ,N\), there is a constant L (\(L>0\)) such that
$$ \bigl\ \boldsymbol {f}^{j}(\boldsymbol{\aleph}\,, \boldsymbol{\daleth})\bigr\ \le L \bigl(1+\\boldsymbol{\aleph}\, \+\ \boldsymbol{\daleth}\\bigr),\quad (\boldsymbol{\aleph}\,,\boldsymbol{\daleth})\in \mathbb{R}^{n}\times \mathbb{R}^{m}. $$ 
A3.
Functions \(\Phi _{l}:\mathbb{R}^{n} \to \mathbb{R}\), \(l=0,1,\dots ,N_{b}+N_{d}\), and \(\mathcal{L}_{l}:\mathbb{R}^{n}\times \mathbb{R}^{m}\to \mathbb{R}\), \(l=0,1, \dots ,N_{b}+N_{d}\), are continuously differentiable with respect to their arguments.
3 Method analysis
Over the past few decades, the utilization of the timescaling transformation and control parameterization method has gained popularity as a numerical method for solving SOCPs [18, 21, 26]. This method subdivides the time interval \([t_{j1},t_{j}]\) into \(p_{j}\) subintervals and denotes the \(p_{j}+1\) nodes as \(\tau _{0}^{j},\tau _{1}^{j},\ldots ,\tau _{p_{j}}^{j}\), \(j=1,\ldots , N\), where \(t_{0}=0\), \(t_{N}=T\) and \(t_{j1}=\tau _{0}^{j}<\tau _{1}^{j}<\cdots <\tau _{p_{j}}^{j}=t_{j}\), as shown in Fig. 1. By applying the control parameterization, \(\boldsymbol {u}(t)\) is approximated by a piecewise constant function on the time domain \([0,T]\) as follows:
where \(\boldsymbol{\rho}^{j,k}\) is the approximate value of the control \(\boldsymbol {u}(t)\) on the kth interval \([t_{j1},t_{j}]\). Then, the timescaling transformation operates by mapping these variable knots \(\{t_{0},\tau _{1}^{1},\ldots ,\tau _{p_{1}1}^{1}, t_{2},\ldots ,t_{N1}, \tau _{1}^{N},\ldots ,\tau _{p_{N}1}^{N},t_{N}\}\) to fixed and ordered points \(\{0,1\ldots ,p_{1}1,p_{1},\ldots ,p_{1}+p_{2},\ldots , \sum_{j=1}^{N}p_{j} \}\) in a new domain. Clearly, there are many hyperparameters \(p_{1},\ldots ,p_{N}\), which can easily lead to combinatoric explosion. For example, when \(p = 5\) and \(p\triangleq \sum_{j=1}^{N}p_{j}\), there are 21 possible combinations of partitions \((p_{1}, p_{2}, p_{3})\). To avoid this situation, most existing literature such as [18, 21, 22, 27, 28] only consider the case of \(p_{1} = p_{2} = p_{3}\) in their numerical experiments so that p must be a multiple of N.
Additionally, from Fig. 1 it can be seen that the switching instants \(t_{0}, t_{1},\ldots ,t_{N}\) coincide with the partition knots \(\tau _{0}^{1},\tau _{0}^{2},\ldots ,\tau _{N}^{N}\), so \(p\triangleq \sum_{j=1}^{N}p_{j}\ge N\), which indicates (i) the number of control switchings must be no less than the number of switchings between subsystems; and (ii) the switching of the subsystem must be accompanied by the switching of the control. This is clearly unreasonable because the switching times \(t_{0}, t_{1},\ldots ,t_{N}\) and the control switching points are usually mutually independent.
In [24, 25], it is pointed out that the timescaling transformation is an orderpreserving mapping. Therefore, the application of this method must meet the essential requirements of a priori knowledge of the chronological order of these time instants to be optimized. Nevertheless, due to the independence of these two types of switching instants, the temporal sequence between the control switching points and the switching times of the subsystems cannot be known in advance. Thus, using this method to solve Problem (P1) must require the switching of the subsystem be accompanied by the switching of control, i.e., \(t_{j}=\tau _{0}^{j+1}\), \(j=1,\ldots , N\). In other words, the prior knowledge of the chronological order of these time instants \(\{t_{0},\tau _{1}^{1},\ldots ,\tau _{p_{1}1}^{1},t_{2},\ldots ,t_{N1}, \tau _{1}^{N},\ldots ,\tau _{p_{N}1}^{N},t_{N}\}\) is essential. This clearly violates the independent nature between these two types of switching instants.
To overcome these shortcomings, we will design a new method to solve Problem (P1), which enables adaptive optimization of the selection of unknown switching time sequences as in [24].
3.1 A new numerical solution procedure
For Problem (P1), the switching instant vector τ and the control function \(\boldsymbol {u}(t)\) need to be optimized jointly. Initially, we employ the timescaling transformation to the subsystem which involves τ, while keeping \(\boldsymbol {u}(t)\) temporarily unchanged. This process leads to the formulation of a new optimal control problem. Following this, we implement the control parameterization for \(\boldsymbol {u}(t)\) within the newly defined time domain and subsequently utilize the timescaling transformation to handle the control switching times, thereby introducing an additional new time domain. The detailed procedure is given below.
Step 1. Timescaling transformation for switching time vector τ
For each \(\boldsymbol{\tau}=[t_{1},\ldots ,t_{N}]^{\top}\in \mathcal{T}\), define \(\boldsymbol{\theta}= [\theta _{1},\ldots ,\theta _{N}]^{\top}\in \mathbb{R}^{N}\), where \(\theta _{j}=t_{j}t_{j1}\ge 0\), \({j=1},\ldots ,N\), and \(\theta _{1}+\cdots +\theta _{N}=T\). Define Θ as the set comprising all such vectors \(\boldsymbol{\theta}\in \mathbb{R}^{N}\). By introducing a new time variable s, we establish the definition for the timescaling function \(\mu _{1}(s\mid \boldsymbol{\theta})\) such that
Here, \(\lfloor \cdot \rfloor \) represents the floor function. The choice of \(\theta _{{N+1}}\) is arbitrary since its value does not impact the result when \(s=N\). Under the effect of timescaling transformation, \(t = t_{j}\) are transformed into fixed points \(s = j\), \(j= 1, \ldots , N\). Figure 2 shows the transformation of the variable switching times to the fixed points on the time domain s through the timescaling function \(\mu _{1}(s\mid \boldsymbol{\theta})\) when \(N=4\). Accordingly, \(\boldsymbol {u}(t)\) is transformed into \(\boldsymbol {u}(\mu _{1}(s))\triangleq \boldsymbol {w}(s)\), which is called the transitional control function of \(\boldsymbol {u}(t)\). The switching system defined on the new time domain \([0,N]\) is
where \(\boldsymbol {y}(s)\triangleq \boldsymbol {x}(\mu _{1}(s))=\boldsymbol {x}(t)\) is the new state vector of the time variable s.
Step 2. Control parameterization applied to \(\boldsymbol {w}(s)\)
We divide the time interval \([0,N]\) into p subintervals with \(p+1\) partition points denoted by \(s_{0},s_{1},\ldots ,s_{p}\), satisfying \(0=s_{0}< s_{1}<\cdots <s_{p}=N\) as shown in Fig. 3. Note that we introduce only one hyperparameter p compared with the method in [18] (see Fig. 1). Define Ξ as the set comprising all such vectors \(\boldsymbol{\xi}=[s_{0},s_{1},\ldots ,s_{p}]^{\top}\in \mathbb{R}^{p}\), where \(s_{k}, k=1,\ldots ,p\), are the switching times of the transitional control function \(\boldsymbol {w}(s)\). Accordingly, \(\boldsymbol {w}(s)\) is approximated by
where \(\boldsymbol{\rho}_{k}=[\rho _{k}^{1},\ldots ,\rho _{k}^{m}]^{\top}\) is the approximate value of the transitional control \(\boldsymbol {w}(s)=[w_{1}(s),\ldots ,w_{m}(s)]^{\top}\) on the kth subinterval. Define Δ as the set comprising all such vectors \(\boldsymbol{\rho}=[\boldsymbol{\rho}_{1}^{\top},\ldots ,\boldsymbol{\rho}_{p}^{\top}]^{\top}\) and let \(\chi _{[s_{k1},s_{k})}(s)\) be defined by
The switching system (4)–(5) defined on the interval \([0,N]\) becomes
Step 3. Timescaling transformation applied to the control switching times in ξ
For each \(\boldsymbol{\xi}=[s_{0},s_{1},\ldots ,s_{p}]^{\top} \in \Xi \), define \(\boldsymbol{\sigma}=[\sigma _{1},\dots ,\sigma _{p}]^{\top} \in \mathbb{R}^{p}\), where \(\sigma _{k}=s_{k}s_{k1}>0\), \(k=1,\ldots ,p\), and \(\sigma _{1}+\cdots +\sigma _{p}=N\). Define Σ as the set comprising all such vectors \(\boldsymbol{\sigma}\in \mathbb{R}^{p}\). By introducing a new time variable v, we establish the definition for the timescaling function \(\mu _{\mathtt{2}}(v \boldsymbol{\sigma})\),
The above transformation maps variable times \(s=s_{k}\) to fixed times \(v=k\), \(k=1,\ldots ,p\). Also \(\boldsymbol {y}(s)=\boldsymbol {y}(\mu _{2}(v))\triangleq \boldsymbol {z}(v)\), which is the new state vector of the time variable v. Accordingly, the switching system (7)–(8) becomes
Denote \(\boldsymbol {z}(\cdot \boldsymbol{\theta}, \boldsymbol{\sigma}, \boldsymbol{\rho})\) as the solution of (9)–(10). Based on Assumptions A1–A2, we can show that the system possesses a unique solution for every permissible \((\boldsymbol{\theta},\boldsymbol{\sigma}, \boldsymbol{\rho})\) within the set \((\Sigma , \Theta , \Delta )\) [20]. Problem (P1) is approximated as the following nonlinear programming problem.
Problem (P2)
Given system (7)–(8), find \(\boldsymbol{\theta}\in \Theta \), \(\boldsymbol{\sigma}\in \Sigma \), \(\boldsymbol{\rho}\in \Delta \), such that the cost function
is minimized subject to the canonical constraints
3.2 The switching times analysis
After making the above approximation to Problem (P1), the original switching time vector τ is transformed into the duration θ between two successive subsystem switching points, while the switching times for the control function \(\boldsymbol {u}(t)\) are transformed into the control height ρ and the duration σ between two successive control switching knots. Here, ρ, σ, and θ are new decision vectors to be optimized. Once the optimal solution \((\boldsymbol{\rho}^{\ast},\boldsymbol{\sigma}^{\ast },\boldsymbol{\theta}^{\ast })\) is obtained by solving Problem (P2), we can derive the switching times of the subsystem and the control on the original time interval \([0,T]\).
To be specific, the optimal switching times, \(t_{j}^{*}, j=1,\ldots ,N\), of the subsystem can be readily calculated by using the timescaling function \(\mu _{1}(s\mid \boldsymbol{\theta}^{*})\) and setting \(s=1,\dots ,N\). However, determining the switching times of \(\boldsymbol {u}(t)\) necessitates the following procedure:

(i)
Use the timescaling function \(\mu _{2}(v\mid \boldsymbol{\sigma}^{*})\) and set \(v=1,\dots ,p\). This results in the optimal switching times of \(\boldsymbol {w}(s)\), denoted as \(s_{k}^{*}, k=1,\dots ,p\), according to the time variable s within the interval \([0, N]\);

(ii)
Use the timescaling function \(\mu _{1}(s\mid \boldsymbol{\theta}^{*})\) and set \(s=s_{1}^{*},\dots ,s_{p}^{*}\). The optimal switching times of \(\boldsymbol {u}(t)\), \(\tau _{k}^{*}=\mu _{1}(s_{k}^{*}\mid \boldsymbol{\theta}^{*})\), \(k=1,\dots ,p\), are determined. Let \(\boldsymbol{\tau}^{1,*}=[\tau _{1}^{*},\ldots ,\tau _{p}^{*}]^{\top}\) represent the control switching times.
Note that \(\boldsymbol{\tau}^{*}=[t_{1}^{*},\ldots ,t_{N}^{*}]^{\top}\) and \(\boldsymbol{\tau}^{1,*}=[\tau _{1}^{*},\ldots ,\tau _{p}^{*}]^{\top}\) are selected adaptively, being carried out under the condition that the subsystem switching times and the control switching times are mutually independent, as illustrated in Fig. 4. Moreover, it is worth noting that compared to Fig. 1, there is only one hyperparameter p.
4 Gradient computation
Problem (P2) can be addressed through the application of gradientbased nonlinear optimization algorithms. To accomplish this, it is necessary to calculate the gradients of both the cost and constraint functions, where the used gradient computational method is the variational method. The theorem below provides the partial derivatives of the state at θ.
Theorem 1
For each \((\boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\),
\(\boldsymbol{\Lambda}(\cdot \mid \boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\) is the solution of the following variational system on \(v\in [k1,k)\), \(k=1,\ldots ,p\):
Proof
The proof closely resembles that presented in Theorem 1 of [29] and is consequently omitted. □
Utilizing the chain rule, the theorem below provides the gradients of \(g_{l}(\boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\) at \(\boldsymbol{\theta}, l=0,1,\ldots ,N_{b}+N_{d}\).
Theorem 2
For each \(l=0,1,\ldots ,N_{b}+N_{d}\), the gradient of \(g_{l}\) in terms of θ, are given by
Proof
The proof is derived by using the chain rule to the cost/constraint functionals in conjunction with Theorem 1. □
Likewise, the derivatives of the cost/constraint functions in terms of ρ can be computed.
Theorem 3
For each \((\boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\),
where \(\boldsymbol{\Upsilon}(\cdot \mid \boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\) is the solution of the following variational system on \(v\in [k1,k)\), \(k=1,\ldots ,p\),
Utilizing the chain rule, the theorem below provides the gradients of \(g_{l}(\boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\) at ρ.
Theorem 4
For each \(l=0,1,\ldots ,N_{b}+N_{d}\), the gradient of \(g_{l}\) in terms of ρ, are given by
Regarding the gradients of the cost/constraint functions in terms of σ, the derivation is more intricate, as discussed in [24]. To begin, we provide the inverse function of \(\mu _{2}(v\mid \boldsymbol{\sigma})\),
where \(k=2,\dots ,p\). The switching times of subsystems in the time domain v, denoted as \(\mu _{2}^{1}(s\mid \boldsymbol{\sigma})\), are dependent on σ. At each junction point \(\mu _{2}^{1}(\mathtt{h})\) where \(\mathtt{h}=1,\dots ,N1\), coinciding with any \(v=1,\ldots ,p1\), the inverse function is nondifferentiable.
It is worth noting that, for each integer \(\mathtt{h}=1,\dots ,N\) in the time domain s, there exists a unique \(q\in{{1},\dots , p}\) such that \(\mu _{2}^{1}(\mathtt{h}1)\in [q1,q)\). Let \(v_{\mathtt{h}}\) represent \(\mu _{2}^{1}(\mathtt{h})\) for \(\mathtt{h}=1,\dots ,N\). The partial derivatives of \(v_{\mathtt{h}}\) in terms of \(\sigma _{k}, k=1,\ldots ,p\), are provided for each \(\mathtt{h}=1,\ldots , N1\).
Case 1. When the point \(v_{\mathtt{h}}\) aligns with any \(v=\mathtt{1},\ldots ,p1\):
Case 2. We have \(\frac{\partial v_{\mathtt{h}}^{+}}{\partial \boldsymbol{\sigma}}= \frac{\partial v_{\mathtt{h}}^{}}{\partial \boldsymbol{\sigma}}\) when \(v_{\mathtt{h}}\) does not align with any \(v=1,\ldots ,p1\).
Theorem 5
For each \((\boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\),
where \(\boldsymbol{\Psi}(\cdot \boldsymbol{\theta},\boldsymbol{\sigma},\boldsymbol{\rho})\) is the solution of the following variational system on \(v\in [k1,k)\), \({k=1},\ldots ,p\):
and
while
and
Furthermore, for each \(l=0,1,\ldots ,N_{b}+N_{d}\), the partial derivative of \(\bar{g}_{l}\) in terms of σ is given by
The definitions of \(H_{\mathtt{h},\mathcal{L}_{l}}^{}\) and \(H_{\mathtt{h},\mathcal{L}_{l}}^{+}\) are analogous to those of \(H_{\mathtt{h},\boldsymbol {f}}^{}\) and \(H_{\mathtt{h},\boldsymbol {f}}^{+}\).
5 Illustrative example
To showcase the efficacy of the proposed approach, we examine two representative examples. We employ the FminconSQP optimization solver in MATLAB R2022a to address our problem. The ordinary differential equations (ODEs) are solved using the fourthorder Runge–Kutta method with a step size of 10^{−2}. The calculation of cost and constraint integrals is performed using Simpson’s rule, with a step size of 10^{−2} as well. All numerical experiments are conducted on a computer with a CPU and RAM of 3.60 GHz and 16 GB, respectively.
Example 5.1
Consider a nonlinear switching system, as detailed in [8], composed of three subsystems described as follows:

subsystem 1:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=x_{1}(t)+2x_{1}(t)u(t), \\ \dot{x}_{2}(t)=x_{2}(t)+x_{2}(t)u(t), \end{cases} $$(11) 
subsystem 2:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=x_{1}(t)3x_{1}(t)u(t), \\ \dot{x}_{2}(t)=2x_{2}(t)2x_{2}(t)u(t), \end{cases} $$(12) 
subsystem 3:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=2x_{1}(t)+x_{1}(t)u(t), \\ \dot{x}_{2}(t)=x_{2}(t)+3x_{2}(t)u(t). \end{cases} $$(13)
Let \(t_{0} = 0\) and \(t_{f} = 3\), and assume that the system switches at \(t = t_{1}\) from subsystem 1 to subsystem 2 and at \(t = t_{2}\) from subsystem 2 to subsystem 3 (\(0 < t_{1} < t_{2} < 3\)). Our objective is to determine the optimal switching instants \(t_{1}\), \(t_{2}\) and the optimal input u to minimize the cost functional
Here, \(\boldsymbol {x} (0)=[1, 1]^{\top}\).
First, we apply the new approach to solve this problem using 3, 4, and 5 partitions for the control function within the time interval of \([0, 3]\). For comparison, we also consider using the conventional timescaling transformation to solve this problem. As stated in Sect. 3, this method requires that \(p_{1}=p_{2}=p_{3}\) (\(p\triangleq \sum_{j=1}^{3}p_{j}\) must be a multiple of N). However, a crucial distinction between them is that the timescaling method requires that the system switching times and discrete time knots of the control space coincide, resulting in the computational combinatoric explosion. On the other hand, the proposed method can effectively avoid the above deficiency by allowing the system switching to be independent of the control switching. To continue, when applying the timescaling method, we select \(p= 3, 6, 9\) with equal partition numbers (\(p_{1}=p_{2}=p_{3}\)). The corresponding optimal results obtained using these two methods are listed in Table 1. The optimal control are shown in Figs. 5–7, where the two red vertical lines represent \(t=t_{1}^{\star}\) and \(t=t_{2}^{\star}\), respectively; \(t_{1}^{\star}\) and \(t_{2}^{\star}\) are the optimal switching times of the subsystem.
Table 1 reveals that the optimal cost, 3.6809, obtained by doubling p from 3 to 9 using the timescaling method is inferior to the result obtained by using the proposed method for \(p=5\), which indicates the effectiveness of our method in eliminating unnecessary partitions. Figure 5 shows that the timescaling method necessitates the optimal control switches at \(t_{1}^{\star}\) and \(t_{2}^{\star}\), while our method has no such restriction. Furthermore, in Fig. 7, the optimal number of switches of the control \(\boldsymbol {u}^{\star}\) on each subinterval \([t_{i1}, t_{i}]\), \(i = 1, 2, 3\), is given in advance and is equal. However, in Fig. 6, the optimal number of switches of the control \(\boldsymbol {u}^{\star}\) on each subinterval is determined by the adaptive optimization. This demonstrates our method can achieve the adaptive selection of the number of control segments within each subinterval \([t_{i1}, t_{i}]\), \(i = 1, 2, 3\), whereas the timescaling method lacks this flexibility.
Example 5.2
In this problem [18], a nonlinear switching system with three subsystems is defined over the time domain \([0,3]\):

subsystem 1:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=x_{1}(t)+u(t)\sin (x_{1}(t)), \\ \dot{x}_{2}(t)=x_{2}(t)+u(t)\cos (x_{2}(t)), \end{cases} $$(15) 
subsystem 2:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=x_{2}(t)+u(t)\sin (x_{2}(t)), \\ \dot{x}_{2}(t)=x_{1}(t)+u(t)\cos (x_{1}(t)), \end{cases} $$(16) 
subsystem 3:
$$ \textstyle\begin{cases} \dot{x}_{1}(t)=x_{1}(t)u(t)\sin (x_{1}(t)), \\ \dot{x}_{2}(t)=x_{2}(t)+u(t)\cos (x_{2}(t)), \end{cases} $$(17)
The initial conditions are
The system undergoes a switch at \(t = t_{1}\) from subsystem 1 to subsystem 2 and at \(t = t_{2}\) from subsystem 2 to subsystem 3 (\(0 < t_{1} < t_{2} < 3\)). We aim to determine the optimal switching instants \(t_{1}\), \(t_{2}\), and the optimal input u that minimize the cost function
Note that the cost function contains the state \(x_{1}(t_{1})\) at the switching time \(t=t_{1}\).
We use the proposed method and the timescaling technique to solve this problem. The optimal results are listed in Table 2. The optimal controls are depicted in Figs. 8–9, with the two red vertical lines denoting \(t=t_{1}^{\star}\) and \(t=t_{2}^{\star}\) correspondingly. Here, \(t_{1}^{\star}\) and \(t_{2}^{\star}\) are the optimal switching times of the subsystem.
It can be seen from Table 2 that when \(p=6\) and \(p=9\), the optimal costs obtained by the proposed method both are obviously better than the optimal costs obtained by the timescaling method. Figure 8 when compared with Fig. 9 also shows that our method can avoid the limitation that the switching of the subsystem must be accompanied by the switching of the control, and allows for the adaptive determination of the number of control segments within each subinterval.
6 Conclusion
We considered a type of optimal control problems involving the switched system with a prespecified sequence of subsystems. We then highlighted the limitations of the conventional timescaling transformation used in solving this type of optimal control problems. Subsequently, we propose a novel method to overcome the existing shortcomings of the conventional time scaling transformation, where the control switching times and system switching moments are sequentially selected independently. Notably, in the proposed method, we introduced only one hyperparameter, reducing the need for extensive parameter tuning, thus improving overall efficiency. Two numerical examples are solved and the results obtained clearly illustrate the effectiveness of the new approach. In future studies, the proposed method can also be considered to solve problems involving the switching timedelay system and the switching timedependent state system.
Data availability
No datasets were generated or analysed during the current study.
References
Wei, S., Uthaichana, K., Zefran, M., DeCarlo, R.: Hybrid model predictive control for the stabilization of wheeled mobile robots subject to wheel slippage. IEEE Trans. Control Syst. Technol. 21, 2181–2193 (2013)
Li, C., Guo, S.: Adaptive multimode switching strategy for the spherical underwater robot with hybrid thrusters. Adv. Eng. Inform. 55, 101845 (2022)
Wang, C., Fu, S., Zhang, L., Jiang, Y., Shu, Y.: Optimal control of sourceloadstorage energy in DC microgrid based on the virtual energy storage system. Energy Rep. 9, 621–630 (2023)
Chen, Z., Niu, B., Zhang, L., Zhao, J., Ahmad, A.M., Alassafi, M.O.: Command filteringbased adaptive neural network control for uncertain switched nonlinear systems using eventtriggered communication. Int. J. Robust Nonlinear Control 32, 6507–6522 (2022)
Sun, G.X., Alpcan, T.S., Rubinstein, B.I.P., Camtepe, S.: A communication security game on switched systems for autonomous vehicle platoons. In: Proceedings of the 60th IEEE Conference on Decision and Control, Austin, Texas (2021)
Yong, J.: Systems governed by ordinary differential equations with continuous, switching and impulse controls. Appl. Math. Optim. 20, 223–235 (1989)
Sussmann, H.J.: A maximum principle for hybrid optimal control problems. In: Proceedings of the 38th IEEE Conference on Decision and Control, Phoenix, AZ (1999)
Xu, X., Antsaklis, P.J.: Optimal control of switched systems via nonlinear optimization based on direct differentiation of value functions. Int. J. Control 75, 1406–1426 (2002)
Gonzalez, H., Vasudevan, R., Kamgarpour, M., Sastry, S.S., Bajcsy, R., Tomlin, C.: Optimal control of switched systems via nonlinear optimization based on direct differentiation of value functions. In: 49th IEEE Conference on Decision and Control, pp. 7519–7526 (2010)
Gonzalez, H., Vasudevan, R., Kamgarpour, M., Sastry, S.S., Bajcsy, R., Tomlin, C.: A descent algorithm for the optimal control of constrained nonlinear switched dynamical systems. In: Proceedings of the 13th ACM International Conference on Hybrid Systems: Computation and Control, pp. 51–60 (2010)
Axelsson, H., Wardi, Y., Egerstedt, M., Verriest, E.: Gradient descent approach to optimal mode scheduling in hybrid dynamical systems. J. Optim. Theory Appl. 136, 167–186 (2008)
Egerstedt, M., Wardi, Y., Axelsson, H.: Transitiontime optimization for switchedmode dynamical systems. IEEE Trans. Autom. Control 51, 110–115 (2006)
Liu, C.Y., Loxton, R., Teo, K.L.: Switching time and parameter optimization in nonlinear switched systems with multiple timedelays. Nonlinear Anal. Hybrid Syst. 163, 957–988 (2014)
Xu, X.: Analysis and design of switched systems. PhD thesis, University of Notre Dame (2001)
Feng, Z.G., Teo, K.L., Rehbock, V.: A discrete filled function method for the optimal control of switched systems in discrete time. Optim. Control Appl. Methods 30, 585–593 (2009)
Zhu, F., Antsaklis, P.J.: Optimal control of hybrid switched systems: a brief survey. Discrete Event Dyn. Syst. 25, 345–364 (2015)
Xu, W., Feng, Z.G., Peng, J.W., Yiu, K.: Optimal switching for linear quadratic problem of switched systems in discrete time. Automatica 78, 185–193 (2017)
Li, R., Teo, K.L., Wong, K.H., Duan, G.R.: Control parameterization enhancing transform for optimal control of switched systems. Math. Comput. Model. 43, 1393–1403 (2006)
Lee, H.W.J., Teo, K.L., Rehbock, V., Jennings, L.S.: Control parametrization enhancing technique for timeoptimal control problems. Dyn. Syst. Appl. 6, 243–262 (1997)
Teo, K.L., Li, B., Yu, C.J., Rehbock, V.: Applied and Computational Optimal Control: A Control Parameterization Approach. Springer, Berlin (2021)
Yuan, J., Wu, C., Liu, C., Teo, K.L., Xie, J.: Robust suboptimal feedback control for a fedbatch nonlinear timedelayed switched system. J. Franklin Inst. 360, 1835–1869 (2023)
Teng, N., Zhai, J., Yin, H., Feng, E.M., Liu, C.Y.: The uncoupled microbial fedbatch fermentation optimization based on statedependent switched system. Int. J. Biomath. 14, 1–22 (2021)
Loxton, R., Lin, Q., Teo, K.L.: Switching time optimization for nonlinear switched systems: direct optimization and the timescaling transformation. Pac. J. Optim. 10, 537–560 (2014)
Zhu, X., Yu, C.J., Teo, K.L.: Sequential adaptive switching time optimization technique for optimal control problems. Automatica 146, 110565 (2022)
Zhu, X., Yu, C.J., Teo, K.L.: A new switching time optimization technique for multiswitching systems. J. Ind. Manag. Optim. 19, 2838–2854 (2023)
Li, R., Feng, Z.G., Teo, K.L., Duan, G.R.: Applied and computational optimal control: a control parameterization approach. Math. Comput. Model. 48, 468–479 (2008)
Li, L.N., Zhang, C.J.Y.N., Bai, Y.Q.: A timescaling technique for timedelay switched systems. Discrete Contin. Dyn. Syst., Ser. S 13(6), 1825–1843 (2020)
Zhang, N., Yu, C.J., Xie, F.S.: The timescaling transformation technique for optimal control problems with timevarying timedelay switched system. J. Oper. Res. Soc. China 8(2), 581–600 (2020)
Loxton, R., Teo, K.L., Rehbock, V.: Optimal control problems with multiple characteristic time points in the objective and constraints. Automatica 44, 2923–2929 (2008)
Acknowledgements
This work was supported by National Natural Science Foundation of China (No. 12271335), National Natural Science Foundation of China (No. 12171307), the Fundamental Research Grant Scheme of Malaysia [grant number FRGS/1/2021/STG06/SYUC/03/1] and was funded by Shanghai Key Laboratory of Pure Mathematics and Mathematical Practice (No. 22DZ2229014).
Funding
This work was supported by the Fundamental Research Grant Scheme of Malaysia (grant number FRGS/1/2021/STG06/SYUC/03/1), National Natural Science Foundation of China (No. 12171307); Moreover, this work was supported by National Natural Science Foundation of China (No. 12271335), and was funded by Shanghai Key Laboratory of Pure Mathematics and Mathematical Practice.
Author information
Authors and Affiliations
Contributions
These authors contributed equally to this work.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Zhu, X., Bai, Y., Yu, C. et al. A new computational approach for optimal control of switched systems. J Inequal Appl 2024, 53 (2024). https://doi.org/10.1186/s13660024031242
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s13660024031242