1 Introduction

In recent years modeling, simulation and control of physical systems or processes have become crucial areas of active research. Increasing demands for reliable and detailed analysis of various practical problems has made numerical modeling and simulation of physical systems an important area of research. This is true for both analyses of the systems themselves through simulations, as well as fordesignofassociatedcontrollersforsystemorprocess control[1]. Moreover, most practical physical systems are governed by partial differential equations (PDEs) and are of high-dimensional in nature. They appear in various application areas, such as thermal processes, chemical processes, agricultural & biological systems, etc.[2, 3] These systems involve strong or weak interactions between different physical phenomena. Hence, lots of challenges are involved in modeling, simulation and controller design. In this work, modeling of a grain storage system is considered. Also, we have designed a controller to obtain an optimal input temperature such that the output humidity reaches to a desired profile.

The main objective of a good storage is to create suitable environmental conditions that provide protections to the grains or food products to maintain its quality and quantity. Health and quality of stored grain is mostly affected by attacks of insects, fungi, etc. The growth of insects can be controlled by controlling temperatures while controlled humidity can prevent the growth of mite, fungi. Hence, temperature as well as humidity plays very important role in storage systems[4]. Therefore, accurate predictions of them are quite necessary so that proper corrective actions can be taken.

Conducting experiments to study the moisture distributions in grain storage systems are expensive and time-consuming. Hence, numerical simulations can be performed to predict them. There are several numerical tools available for this purpose like, finite difference (FD), finite element (FE), boundary element (BE) methods, etc. The most popular method is FE method because of its several advantage[5]. However, this procedure is also time-consuming as the simulation time depends upon the number of nodes of the discretized model. To reduce the simulation time for this application, an equivalent model of reduced size can be developed which has almost same dynamic properties as the original one. Consequently model order reduction (MOR) is presently a very active area of recent research[6], for both linear as well nonlinear systems. The area of MOR for practical distributed systems has been extensively developed. Several reduction techniques are available for them like, singular value decomposition (SVD)[7], balanced truncation, Krylov subspace projection[811], proper orthogonal decomposition (POD) approach[1215], etc.

In this work, dynamic equations for moisture of a grain storage system are simulated and an equivalent model with lesser number of variables is obtained. The approach involved discretization of governing equations with FE method and obtaining a reduced nonlinear dynamic system of much smaller size with almost same dynamic property as the original using POD method. A controller based on optimal control theory[16] is designed for the reduced model so that the output reaches to a desired profile. It has also been shown that the controller acts fairly good for the original model as well. The paper is organized in the following way. In Section 2, the geometrical characteristics of the storage system are discussed in detail. FE modeling of the system is given in Section 3 and a reduced order model is developed in Section 4. A controller is designed in Section 5 and its stability is analyzed using Lyapunov stability criteria[17]. In Section 6, the numerical results are given and finally the paper is concluded with Section 7.

Table 1 Notations

2 Geometry and problem description

For the present work, we have considered a three dimensional grain storage system as shown in Fig. 1, similar to that considered in [18]. The axisymmetrical view can be obtained if the system is cut along z-axis. The total capacity of the system is about 1.25 tones and its dimensions are given in Fig. 1. The storage system is made of galvanized iron. The simulations are performed for environmental conditions of Konkan region where humidity levels are quite high. Special care should be taken while controlling the moisture levels. Hence, proper predictions of them are very important.

Fig. 1
figure 1

Three dimensional problem domain

3 Finite element modeling

The governing equation for moisture transport[19] within the storage system is given by

$${{\partial U} \over {\partial t}} + \nabla (U{u_w}) = \nabla D\nabla U.$$
(1)

The velocity u w can be written as

$${u_w} = - {k \over {{\mu _w}}}\nabla P.$$
(2)

The pressure can be rewritten as[19]

$$P = E(U - {U_{eq}}(T)).$$
(3)

The function U eq (T) can be taken as

$${U_{eq}}(T) \propto T.$$
(4)

The proportionality constant can be obtained using [20]. Hence, from (1)(3), we can write

$$\matrix{{{{\partial U} \over {\partial t}} = {{kE} \over {{\mu _w}}}\nabla (U\nabla (U - {U_{eq}}(T))) + \nabla D\nabla U = } \hfill \cr {{{kE} \over {{\mu _w}}}{\nabla ^2}U + \nabla D\nabla U.} \hfill \cr}$$
(5)

The gradient of moisture diffusion coefficient can be written as[21]

$$\nabla D = - {k_{{m^*}}}{{{\rm{d}}{M^*}} \over {{\rm{d}}x}}.$$
(6)

The activated moisture content M* can be calculated from Boltzmann distribution as

$${M^*} = U\exp \left({ - {{{E_b}} \over {RT}}} \right).$$
(7)

Here E b is calculated as

