Modelling of the Electric Energy Storage Process in a PCM Battery

: The essence of the research was the modeling of a real electric energy storage system in a phase change battery operating in a foil tunnel. The scope of the work covered the construction of two partial models, i.e., energy storage in the PCM accumulator and heat losses in the PCM accumulator. Their construction was based on modeling methods selected on the basis of a literature review and previous analyses, i.e., artiﬁcial neural networks, random forest, enhanced regression trees, MARS plines, standard multiple regression, standard regression trees, exhaustive for regression trees. Based on the analysis of the error values, the models of the best quality were selected. The ﬁnal result of this study was the construction of such a model of the process of storing electricity in a PCM battery, characterized by the mean absolute percentage error forecast error of 1–2%. The achievement of this goal was possible thanks to the use of the artiﬁcial neural networks model for which the input variables were the amount of energy supplied to the accumulator and the temperature of the heat storage medium.


Introduction
In recent years, we have observed a growing interest in photovoltaic conversion, which consists in the direct conversion of solar radiation energy into electricity, with the use of photovoltaic cells. This requires the efficient use of the energy obtained, because the availability of solar radiation energy is very variable in the daily and annual period. Therefore, it is necessary to take actions both in the area of forecasting energy yield in advance of time as well as in the field of effective energy storage [1].
A typical information source for forecasting energy yield is a map of predicted annual electricity production, which may be available free of charge as well as commercially. Well-known sources of such data in Europe are services such as SoDa using the Helio-Clim [2], PVGIS [3,4] or METEONORM [5] databases. Commonly used solar bases are based mainly on satellite measurements from various observation systems (the most popular are METEOSAT in Europe, GOES in the USA and GMS in Japan), sometimes the databases are supplemented with information from ground measurements. The result of the forecast can be defined as an estimate of the annual electricity production from a PV installation in relation to 1 kWp of installed power for a given geographic location for a typical meteorological year.
For the current control of the operation of the photovoltaic installation, forecasts are not required with an annual resolution, but with a daily or hourly resolution. Most often they are built on the basis of forecasts of meteorological conditions at the location of the gym. Among the commonly used methods for forecasting electricity yield from a PV power plant, we can distinguish statistical and time series methods, physical methods and team methods.
The review of forecasting methods with the specification of the forecast horizon and resolution is included in publications [6,7]. The most common method of forecasting energy yield from photovoltaic power plants, as well as in all types of short-term forecasts in the power industry, are models of artificial neural networks [8][9][10][11]. The NARX (nonlinear autoregressive exogenous model) statistical nonlinear model is very often implemented in the neural network [12,13]. These models use both endogenous delayed variables (time series of power production) and additional exogenous delayed variables and their values from the analyzed period [14]. Most studies on short-term power generation forecasting in photovoltaic systems use the MLP (multilayer perceptron) neural network [15][16][17][18][19]. Moreover, neural networks of the SVM type (support vector machine) [20,21], recursive neural networks RNNs (recurrent neural networks), e.g., the Elman network [19], and neural networks of the RBF type (radial base function) are also used [19,22,23].
After choosing the method, the second problem is the selection of independent variables. The short-term forecast of the power of the photovoltaic system should take into account such data as: power of the installation, insolation, operating temperature of cells, air humidity, calendar data (e.g., hour of the day or name of the month) [24]. The selection of a specific set of variables should be made on the basis of statistical analysis and their substantive usefulness. Accurately forecasting electricity consumption (demand and supply) is key to making informed decisions about energy infrastructure for generating and distributing energy. The accuracy of forecasts is determined using various standardized performance evaluation methods: Mean bias error-MBE [31].
All types of photovoltaic cells only convert the energy of solar radiation into electricity without the possibility of direct permanent storage. Photovoltaic systems, due to the large dispersion of generation sources with relatively low power, force development in the field of local storage of the generated energy. The use of these systems by individual users helps to increase self-consumption [32] and integrates PV energy production and the electricity market [33]. The easiest way to store the electricity produced by small photovoltaic installations is to use electric batteries.
Currently, the storage of energy from PV systems mainly uses lithium-ion batteries, which show great potential due to fewer limitations than in lead-acid batteries [34][35][36][37], but their disadvantage is environmental pollution during their disposal [38].
Electricity obtained from a photovoltaic power plant can also be further converted and stored in the form of heat. For this purpose, materials with high specific or latent heat values are used, among others. Very good results are also obtained for materials that use both of these indicators in the process of energy storage [39]. The research on the efficiency of energy storage in batteries using phase change materials (PCM) has already been investigated by scientists from many centers [40][41][42]. These studies show that the main advantage of this form of energy storage is due to the fact that large amounts of energy are absorbed or given off during the melting and solidification process. Thanks to this, it is possible to reduce the demand for an energy storage medium and thus minimize the dimensions of the accumulator compared to other systems of the same capacity.
Modeling the process of accumulating energy in a PCM battery is very difficult due to its course. Scientists have been dealing with this issue for many years. The result of their work is the development of many methods used for this purpose. One of the newest is a simplified resistive-capacitive (RC) simulation model [43]. It allows the simulation of free convection in the liquid phase during the charging of the PCM battery. The developed model allowed to obtain comparable results with the model built using the finite element method. The temperature difference of the heat storage medium between the two models was only 0.62 K. However, the publication [44] presents a semi-analytical model to describe the transient heat transfer in a material in which the phase change process takes place. The obtained results were comparable to the commercial package based on the FEMMMASSE finite element theory. Models were based on the apparent heat capacity method [45][46][47][48][49], and methods using the temperature transformation originally proposed by Cao and Faghri [50] as well as the heat source method developed by Eyres et al. [51].
However, it is the enthalpy method and the effective heat capacity method that are the two most commonly used modeling methods in simulations of phase transitions [52][53][54][55][56][57][58].
To model the operation of PCM batteries, numerical methods are also used, taking into account changes in thermal properties related to the melting and solidification processes. Therefore, these methods mathematically combine the heat storage capacity described by specific heat (Cp), enthalpy (H) and temperature (T). These variables are determined using several techniques such as calorimetry, differential scanning calorimetry (DSC), and differential thermal analysis (DTA). Thanks to these techniques, it is possible to gain a deeper understanding of the various compounds and obtain information on which of them are more appropriate for the intended use [24]. Numerical modeling of the PCM battery provides a detailed understanding of the PCM phase change process when exposed to air. In article [59], two immiscible PCM fluids and air were modeled using the continuous surface force (CSF) model in the open source computational fluid dynamics (CFD) software, OpenFOAM. The results obtained from the full numerical model showed good agreement compared to the experiments. Despite some slight variations in the results, numerical modeling is a potential tool for optimizing the performance of thermal storage devices. Numerical calculations for models of thermodynamic phenomena require large computational outlays (even in the case of modeling relatively simple devices), they show considerable sensitivity to the model (e.g., grid structure). In analytical models, the solution is obtained in a significantly shorter time, because it usually uses simplifications. The obtained results can always be verified by numerical calculations, and in some cases this method can be used interchangeably with the numerical model (e.g., in optimization, in inverse tasks). The combination of experimental and numerical research is a reasonable compromise between the duration of the research and the financial outlays for its implementation. Time-consuming and costly experiments should therefore only be carried out in a narrower range of PCM battery operating conditions. The practical use of verified numerical models is much faster and more flexible.
In the literature, computer methods are also often used to model the heat transfer problems with phase change. The enthalpy method also dominates among them [60,61] and the effective heat capacity method [62].
Both of these methods are relatively simple to implement and write into a computer program. The ANSYS Fluent software is the most frequently used software among computer programs [63,64] and MATLAB [65,66].
Simulations of complete cycles of phase changes are already well known and described in the literature. However, not all of the available PCM material will melt or solidify. Partial phase transitions are common during battery operation in real applications. This issue is currently not well understood and requires further research.
At present, energy storage seems to be purposeful and justified not only in the professional energy sector, but also in agricultural production, e.g., for drying processes [67][68][69], preparation of technological water [70], or for heating, for example, greenhouse facilities [71][72][73]. The method of storing energy in crops under cover, however, is associated with a number of limitations that are placed on the storage medium. These limitations are the same as the limitations for PCM materials used in thermal heat storage. Hence, it can be concluded that energy storage in thermal stores is justified in horticultural production [74,75]. Despite the research carried out in this area for many years, there is still a need to expand knowledge, especially in the field of modeling battery operation in real conditions. There are many factors that influence the process of storing energy in a phase change battery. The most important of them are the physicochemical and design parameters of the storage bed as well as the amount of energy supplied to it. Effective models of the battery operation process allow for a significant reduction in the optimization time of individual system elements, and thus reduce the financial outlays for its construction. They can also be used during battery life to control its operation in order to maximize the use of available energy. This aspect is particularly important if the source of energy supplying the battery is characterized by high dynamics.

