1. Introduction
A spatially distributed system is a system whose state dynamically changes over time and space [
1,
2]. This system represents the temporal changes in the states of other related locations using measurement values collected at a specific location. Spatially distributed systems appear in various issues such as smart buildings, advanced road traffic systems, and vibration control [
3,
4,
5,
6]. Therefore, it is important to contemplate the control problem of spatiotemporal patterns in spatially distributed systems.
In recent years, temporal logic has been employed in control issues related to IoT and cyber-physical systems. Temporal logic is a logic system where the truth value of a proposition changes over time [
7]. In temporal logic, temporal operators are added to conventional logical operators, allowing the description of propositions in relation to time. In order to handle continuous signals, signal temporal logic (STL) has been proposed in [
8]. In STL, specifications of properties of dense time and real-valued signals can be described. Control methods using STL have been widely studied (see, e.g., [
9,
10,
11,
12,
13,
14,
15,
16]). Moreover, signal spatio-temporal logic (SSTL) has been proposed for spatially distributed systems [
17]. In SSTL, spatial operators are introduced to temporal logic. In [
18], SSTL has been applied to the monitoring and planning of robotic tasks. Furthermore, SSTL
f has been proposed in the case of finite traces [
6].
In [
6], the finite-time optimal control problem with SSTL
f formulas for spatially distributed systems is formulated and is reduced to a mixed-integer programming (MIP) problem. When the dynamics in a spatially distributed system are linear, this problem is reduced to a mixed integer linear programming (MILP) problem. However, in [
6], only the finite-time optimal control problem has been considered, and model predictive control (MPC) has not been focused on. MPC is a control method that generates the control input by solving the finite-time optimal control problem at each time and has various applications (see, e.g., [
19,
20,
21,
22,
23]). MPC for spatially distributed systems has been studied in, e.g., [
24]. To the best of our knowledge, MPC with spatio-temporal logical specifications for spatially distributed systems has not been studied.
In this paper, we propose a new method of MPC for spatially distributed systems. A control specification is described by an SSTL
f formula. We suppose that an SSTL
f formula is given for a sufficiently long time interval. An SSTL
f formula and spatial constraints in the finite-time optimal control problem are derived from a given SSTL
f formula. In the finite-time optimal control problem studied in this paper, an SSTL
f formula and spatial constraints are considered as a penalty in the cost function. Hence, the feasibility of the finite-time optimal control problem can be guaranteed. In other words, the control input can be necessarily generated. In a similar way to the method in [
6], the finite-time optimal control problem can be reduced to an MIP problem. The proposed method provides us with an efficient control method for complex systems.
This paper is organized as follows. In
Section 2, a spatially distributed system is introduced. In
Section 3, SSTL
f is summarized. In
Section 4, the finite-time optimal control problem is formulated. In
Section 5, the reduction of the finite-time optimal control problem to an MIP problem is explained. In
Section 6, a procedure of MPC is proposed. In
Section 7, a numerical example is explained to show the effectiveness of the proposed method. In
Section 8, we conclude this paper.
Notation: Let denote the set of real numbers. For the finite set A, let denote the number of elements in A.
2. Spatially Distributed Systems
Consider a multi-dimensional Euclidean space partitioned into a grid, represented as an undirected graph
, where
is the set of nodes and
is the set of edges. The state of the node
l at time
t is denoted by
. Let
denote the set of nodes without control inputs. Let
denote neighborhoods of the node
l. A discrete-time spatially distributed system on graph
is given by
where
is the control input (
is a set representing input constraints), and
is a real-valued continuous function. We suppose that the centralized controller calculates the control inputs by collecting the states.
3. SSTLf
We explain the syntax of SSTL
f (see [
6] for further details).
The syntax of SSTL
f is defined over a set of
m atomic predicates
An SSTL
f formula is recursively defined by the following syntax:
where
, and
are the SSTL
f fomula,
are times such that
, and
with
. Temporal operators
and
are called
eventually and
globally operators, respectively. Within the time interval
,
denotes that
is satisfied at least once, while
denotes that
is satisfied at all times. Spatial operators
and
are called
somewhere and
everywhere operators, respectively. Define
, where
denotes the distance between
l and
. The spatial operator
denotes that at least one node within
satisfies
, while
denotes that all nodes within
satisfy
.
For a given finite spatio-temporal trace
x, the satisfaction of an SSTL
f formula at the time
t and the location
l, which is denoted by
, is defined recursively as follows:
By utilizing SSTL
f formulas, control specifications for the system (
1) can be described.
4. Problem Formulation
The time interval for control is defined as . For this interval, we assume that the SSTLf formula is given as a control specification. In MPC, we solve the finite-time optimal control problem in the time interval , where t is the current time, and N is the prediction horizon. To generate the control input, this problem is solved until .
Assume that from the SSTL
f formula
, the SSTL
f formula
that should be satisfied in the time interval
can be derived. Assume also that from the SSTL
f formula
, the spatial constraint
at time
such that
is easily satisfied in the time interval
can be derived. Let
and
denote binary variables, where
(
) is 1 if
(
) is true, otherwise 0 (see also
Section 5.1).
Under these preparations, consider the following finite-time optimal control problem.
Problem 1. For the system (1), suppose that the current time t, the current state , the previous control input (), the SSTLf formula , the spatial constraint , and the prediction horizon N are given. Then, find a control input sequence minimizing the following cost function:where , , and are time-varying weighting coefficients. The communication cost between the controller and the actuators can be reduced by introducing the term weighted by
in the cost function (
2).
We suppose that there is no constraint at time when Problem 1 is solved at some time t. Depending on a given SSTLf formula, when Problem 1 is solved at the next time , a constraint at time may be newly imposed. In such a case, Problem 1 at time may become infeasible. To overcome this technical issue, constraints related to the SSTLf formula are represented by using terms weighted by and . Hence, the feasibility of Problem 1 is always guaranteed. There is a possibility that the SSTLf formula is not satisfied. The SSTLf formula is satisfied as well as possible by adjusting and .
5. Reduction of Problem 1 to an MIP Problem
In this section, we consider reducing Problem 1 to an MILP problem.
First, we consider modeling the graph structure in the system (
1) and introducing binary variables. Next, we consider transforming an SSTL
f formula into a set of linear inequalities. See [
6] for further details. The procedure of transforming a logic formula into linear inequalities has been widely studied. See, e.g., [
25,
26] for further details.
5.1. Introduction of Binary Variables
Consider the system (
1). For each
, introduce
binary vectors
. Here,
, meaning the
i-th element of
is 1, and for
,
. The matrix
is a matrix representing distances, where the
-th element
is given by
where
is a sufficiently large positive number such that
. To convert SSTL
f expressions into linear inequalities, introduce the following binary variables
for each
and
, where
represents an SSTL
f expression. For a given spatiotemporal trace
x,
5.2. Atomic Predicates, Boolean Operators
Next, we consider converting atomic predicates and Boolean operators into linear inequalities.
Consider an atomic predicate
. The satisfaction of
is represented as
where
is a sufficiently large positive number compared to the maximum value of
for
, and
is a sufficiently small number.
Next, we consider converting Boolean operators into linear inequalities. Let
denote the logical operator representing negation. Then, we can obtain
Let
denote the logical operator representing conjunction Then, we can obtain
Let
denote the logical operator representing logical disjunction. Then, we can obtain
Thus, any Boolean operators can be converted into linear inequalities as described above.
5.3. Temporal Operators
Next, we consider transforming temporal operators into linear inequalities for finite traces over . We remark that there are instances where temporal operators change within the time interval for control and the actual computation interval for prediction .
Consider the global operator
with
. Then, over the time interval
,
represents the logical conjunction of
. In this case, we can obtain
For the global operator, the linear inequalities remain unchanged within the prediction interval as well.
Consider the eventual operator
with
. Then, over the time interval
,
represents the logical disjunction of
. In this case,
Also, when
in the predicted interval
, or when
and
, there are no constraints imposed by the temporal operator. Specifically, if
and
with
, there are no constraint conditions even beyond
into the future. Also, we can obtain
5.4. Spatial Operators
Third, we consider converting spatial operators into linear inequalities. The ‘somewhere’ operator
can be represented by
The ‘everywhere’ operator
can be represented by
5.5. MIP Problem
Let denote the linear inequalities obtained by transforming the SSTLf formula using the above method. Problem 1 can be equivalently reduced to the following MIP problem.
Problem 2. Suppose that the current time t, the current state , and the previous input are given. Then, find a control input sequence minimizing the cost function (2) subject to conditions of and . If the function
in the system (
1) is linear with respect to the state and the control input, then Problem 2 is an MILP problem.
6. Model Predictive Control
In this section, we propose a procedure of MPC using Problem 1. MPC is a control method where the control input is generated by solving the finite-time optimal control problem. We can obtain a time sequence of the control input by solving the finite-time optimal control problem. In the conventional MPC, the first one in the obtained input sequence is applied to the plant.
When a control specification is given by an SSTLf formula, a control specification is changed at each time, because the time interval considered in the finite-time optimal control problem is shifted. Hence, a procedure of MPC under an SSTLf formula is different from that of the conventional MPC. Based on this fact, we propose a procedure of MPC using Problem 1.
Procedure for model predictive control:
Step 1: Set , , and an SSTLf formula.
Step 2: Derive an SSTLf formula and spatial constraints at time t from a given SSTLf formula.
Step 3: Solve Problem 2.
Step 4: Apply the control input obtained by solving Problem 1.
Step 5: Measure .
Step 6: Update . If , then the procedure is terminated, otherwise go to Step 2.
Since Problem 2 is always feasible, we can guarantee that the control input until is calculated.
7. Numerical Example
Consider a room in a 2-dimensional Euclidean space with seven heaters and two windows, where the temperature distribution is controlled according to specifications described by an SSTL
f formula. The room is partitioned into a
grid, and is modeled by an undirected graph.
Figure 1 illustrates the room setup for this simulation. By the discretization of the heat conduction equation, the dynamics of the room temperature are derived as follows:
where
denotes the temperature of the location
l at time
t,
is the set of partitioned areas (
), and
,
V, and
W are constant. See [
6] for further details. In this simulation, we set
,
, and
We also set
,
, and
.
The atomic propositions
are defined as
and
. We give two control specifications. The first specification is that the temperature in the locations where people are present and their surroundings must be between 18 °C and 22 °C. The second specification is that in the specified location
and its surroundings, there must be at least one location where the temperature is between 18 °C and 22 °C at least once during the time interval
. These specifications are represented by the following SSTL
f formulas (
):
The number of spatial constraints is four. The following four spatial constraints are imposed for Problem 1:
We consider
as an example of transforming a spatial constraint into linear inequalities. This constraint can be rewritten as
which is equivalent to the following linear inequalities:
We remark that these spatial constraints are not necessarily satisfied at each time because these constraints are considered as the penalty in the cost function. For
in the cost function (
2), consider two cases: (i)
and (ii)
, where
,
,
, and
. Other coefficients
and
are set as
and
, respectively. These are set through a trial and error process. One of the future efforts is to design these function/parameters in a systematic way.
In addition, when Problem 1 is solved at the initial time, no SSTL
f formula is imposed. For example, at time 10, the following SSTL
f formula is considered as a control specification (note that the prediction horizon
N is given by
):
If
is not satisfied until time 83, then after time 84, we impose the constraint that this spatial constraint is satisfied at least one time.
We present the computation result.
Figure 2 and
Figure 3 show control inputs in two cases. From these figures, we see that the control inputs are changed to satisfy constraints depending on
.
Next, we check whether the constraints are satisfied or not.
Figure 4 and
Figure 5 show whether constraints are satisfied or not in two cases. From
Figure 4, we see that constraints are not satisfied at locations
and
in the case of
. From
Figure 4, we see that this technical issue is overcome by introducing a time-varying weight. Furthermore, spaces and time intervals satisfying certain conditions are explicitly characterized. Based on this characterization, we validate the proposed approach. In Case (i), the percentage that certain conditions for space/time are satisfied is
. In Case (ii), this percentage is
. Thus, it becomes easier to satisfy the SSTL
f formula by introducing a time-varying weighting coefficient.
Finally, we comment the computation time for solving the problem at each time. The mean computation time and the worst computation time were 8.7 s and 29.4 s, respectively. Here, we used the computer with CPU: Intel Core i5-12600K 3.69 GHz and Memory: 16 GB, and used the CBC (COIN-OR Brand-and-Cut) 2.10.3 [
27]
https://github.com/coin-or/Cbc (accessed on 1 September 2024) as an MILP solver. Reducing the computation time is one of the future efforts.
8. Conclusions
In this paper, we proposed a new method of MPC for spatially distributed systems. A control specification is given by an SSTLf formula. To satisfy it, several conditions and time-varying weighting coefficients were introduced for the finite-time optimal control problem. The proposed method was demonstrated by a numerical example.
One of the future efforts is to develop a general procedure to derive constraint conditions and time-varying weighting coefficients in the finite-time optimal control problem. In addition, it is also important to apply the proposed method to practical and real systems. In order to implement practical and real systems, it is significant to develop a method to reduce the computation time for solving an MIP problem in spatially distributed systems.