Mathematical Problems in Engineering

Volume 2016, Article ID 8325054, 8 pages

http://dx.doi.org/10.1155/2016/8325054

## Mathematical Modeling of Smart Space for Context-Aware System: Linear Algebraic Representation of State-Space Method Based Approach

Department of Electronic Engineering, Kwangwoon University, Seoul 139-701, Republic of Korea

Received 28 August 2015; Revised 16 February 2016; Accepted 14 March 2016

Academic Editor: Mustafa Tutar

Copyright © 2016 Sung-Hyun Yang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

A smart space is embedded with several components such as sensors, actuators, and computing devices that enable the sensing and control of the environment, and the inhabitants interact with the devices in the smart space whenever they need to. To model a smart space, a dynamic relationship needs to be established among the elements of the space whereby the interactions with devices are considered a dynamic-process state. In this paper, a linear model of a smart space is presented using a state equation, where the two coefficient matrices and need to be defined to model the smart space, and the coefficient matrix is used to determine the states of the devices; similarly, the situation of the smart space is determined using coefficient . An algorithm is presented to make a linear model from the logical functions that are used to describe the system. This model is flexible in terms of the control of the smart-space environment because the environmental factors are represented by a matrix element. This linear smart-space model is helpful for the control of a context-aware system, and we use an example to illustrate the effectiveness of the proposed model.

#### 1. Introduction

The mathematical modeling of a system is the most important step in the design of a control system, as it represents the behavior of a system in response to the changes of states and inputs. The following are the two modeling approaches for linear systems: the transfer-function approach and the state-space approach [1]. Out of the two approaches, the state-space approach is used to represent a dynamic system. The important feature of the state-space approach is the usage of first-order differential/difference equations to represent systems. The behavior of the system can be predicted by solving the differential/difference equations that are used for modeling.

A smart space is composed of a number of components such as sensors, actuators, and computing devices that enable the sensing and control of the environment. The goal of the smart space is to collect the environmental information and provide service automatically for user’s comfort and safety [2]. In a smart space, users generally interact with various devices according to their needs, and these interactions can be considered a dynamic-process state. The next states of the devices can be described using the information regarding the current states of the devices and control inputs; in terms of the smart space, its situation can be described according to the current device states. The aim of this paper is to generalize the smart-space domain through linear modeling by using a state equation. This linear model describes the relations between the next states of devices and the current states of devices along with the control inputs and between the current states of devices and the situations. Several algorithms were proposed to implement context-aware systems using knowledge and resources such as production rules (if-then relationships), neural networks, support vector machines, fuzzy logic, Bayesian networks, and Hidden Markov Model [3–6]. In [7], the author proposed a unified and mathematically compatible method for logic-based intelligent system. However, this method requires special knowledge on mathematical logic and most of the deductions are tricky. Logic-based system used the logical function sets to show the relations between the states of devices and the control inputs and between the states of devices and the smart-space situation. The matrix expression is very convenient in logic inference because it converts the problem to solving linear algebraic equation. In this paper, we have presented an algorithm to convert these logical functions into a linear algebraic equation using the Sum of Products (SOP) canonical form and logic vector. The proposed smart-space linear model can be helpful for the control of a context-aware system because all of the variables are expressed by a matrix element and the relation between every variable is expressed by a coefficient matrix.

The rest of the paper is organized as follows: Section 2 presents an algorithm to convert a logic function into a linear algebraic equation; Section 3 illustrates the mathematical modeling of a smart space; and Section 4 presents an example to illustrate the effectiveness of the smart-space model, followed by the conclusion and a discussion of future work in Section 5.

#### 2. Linear Algebraic Representation of Logic Function

Generally, a smart space can be described by logic expressions and logic related special knowledge needs to control the environment. If logic expressions are converted into algebraic equation, then control can be done effectively by manipulating matrix elements. To develop a linear model, we need conversion of logic expression into algebraic equations. Edwards uses a canonical form to express Boolean functions in matrix algebra [8]. This approach is different from “conventional” matrix algebra, as it requires the “unit” matrix for multiplication operations. Authors in [9] proposed the usage of a semitensor product to represent Boolean functions in an algebraic form. In this paper, we have proposed an algorithm using Sum of Products (SOP) canonical form and logic vector (th column of an identity matrix) as logic value to represent the logic functions in the algebraic equations. Using this approach, the logic function has been represented similarly to its representation in conventional algebra, as follows:where is called the coefficient matrix that defines the logic function(s) and and are the input and output vectors, respectively.

##### 2.1. Single Logic Function

In this section, a single logic function has been converted into a linear algebraic equation. Consider the following Boolean-logic function:Any Boolean function can be expressed as a Sum of Products (SOP) in a canonical form, as follows:Equation (3) can be represented in a matrix form, as follows:where is the coefficient matrix that holds the values of all of the minterms of the logic function, while the vector holds all of the minterms. The order of the matrix and vector terms must be adhered to.

The th column of an identity matrix is used to represent the logic value in the logic equations [9]. Considering the identity matrix, in terms of Boolean values. True (1) and False (0) are represented as and , respectively. If there are variables, then the Boolean function is a logical mapping from a set of to .

Assuming that and are two logic variables that are represented as and , with and , then the Kronecker product of the two logic variables is calculated in the following way:Equation (5) shows that the Kronecker product between two logic variables represents all of the minterms; similarly, the following can also be shown: The coefficient matrix elements () consist of two values , where and are the substituting values, and the dimension of the coefficient matrix is equal to 2-by-, where is the number of logic variables: From (4), and using (6), it can be written as the following:where with . In the previously mentioned section, a single logic function is converted into an algebraic equation, whereas the next section will present multiple logic functions.

##### 2.2. Multiple Logic Functions

Consider the following Boolean-logic functions:Equation (8) can be expressed as the SOP in a canonical form:Equation (10) can be represented by linear equations akin to (4):All of the elements of the coefficient matrix and in (10) are represented by , , with , and , and are expressed as follows:By applying the Khatri-Rao product () between all of the coefficient matrices, we can obtain the coefficient matrix for (12) [10]. The dimensions of coefficient matrix are equal to -by-, where is the number of logic functions and is the number of logic variables, as follows:Applying the Kronecker product () on the left side of (12), From (12), the usage of (6), (13), and (14) can be written as the following:

#### 3. Linear Modeling of a Smart Space

Smart space is set up with the sensors and several devices. In this section, we have presented the linear model of a smart space. In a smart space, an inhabitant interacts with several devices through the combinational state of devices, and each device can be operated in two states. The next state of a device can be described by the logical function of the current states of the device and its input information about the environment. The situation of a smart space at any time is described by the combination of the states of the devices at that time. The sensor network in a smart space is used to collect the input data about the environment which is needed to represent a space state. The next states of the devices can be expressed as the following:where , , and , , are the states of the devices and , , are the inputs that represent the environment.

The situation of the smart space can be expressed as the following:where , , are the logical functions; , , are the states of the devices; and , , are the situations.

Using the procedure described in Section 2, the multiple logical functions expressed by (16) and (17) can be converted into standard discrete-time dynamic systems, as follows: where the matrices and are called the coefficients of the logical functions of (16) and (17), respectively. One has , , , and .

The input-state coefficient matrix () and the state-situation coefficient matrix () are matrix representations of the SOP of a logic variable that is used in logic expressions. Input (), state (), and output () vectors represent the possible control inputs, the states of the devices, and the situations in the smart space, respectively. A block diagram of the proposed linear model is shown in Figure 1.