Purpose and Scope of Work
The aim of the work was to build a model of the process of storing electricity in a phase change battery. The aim of the work was achieved by building the model of energy storage in the PCM battery and the model of energy loss in the PCM battery.
In the first part of the work, the usefulness of seven selected methods was analyzed, i.e., artificial neural networks (ANN), standard regression trees (BRT), enhanced (CHAID) and comprehensive (CRT) and standard multiple regression (SMR), random forest (RF), and multivariate adaptive regression splines (MARS) to describe the process of accumulating energy in a PCM battery during periods when the PV power plant generated enough electricity for its operation.
In the second part of the study, a model was built to determine energy losses in the phase change battery during unfavorable weather conditions and the charging process was interrupted for some time. The same methods were used to build the heat loss model as in the first part of battery operation modeling. Based on the adopted criteria, the quality of all tested methods was assessed, and then models were selected that would allow for forecasts with the smallest errors.

PCM Phase Conversion Battery
The subject of the research was the prototype of the phase change battery, storing the energy generated from the photovoltaic power plant, the technical data and the crosssection of which are shown in Table 1 and in Figure 1. The diagram of charging the PCM battery located in the experimental foil tunnel, located at the Faculty of Production and Power Engineering in Krakow is presented in Figure 2. Table 1. Technical specification of the PCM battery (the design of the PCM battery was developed by the authors of this publication).