$${E_b} = 35\,800 - 290U.$$
(8)

Further,

$$\matrix{{{{{\rm{d}}{M^*}} \over {{\rm{d}}x}} \approx \,{{\partial {M^*}} \over {\partial U}}{|_{T = {\rm{const}}}}{{{\rm{d}}U} \over {{\rm{d}}x}} = } \hfill \cr {\left({{{RT + 290U} \over {RT}}} \right)\exp \left({ - {{{E_b}} \over {RT}}} \right).} \hfill \cr }$$
(9)

Now, combining (5) and (9)

$${{\partial U} \over {\partial t}} = \left({{{kE} \over {{\mu _w}}} - {k_{{m^*}}}({{RT + 290U} \over {RT}})\exp (- {{{E_b}} \over {RT}})} \right){\nabla ^2}U.$$
(10)

After applying FE method, a simplified model can be obtained as[5]

$$[C]{{\partial \bar U} \over {\partial t}} + [K]\bar U = \bar F{u_1}$$
(11)

where u 1 is an input function dependent on temperature (T).

4 Model order reduction

After obtaining the time-simulation of the system, a “snapshot matrix” S is formed. Response states of the simulated data are collected as columns of S. An orthogonal basis for this matrix is obtained through singular value decomposition (SVD), given as

$${V^{\prime}_1}S{V_2} = \Sigma $$

where \(V_1^{m \times m}\) is an orthogonal matrix whose columns constitute an orthonormal “output” basis vector of the matrix S m ×n. Similarly, columns of orthogonal \(V_2^{n \times n}\) matrix form orthonormal “input” basis vector of S and diagonal matrix gives the singular values arranged in decreasing order. If the first r singular values σ 1, σ 2, ⋯,σ r are considered significant, then the first r columns of V 1 taken as V r = [v 1, v 2, ⋯, v r ] form an orthogonal basis of the range space of the snapshot matrix S. As expected, the dimension r of this subspace is found to be much smaller than the number of state variables. Projecting the overall dynamics on this subspace, given by[22]

$$\bar X = {V_r}{\bar z_r}$$
(12)

leads to a much smaller nonlinear model that captures most of the significant dynamics. The reduced model is given by

$$[{C_r}]{{\partial \bar z} \over {\partial t}} + [{K_r}]\bar z = {\bar F_r}{u_1}$$
(13)

5 The control problem

Here we consider a control problem which transfers the initial humidity \({\bar U _0}\) to a desired humidity profile represented by a nodal vector \({\bar U^*}\). As the vector \({\bar U_0}\) and \({\bar U^*}\) lie in the span of projection matrix V r , the corresponding reduced states z 0 and z* can be derived using respectively.

$${\bar U_0} = {V_r}{z_0}$$
(14)
$${\bar U^*} = {V_r}{z^*}.$$
(15)

In case, the vectors \({\bar U_0}\) and \({\bar U^*}\) do not lie in the span of \({\bar V_r}\), then z 0 and z * will imply their respective least square approximations in the projected subspace.

5.1 Controller design

An optimal control based performance index can be taken as[2325]

$$J = {1 \over 2}e^{\prime}({t_f}){F_1}({t_f})e({t_f}) + {1 \over 2}\int_{{t_0}}^{{t_f}} {\left[ {z^{\prime}(t)Q(t)z(t) + u_1^2(t)} \right]} {\rm{d}}t.$$
(16)

Here error between the actual and desired states is given as

$$e(t) = z(t) - {z^*}.$$
(17)

The optimal control input can be obtained as

$$u_1^* = - {\bar F^{\prime}_r}\hat P{z^*}$$
(18)

where P is an n × n symmetric positive definite matrix with t ∈ [t 0, t f ], given as

$$\hat \dot P(t) = - \hat P(t){K_r} - {K^{\prime}_r}\hat P(t) - Q(t) + \hat P(t){\bar F_r}{\bar F_r}\hat P(t).$$
(19)

The above equation is solved using backward difference method with \(\hat P(t \rightarrow\infty) = 0)\).

5.2 Stability analysis

A Lyapunov function in terms of error e(t) can be chosen as

$$\Phi (t) = {1 \over 2}e^{\prime}(t)e(t)$$
(20)

which is positive definite. For the stability analysis, the first order derivative of Φ(t)is calculated.

$$\dot \Phi (t) = e^{\prime}(t)\dot e(t) = e^{\prime}(t)\dot z(t).$$
(21)

Now, using (18), (19) and (22)