Description Dimensions
Total length *) 3 m  In addition, the battery had thermal insulation of mineral wool with a thickness of 10 cm. The applied insulation retains dimensional stability and does not deform during operation, even under variable temperature and humidity conditions. Furthermore, it is resistant to biological corrosion and chemicals, which is crucial to improving the efficiency of the battery.
To heat the air flowing through the PCM battery (sixteen symmetrical distributed pipes-4 rows of 4 pipes-with a diameter of 108 mm), a set of three heaters was usedeach having a power of 3 kW with an axial fan whose power was 0.4 kW.

Storage Medium
The medium storing the heat in the phase change battery was the R58 paraffin. The filling weight was 750 kg of paraffin. To estimate the amount of energy stored in the PCM battery, the thermophysical properties of the R58 paraffin were determined: Measurement of the phase change temperature and latent heat (phase change heat) was determined by the differential scanning calorimetry (DSC) method using a Shimadzu  In addition, the battery had thermal insulation of mineral wool with a thickness of 10 cm. The applied insulation retains dimensional stability and does not deform during operation, even under variable temperature and humidity conditions. Furthermore, it is resistant to biological corrosion and chemicals, which is crucial to improving the efficiency of the battery.
To heat the air flowing through the PCM battery (sixteen symmetrical distributed pipes-4 rows of 4 pipes-with a diameter of 108 mm), a set of three heaters was usedeach having a power of 3 kW with an axial fan whose power was 0.4 kW.

Storage Medium
The medium storing the heat in the phase change battery was the R58 paraffin. The filling weight was 750 kg of paraffin. To estimate the amount of energy stored in the PCM battery, the thermophysical properties of the R58 paraffin were determined: Measurement of the phase change temperature and latent heat (phase change heat) was determined by the differential scanning calorimetry (DSC) method using a Shimadzu In addition, the battery had thermal insulation of mineral wool with a thickness of 10 cm. The applied insulation retains dimensional stability and does not deform during operation, even under variable temperature and humidity conditions. Furthermore, it is resistant to biological corrosion and chemicals, which is crucial to improving the efficiency of the battery.
To heat the air flowing through the PCM battery (sixteen symmetrical distributed pipes-4 rows of 4 pipes-with a diameter of 108 mm), a set of three heaters was used-each having a power of 3 kW with an axial fan whose power was 0.4 kW.

Storage Medium
The medium storing the heat in the phase change battery was the R58 paraffin. The filling weight was 750 kg of paraffin. To estimate the amount of energy stored in the PCM battery, the thermophysical properties of the R58 paraffin were determined: Measurement of the phase change temperature and latent heat (phase change heat) was determined by the differential scanning calorimetry (DSC) method using a Shimadzu DSC-60 apparatus [76]. The specific heat of the R58 paraffin was determined by the calorimetric method with the DSC 7 Perkin Elmer scanning calorimeter [77].

Methodology of Conducted Research
To achieve the above-mentioned goal, it was necessary to distinguish individual stages of modeling, which included:

•
Model of the energy storage process in the battery. • Model of energy losses in the PCM battery.

Modeling of the Energy Storage Process in a PCM Battery
During the construction of models allowing to determine the amount of energy stored in the PCM battery, the developed algorithm was followed, the block diagram of which is shown in Figure 3. DSC-60 apparatus [76]. The specific heat of the R58 paraffin was determined by the calorimetric method with the DSC 7 Perkin Elmer scanning calorimeter [77].

Methodology of Conducted Research
To achieve the above-mentioned goal, it was necessary to distinguish individual stages of modeling, which included: • Model of the energy storage process in the battery.

•
Model of energy losses in the PCM battery.