$$\matrix{{\dot \Phi (t) = [z^{\prime}(t) - {{z^{\prime}}^*}][ - {K_r}z(t) + {{\bar F}_r}{u^*}] = } \hfill \cr { - z^{\prime}(t){K_r}z(t) + {{z^{\prime}}^*}{K_r}z(t) + {{z^{\prime}}^*}{{\bar F}_r}u_1^*(t) - } \hfill \cr {{{z^{\prime}}^*}{{\bar F}_r}u_1^*(t) = } \hfill \cr { - (z^{\prime}(t) - {z^*}){K_r}z(t) = } \hfill \cr { - e^{\prime}(t){K_r}(e(t) + {z^*}) = } \hfill \cr { - e^{\prime}(t){K_r}e(t) - e^{\prime}(t){K_r}{z^*} \leqslant {\rm{0}}{\rm{.}}} \hfill \cr}$$
(22)

6 Numerical results and discussion

The proposed methodology is applied to a two-dimensional axisymmetric geometry. The geometry can be obtained by taking an intersection of Fig. 1 along z-axis. The domain is discretized using triangular FE mesh with 7050 nodes excluding the boundary. Here the number of elements is 15008. The meshed domain is shown in Fig. 2. The size of the ordinary differential equation (ODE) model is same as the number of nodes inside the geometry. Hence, size of the ODE model will be 7050. Standard values of constants are taken and ambient conditions are taken for the simulation purpose. Rice is kept inside the storage system for the analysis purpose. The simulation time is taken from 1st March to 4th April for Konkan region, Maharashtra, India. The initial value of moisture is taken as 60% at 25°C. Zero boundary conditions are applied here. However, it can be verified that this methodology can be applied for any other boundary conditions.

Fig. 2
figure 2

Meshed domain

To generate the reduced model, the original model (12) is simulated with an impulse input. Here, in order to capture the widest frequency characteristics, the above input condition is taken. For simulations, backward difference is used, with 40 time steps are chosen for the computation and each step is taken as 1d. At each time-step, matrix K is dependent on humidity and the resulting nonlinear algebraic equation system is solved using the Newton-Raphson method. Finally, those 40 humidity profiles for the timesteps or humidity snapshots are stored as columns of matrix S. Rank of the matrix S is found as 18, beyond which the magnitudes of the singular values are negligible. This leads to the reduction of original nonlinear model to another model of (14) but with a much reduced size of 18. As a validation, the reduced model of the form (14) was again simulated with an impulse input δ(t) and thenodal humidity profiles were recomputed using (13). The humidity profiles were found to agree satisfactorily with those computed originally from the unreduced model given by (12). It has been observed that at t = 40d, the error is around 1.15 %. The errors are due to the neglected higher order dynamics. The humidity profiles for both original and reduced models at an arbitrary point P 1 are given in Fig. 3. The humidity profiles are obtained with an initial value of relative humidity is 60% and temperature is kept at 25°C.

Fig. 3
figure 3

Humidity profiles at P 1 point

The time taken to simulate the original model for 40s is around 4.30 min, while the reduced model takes 50s. The simulations are performed on 1 GB, 1.85 GHz, core-2 duo machines. Absolute time and their comparisons would be clear if the entire implementation is done in C/Fortan. For the purpose of simulation of the process Scilab[26] software implementation is used. For the discretization purpose, Gmsh[27] software is used. A comparison between the proposed and conventional methods can be done in terms of the size of the problem presented to any computer and the computational effort or complexity of the solution process-irrespective of the hardware. In the present case, the reduction in computational effort was from execution of nonlinear simulations with 7050 dynamic variables to execution of almost similar simulations with 18 variables.

Now, the reduced model (14) is simulated along with the optimal control law (19) which transfers an arbitrarily chosen z 0 to a desired target z*.Here all the components of z* are taken as 1000. The desired humidity profiles U* corresponding to z * can be obtained using (16). The nodal humidity profiles can be obtained from z(t). Here, the Riccati equation (20) is solved using Secant method and the magnitude of the temperature is obtained as 26.32°Cat t = 40d, being a representative time. The output profiles of the original and reduced model, when represented in full coordinates, at t = 40 d, after applying the optimal control law match almost perfectly. Those are shown in Fig. 4. It has been observed that the error between the outputs of both models, when represented in full coordinates at different time instants is around 1.856 %. Hence, we can conclude that the controller acts satisfactorily.

Fig. 4
figure 4

Humidity profile with controller

7 Conclusions

In this work, a modeling strategy for a grain storage system is presented. Here humidity is taken as variable to be modeled. FEM is used for discretization purpose thus making the approach suitable to more complicated geometries. A reduced order model is obtained using proper orthogonal decomposition technique. It has been observed that the reduced model has almost same dynamic properties as the original one. A controller based on optimal control theory is developed and its stability is analyzed using Lyapunov stability criteria. It can be observed that the moisture level was quite high in the actual system, which is a favorable condition for infestation. However, using the controller it is controlled to a certain level. Although the controller is designed for the reduced model, it works satisfactorily for the original system as well. This is the main contribution of this work. This work can be extended to obtain an equivalent reduced model where dynamic equations involve coupled temperature and moisture.