Modeling of the Energy Storage Process in a PCM Battery
During the construction of models allowing to determine the amount of energy stored in the PCM battery, the developed algorithm was followed, the block diagram of which is shown in Figure 3. The efficiency of energy storage in a phase change accumulator depends primarily on the parameters of the energy storage medium (its specific heat, heat and phase change temperature) and the amount of electricity supplied. However, these are not the only factors affecting battery performance. The amount of stored energy losses also has a significant impact on the analyzed heat exchange surfaces. Its level depends primarily on the insulation of the battery and the temperature difference between its interior and the ambient temperature. The following were selected as independent variables for modeling the amount of energy stored in the phase change accumulator: the amount of electricity supplied, paraffin temperature and air temperature outside the accumulator.
In the first step, after obtaining the raw measurement results, a marking was made that allowed for the identification of individual charging cycles. Then, from the time series, records with incomplete information or measurement errors occurring, resulting, for example, from communication disturbances between the measuring sensor and the device for archiving measurement results, were removed. In the next step, the collected information was divided into individual sets used during the construction of the models. Three loading cycles were assigned to the training set, and the last one was used as validation data. During model validation, independent variables (the amount of electricity supplied to the PCM battery and the temperature of the PCM bed) were input into the models input and the resulting output variable (the amount of energy stored in the PCM battery) was compared with the actual quantity obtained during the experiment. For the purpose of building forecasting models, data from one series were extracted from the training set, which formed the test set. During the research, no modifications were made to the data constituting the individual sets.
The amount of accumulated heat in individual phases of the accumulation process was determined in accordance with the following relationships:  The efficiency of energy storage in a phase change accumulator depends primarily on the parameters of the energy storage medium (its specific heat, heat and phase change temperature) and the amount of electricity supplied. However, these are not the only factors affecting battery performance. The amount of stored energy losses also has a significant impact on the analyzed heat exchange surfaces. Its level depends primarily on the insulation of the battery and the temperature difference between its interior and the ambient temperature. The following were selected as independent variables for modeling the amount of energy stored in the phase change accumulator: the amount of electricity supplied, paraffin temperature and air temperature outside the accumulator.
In the first step, after obtaining the raw measurement results, a marking was made that allowed for the identification of individual charging cycles. Then, from the time series, records with incomplete information or measurement errors occurring, resulting, for example, from communication disturbances between the measuring sensor and the device for archiving measurement results, were removed. In the next step, the collected information was divided into individual sets used during the construction of the models. Three loading cycles were assigned to the training set, and the last one was used as validation data. During model validation, independent variables (the amount of electricity supplied to the PCM battery and the temperature of the PCM bed) were input into the models input and the resulting output variable (the amount of energy stored in the PCM battery) was compared with the actual quantity obtained during the experiment. For the purpose of building forecasting models, data from one series were extracted from the training set, which formed the test set. During the research, no modifications were made to the data constituting the individual sets. The amount of accumulated heat in individual phases of the accumulation process was determined in accordance with the following relationships: where Q is the amount of heat accumulated kJ, m is the mass of paraffin, C ps is the specific heat of the solid, kJ·(kg·K) −1 , C pl is the specific heat of the liquid, kJ·(kg·K) −1 , L is the latent heat solid-solid kJ·kg −1 , L p is the latent heat solid-liquid kJ·kg −1 , dT is the temperature difference, and T (p, pm1, pm2, pe1, m, e2, k) is the paraffin temperature at characteristic K points.
After determining the amount of stored energy on the basis of the above-mentioned relationships, the development of predictive models was started, allowing the determination of the amount of stored energy in the phase change accumulator based on a deliberately selected set of methods.
For this purpose, a project was created in the Statistica 12 Data Miner graphical environment. It includes, among others, nodes enabling the division of data into individual sets (training and validation), and then forecasts were developed based on models that were selected on the basis of the literature on the subject: artificial neural networks (ANN), standard regression trees (BRT), enhanced (CHAID) and comprehensive (CRT) and standard multiple regression (SMR), random forest (RF), and multivariate adaptive regression splines (MARS). Details concerning the algorithms of operation of the methods used in the study have been omitted as they are already commonly known. One of the oldest tree methods is the algorithm (CHAID) proposed by Kass in 1980 [78]. In turn, the algorithm of the CRT method was developed and presented by Breiman in 1984 [79,80]. The youngest are method multivariant adaptive regression splines (MARS). They were propagated and put into common use by Friedman [81,82].
The following assumptions/limitations were used in the tested methods: • ANN-the construction of a neural model required, first of all, the determination of the optimal network architecture (number of neurons in the hidden layer, number of layers, network type). It was also necessary to select the method of signal propagation in the network, the learning algorithm and the activation function of individual layers.
An automatic network designer was used in the study of the selection of the optimal network structure for each set of input variables. They analyzed the quality of the network, in which the number of neurons in the hidden layer could vary from 3 to 11. Before starting the research, the variables were divided into three sets. The allocation of days to individual sets was unchanged for all the analyses performed related to the modeling of electricity yield from the photovoltaic power plant (both for all methods and sets of input variables). Using the ANN automatic teacher in the Staistica 12 program, 200 network structures were analyzed, of which 5 with the best parameters were retained. In the study, it was possible to choose one of the three network training algorithms, i.e., the steepest descent method, the Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm and the coupled gradient algorithm.

•
BRT-the minimum number of nodes was 5 observations, the maximum number of nodes was 1000, tree pruning stops were made on the basis of variance analysis. • CHAID-learning coefficient-0.1, number of trees-200, proportion for subsets-0.5, retention parameters: minimum number, 5%; minimum n child, 1; maximum number of descendants, 10; maximum number of nodes, 3. • CRT-minimum number of objects in a node, 5; maximum number of nodes, 1000; p level for division, 0.05. • RF-number of trees, 100; the stopping parameters were: minimum frequency, 5%; minimum n child, 5; maximum number of descendants, 10; maximum number of nodes, 100; number of cycles to determine error, 10; error reduction percentage, 5%. • MARS-maximum number of base functions, 21; order of interaction, 1 or 2; penalty for adding another base function 2.
In order to avoid overtraining the models (BRT, RF, SMR, CRT CHAID, MARS), a V-fold cross-test was used, which consists in determining a certain number of random samples separated from the training sample. Then, the analyses were performed, whereby one of the samples was omitted in the calculation and used as the test sample in the crossvalidation. Each test was therefore used V-1 time in the training sample and once as a test sample.

Modelling of Energy Losses in a PCM Battery
During battery charging, there were interruptions in the supply of energy from the PV plant due to a too low level of solar radiation. At that time, only stored heat was lost. Therefore, it was necessary to develop additional heat loss models as a function of paraffin temperature and temperature inside the foil tunnel for these breaks. For this purpose, a set of methods was used (ANN, RF, BRT, SMR, CHAID, CRT, MARS). The loss model with the best quality was used later in the work only in periods when there was a break in charging the battery. This is because energy losses occurring in the charging process were taken into account when modeling the amount of energy stored in the battery.

Evaluation of the Quality of Predictive Models
The quality of the built models estimating the amount of stored energy and energy losses in the PCM battery was assessed on the basis of:
The share of balance differences in relation to the sum of the actual values (∆ESRt): where: W rz is the actual value, W p is the forecast value, n is the number of the last observations of the forecasted variable. The value of the abovementioned indicators was determined separately for the training set and the validation set. Moreover, to better illustrate the error changes for individual models, the empirical distribution of APE errors was developed.

Determination of the Physical Properties of R58 Paraffin
The phase change material used in the study is R58 paraffin, with a melting point of 56-58 • C. To determine the behavior of the storage bed in the PCM battery during the melting process, the measurements were carried out using a differential scanning calorimeter. The measurement of the phase transformation temperature and the heat of the phase transformation was determined by differential scanning calorimetry (DSC) with a Shimadzu DSC-60 apparatus. The specific heat of the R58 paraffin was determined by the calorimetric method on a Perc Elmer DSC 7 scanning calorimeter, and the thermal conductivity coefficient was determined on the LFA 447 NanoFlash analyzer. The DSC curve for melting R58 paraffin used in the study was obtained based on the performed tests ( Figure 4). phase transformation was determined by differential scanning calorimetry (DSC) with a Shimadzu DSC-60 apparatus. The specific heat of the R58 paraffin was determined by the calorimetric method on a Perc Elmer DSC 7 scanning calorimeter, and the thermal conductivity coefficient was determined on the LFA 447 NanoFlash analyzer. The DSC curve for melting R58 paraffin used in the study was obtained based on the performed tests ( Figure 4). During the analysis of the paraffin DSC curve, two peaks were observed, in which the phase change took place, and the heat specific for these points was changing very dynamically.
The larger of the peaks is due to a solid-liquid phase change and the smaller one is due to a solid-solid transition, approximately 20 °C below the main melting range. The paraffin wax phase change process can be divided into five sub-processes, i.e., solid phase, solid-solid conversion, then a phase above the solid phase temperature range but below the melting point range, followed by solid to liquid and liquid phase change.
The conducted research allowed to determine the parameters necessary to estimate the amount of accumulated energy in the medium, and their values are listed below in Table 2. In addition, the study analyzed the effect of the number of phase change cycles of the storage medium on the physiothermal parameters. For this purpose, the calorimetric tests were repeated for the PCM material collected successively after 100, 200, 300 and 400 cycles. During the analyses, no significant influence of the number of phase change cycles on material parameters was observed. During the analysis of the paraffin DSC curve, two peaks were observed, in which the phase change took place, and the heat specific for these points was changing very dynamically.
The larger of the peaks is due to a solid-liquid phase change and the smaller one is due to a solid-solid transition, approximately 20 • C below the main melting range. The paraffin wax phase change process can be divided into five sub-processes, i.e., solid phase, solid-solid conversion, then a phase above the solid phase temperature range but below the melting point range, followed by solid to liquid and liquid phase change.
The conducted research allowed to determine the parameters necessary to estimate the amount of accumulated energy in the medium, and their values are listed below in Table 2. In addition, the study analyzed the effect of the number of phase change cycles of the storage medium on the physiothermal parameters. For this purpose, the calorimetric tests were repeated for the PCM material collected successively after 100, 200, 300 and 400 cycles. During the analyses, no significant influence of the number of phase change cycles on material parameters was observed.

Modeling the Battery Charging Process PCM
The second stage of the research involved modeling the charging process of the PCM battery and it consisted of two parts. The first one analyzed the usefulness of seven selected methods, both classic and alternative (the same set of methods as in the modeling of PV energy yield), to describe the process of accumulating energy in a PCM battery in periods when the PV power plant generated enough electricity for its operation.
In the second part of the study, models were built to determine energy losses in a phase change battery, when there were unfavorable weather conditions and the charging process was interrupted for some time. The same methods were used to build the heat loss model as in the first part of battery operation modeling. Based on the adopted criteria, the quality of all tested methods was assessed, and then models were selected that would allow for forecasts with the smallest errors.

Modeling the Process of Accumulating Electricity in a PCM Battery
In order to model the amount of energy stored in the paraffinic bed, the correlation coefficient between the dependent variable and the assumed independent variables was determined. The analysis of the correlation between the amount of energy stored in the PCM battery and the energy supplied to the battery, the temperature inside the object, and the paraffin temperature (Table 3) shows that the lowest correlation strength was characteristic for the variable describing the temperature inside the object (R 2 = 0.43). This fact is largely due to the use of mineral wool insulation in the battery, which largely limited the impact of external conditions on the facility's operation. For the construction of energy storage models in the phase change battery in the initial stage of the study, the electric energy supplied to the battery, the paraffin temperature and the temperature inside the greenhouse were selected as independent variables. The study was performed only for one method, i.e., ANN, as commonly used, and an automatic designer was used to build the network. Out of 200 tested network combinations, only 5 of the best quality were archived (Table 4), in which the BFGS learning algorithm was used, and the activation functions of both the hidden and the output layer were of a linear, logistic or tangensoidal nature. Based on the estimated errors for both the learning, test and validation sets, the network with 10 hidden neurons and a tangent function for activation of the hidden layer and a logistic function for activation of the output layer was considered to be the best, i.e., with the lowest errors. ANN models built on the basis of these three independent variables were characterized by MAPE errors of between 1 and 3% for the learning set and of more than 5% for the validation set. The selected neural network will be compared in the following work with other methods used to model the energy storage process from photovoltaic conversion in a PCM battery.
The assessment of the influence of independent variables on the quality of the developed model was carried out after its construction, on the basis of a global model sensitivity analysis. The indices of network sensitivity to particular independent variables are presented in Table 5. They were determined as a quotient of the error obtained when running the network for a set of data without a given variable and the error obtained with a set of variables. The larger the error after the rejection of a variable, in relation to the original error, the more sensitive the network is to the lack of this variable. The analysis shows that all the variables used improved its quality. However, the greatest influence was exerted by the paraffin temperature and the amount of electricity supplied to the battery. The influence of temperature inside the object was much lower and in subsequent studies this variable was eliminated from the set of independent variables.
In the further part of the study, the usefulness of the selected methods, i.e., ANN, RF, BRT, SMR, CHAID, CRT, MARS, for the construction of effective models of energy storage in a phase change accumulator operating in a real greenhouse facility was analyzed. Table 6 summarizes the errors in the modeling methods of the stored energy in the PCM battery. For the tested methods (Table 6), the lowest error values were observed for ANN both for the training and validation sets. For both sets, the BRT, SMR and CHAID methods had the highest MAPE errors, from 8 to 15%, while the ∆ESRt error for these methods was at the level of 4-6%. The course of empirical distributors for both the training and validation set is comparable ( Figure 5). For both sets, the ANN model has the highest share of APE errors below 10%. The analysis showed that the share of errors of up to 10% for ANNs constitute as much as 100%, and for the MARS method 98% of the observations, while for other methods they are in the range from 42% to 70%. The maximum error values for the neural network do not exceed 10%, and for the other methods they reach the level of 100%. For the tested methods (Table 6), the lowest error values were observed for ANN both for the training and validation sets. For both sets, the BRT, SMR and CHAID methods had the highest MAPE errors, from 8 to 15%, while the ∆ESRt error for these methods was at the level of 4-6%.
The course of empirical distributors for both the training and validation set is comparable ( Figure 5). For both sets, the ANN model has the highest share of APE errors below 10%. The analysis showed that the share of errors of up to 10% for ANNs constitute as much as 100%, and for the MARS method 98% of the observations, while for other methods they are in the range from 42% to 70%. The maximum error values for the neural network do not exceed 10%, and for the other methods they reach the level of 100%. Based on the results obtained for individual studies of the energy storage process in the battery it was decided that, later in the work, the built ANN model will be used, for which the input variables are the energy supplied to the battery and the paraffin temperature.
The same set of methods was used again to model energy losses during unfavorable weather conditions as for modeling the process of accumulating energy in the battery. The temperature of paraffin and the temperature inside the tunnel where the battery was located were used as independent variables. Such a set of variables made it possible to make forecasts with a very low error not exceeding 3%.
The ANN method had the lowest forecast errors among all the methods used ( Table  7). The artificial MLP neural network with three hidden neurons achieved the lowest Based on the results obtained for individual studies of the energy storage process in the battery it was decided that, later in the work, the built ANN model will be used, for which the input variables are the energy supplied to the battery and the paraffin temperature.
The same set of methods was used again to model energy losses during unfavorable weather conditions as for modeling the process of accumulating energy in the battery. The temperature of paraffin and the temperature inside the tunnel where the battery was located were used as independent variables. Such a set of variables made it possible to make forecasts with a very low error not exceeding 3%.
The ANN method had the lowest forecast errors among all the methods used ( Table 7). The artificial MLP neural network with three hidden neurons achieved the lowest ANN (learning and validation) errors as well as MAPE and ∆ESRt errors. Detailed analysis of the quality of individual methods has shown that the best quality of the forecast can be obtained using the adopted input variables and the method of artificial neural networks. This model will be used in the further part of the work, for modeling the process of storing energy obtained from photovoltaic conversion in the phase change battery.  [48], the PCM medium with melting points of 17, 21 and 29 • C was used. On the other hand, the quality of modeling a greenhouse facility with a PCM battery was assessed by graphically comparing the results of own research with selected experiments presented in the literature. The work from [50] provides an overview of the research for the three most commonly used groups of PCM materials, i.e., salt hydrates, paraffins and polyethylene glycol. The comparison of the results presented in it is very difficult due to the lack of uniform assumptions and conditions for the implementation of the study. The issue of using the PCM battery in greenhouse production is also discussed in [49]. However, its authors use a medium with a low phase change temperature due to the use of a battery for direct heating of the root zone of plants in greenhouses. Additionally, in most of the works, the aspect of changing the parameters of the heat-storing medium during its many cycles of operation is neglected. The research presented in the paper allows for the assessment of the suitability of selected methods for modeling the actual process of storing electricity in a PCM battery in a greenhouse facility. Due to the provision of a similar set of data for model building, it was possible to study the impact of the choice of method on the quality of the model of the energy storage process.

Conclusions
The conducted research allowed for the collection of information on the process of heat accumulation in the phase change accumulator, not on a laboratory scale, as is the case in most previous studies, but allowing its direct use in practical applications.
The conducted study made it possible to develop a DSC curve for the R58 paraffin used in the study and to learn about its basic parameters. During the test, it was established that the melting point for the solid-solid transformation is 38 • C, and for the solid-liquid transformation it is 58 • C. On the other hand, the heat of the phase transition of melting is 22 and 130 kJ·kg −1 , respectively. During the test, no changes in the physical and thermal properties of R58 paraffin with the number of phase-change cycles were observed.
The research shows that the use of a very limited set of independent variables in the form of the amount of electric energy supplied to the battery and the temperature of the heat storage medium allows the modeling of the energy storage process while charging the PCM battery. Based on the quality analysis of the assessed models, it was found that the best quality is ensured by SNN. This model was characterized by mean absolute percentage error forecast (MAPE) at a level not exceeding 2% for both the training and validation set, and the share of balance differences was even lower.
The issues presented in the paper do not fully cover the issue of energy storage in batteries using the phase change. Therefore, the research was continued in the field of the process of recovering energy stored in the PCM battery and the impact of the depth of its discharge on the efficiency of the process.
The main limitation during the accumulation of energy from photovoltaic conversion in the phase change battery was the thermal parameters of the air as the medium transferring heat between the electric heaters and paraffin, which is the battery bed. In subsequent tests, it is planned to change air into liquid, while reducing the cross-section of the conductors transferring heat to the battery. Due to the requirements for the battery, which will be ultimately used in the cultivation of plants under covers, the air will still remain the medium used during its discharge.

Conflicts of Interest:
The authors declare no conflict of interest.