Precision Regulation Model of Water and Fertilizer for Alfalfa Based on Agriculture Cyber-Physical System

The regulation of water and fertilizer for alfalfa growth is not precise enough because the regulation strategy cannot track alfalfa growth dynamically. In this paper, we propose a precision regulation model of water and fertilizer for alfalfa based on agriculture cyber-physical system (ACPS) for irrigation and fertilizer management in alfalfa (PRMWFA-ACPS). The proposed PRMWFA-ACPS is a comprehensive model that includes the biophysical submodel, the computation submodel of water and fertilizer regulation, and the interaction of the submodels for both. The proposed model interacts with the alfalfa growth and its physical environment along with the irrigation strategy to improve the precise regulation of water and fertilizer. To verify the performance of the proposed model, we develop a simulation platform for PRMWFA-ACPS based on Ptolemy. Through physical experiments performed in the field at the Ningxia irrigation area of the Yellow River over three years (2016-2018), we verified and analyzed PRMWFA-ACPS by comparing the simulated and measured values, such as the growth period, leaf area index, soil water content and alfalfa yield. The experimental results show that the mean relative error of the growth period simulated by the model is between 1.9% and 6.8%, the mean relative error of the leaf area index simulated by the model is between 2.1% and 9.8%, the mean relative error of the soil water content simulated by the model is between 4.3% and 12.8%, and the mean relative error of the yield simulated by the model is between 1.2% and 14.3%. These findings indicate that PRMWFA-ACPS has promising applicability to the Ningxia irrigation area of the Yellow River and improves the accurate regulation of water and fertilizer application to alfalfa in a complex physical environment.


I. INTRODUCTION
Alfalfa (Medicago sativa L.) is one of the most widely cultivated and used forages in the world [1]- [3]. It plays an important role in dairy farms in northwest China. However, alfalfa production is restricted by environmental factors in these areas, such as large temperature differences, water shortages and soil pollution. These difficulties motivate us to improve the water and fertilizer regulation strategy to The associate editor coordinating the review of this manuscript and approving it for publication was Maurizio Tucci. maximize the economic return and to minimize the environmental impact [4]- [5].
At present, the regulation of water and fertilizer for improved alfalfa growth is generally based on a combination of field experience and automation technology [6]- [7]. This method uses computer technology and advanced electronic technology to perceive the external physical environment of alfalfa (such as the climate, water, and soil) and create an irrigation strategy that improves the accuracy of the water and fertilizer irrigation. However, this method cannot dynamically track the growth status of alfalfa, and thus it affects the precision of the water and fertilizer regulation. VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ Information on the external physical environment of alfalfa can be perceived by advanced sensing technology. However, the alfalfa growth dynamic cannot be perceived directly by sensing. The crop indices (e.g., measures of growth), which result from the comprehensive interaction between the environment and the plant, have been key for developing the precision regulation strategy. Thus, the key issues are to obtain the physical information on alfalfa growth under different environments and to integrate the computation process deeply to improve the accuracy of the water and fertilizer regulation. The agriculture cyber-physical system (ACPS) provides a way to improve this problem.
ACPS is the cyber-physical system (CPS) as designed and applied to agriculture [8]- [11]. It enhances the ability of agricultural systems to engage in real-time communication, precise regulation and self-coordination through the deeper integration of computation with physical processes. The alfalfa growth process is a biological process, and changes in soil moisture and fertilizer are physical processes. The water and fertilizer regulation strategy is a discrete computational process. Biophysical processes affect computation processes and vice versa. Therefore, this feedback loop in alfalfa is a specific application of ACPS to precision regulation.
The challenges are how to obtain physical information on alfalfa growth when given different water supplies and variable fertilizer under different environments, and how to integrate the alfalfa growth process and its physical environment (biophysical processes) into a precise regulation strategy for water and fertilizer (computation processes). To address these issues, the objectives of this study are 1) to build a comprehensive biophysical model into ACPS, which includes biophysical model construction in ACPS and its interaction with the computation model, 2) to propose a precision regulation model of water and fertilizer for alfalfa based on the ACPS (PRMWFA-ACPS), and 3) to validate and evaluate the proposed agricultural cyber-physical model.
The remainder of this paper is organized as follows. Section II introduces some related work. Section III proposes a PRMWFA-ACPS model, develops the submodels of PRMWFA-ACPS, including the biophysical submodel of alfalfa, the computation submodel of water and fertilizer regulation, and the interaction submodel of the two. A simulation platform of PRMWFA-ACPS in Ptolemy is discussed in Section IV. Through physical and simulation experiments in the Ningxia irrigation area of the Yellow River, we verify and evaluate the PRMWFA-ACPS in Section V. Section VI presents the conclusions.

II. RELATED WORK
In recent years, many researchers have focused on using the ACPS to improve irrigation accuracy [12]. For example, Dong et al. presented a precision agriculture system that would provide independent and precise irrigation management functions in real-time [13]. Khriji et al. presented a precise irrigation system that achieves precision irrigation through a comprehensive analysis of data from the external environment [14]. Oliveira et al. presented a new energy and environmental model based on ACPS to provide intelligent integrated management of greenhouse flowers [15]. Selmani et al. presented a new approach to the cyberization of solar photovoltaic water systems for remote irrigation management [16]. These studies address precision irrigation for different crops based on ACPS. However, they have ignored the crop growth information in the physical environment, thus affecting the precision of the irrigation strategy.
Crop growth information is related to the crop's own characteristics. Considering crop growth information is important for precision regulation, and these data cannot be perceived by sensors; thus, researchers have further explored methods to obtain dynamic crop information and to incorporate it into ACPS applications. Jiang et al. stores the fruit growth data in a historical database to perform data collection on crop growth [17]. Consequently, for crop growth models, increasing numbers of crop models involve decision support systems to improve precision regulation [18]- [20]. Nevertheless, their applications on field crops might be limited by the high complexities of the soil-plant-atmosphere continuum, climate variability, and real-time performance. Moreover, Li et al. proposed a comprehensive model that combines the soil water, alfalfa growth and weather conditions [21]. However, this model is unable to integrate the physical and computation processes, thus affecting its accuracy. Therefore, it is necessary to develop a precision irrigation system based on ACPS that integrates an alfalfa growth model.
To date, several simulation models have been developed for alfalfa. The first alfalfa model, SIMED, is a crop growth model that simulates the physiological growth of alfalfa [22]. The ALSIM was then established based on the SIMED, which improved the soil water budget to simulate alfalfa under water restriction [23]. The ALF2LP is a branch of ALSIM and considers alfalfa growth during different planting years [24]. These studies did not consider the effect of the water and nitrogen balance on alfalfa growth. Consequently, the researcher added the alfalfa growth model to general models for simulating alfalfa growth under different environments and soil conditions, such as APSIM, CROPGRO, and EPIC [25]- [28]. However, the compatibility and flexibility of the general models are weak. They are difficult to integrate with new technology effectively. Gao et al. presented ALFAMOD for alfalfa, which is incorporated with alfalfa production, meteorological and soil environmental factors [29]. However, it cannot simulate alfalfa growth under different amounts of irrigation and fertilization. Based on ALFAMOD, we have established an alfalfa growth simulation model based on water and nitrogen factors (ALFSIM-WN) [30]. Alfalfa in the Ningxia irrigation area of the Yellow River is used as the research object, and this model can simulate the growth dynamics of alfalfa on different water supplies and variable fertilization under different climates. We have performed field experiments to verify the accuracy of the model, and the results show that it has higher accuracy in alfalfa.

III. ESTABLISHMENT OF PRMWFA-ACPS A. PRMWFA-ACPS MODEL
The PRMWFA-ACPS is made up of three parts, namely the physical environment, computation environment and cyberphysical interaction, as shown in Figure 1.
1) The physical environment consists of external physical environments and physical entities. The external physical environment consists of climatic conditions (the temperature, solar radiation, and precipitation) and the basic environment (the field capacity, bulk density, wilting point, and soil nitrogen content). Physical entities include the alfalfa and the soil. The growth of alfalfa and the changes in soil moisture and fertilizer are continuous biophysical processes. The set of alfalfa attributes (growth period, leaf area dynamics, photosynthetic and respiration, potential productivity, soil moisture, soil nitrogen, and yield) is represented by X . Usually, external physical environment attributes can be obtained by sensors. Future meteorological data can be obtained from weather forecasts. Physical entity attributes and future soil attributes can be obtained by an alfalfa growth model. The attributes of the external physical environment affect the attributes of the physical entity, and the attributes of the physical entity also affect each other.
2) The computation environment is composed of computation entities, which are precision regulation strategies. The precision regulation strategy is performed by computer technology. It is a discrete computation process consisting of two attributes, namely water deficit and fertilizer deficit. The set of computation entity attributes is represented by Y .
3) Cyber-physical interactions include the interaction of physical to computation and the interaction of computation to physical. These two interactions are implemented through interaction parameters, and the set of interaction parameters is represented by I. Interactive parameters of physical to computation (meteorological data, growth period, soil moisture data and soil nitrogen data) are formed by the attributes of the external physical environment and physical entities. They pass from the physical to the computation environment. This is the interaction from physical to computation. The computation environment provides regulation through algorithms and interactive parameters of the physical environment, and they form interaction parameters of computation to physical (the irrigation amount and nitrogen application rate). Feedback to the physical environment affects the physical entities. This is the interaction from computation to physical. The interaction is represented by H .
We defined the PRMWFA-ACPS as a four-tuple S = (X , Y , I , H ). The interaction parameter set I provides for the tightly related interactions between physical entity attributes set X and computation entity attributes set Y . It connects physical entities and computation entities like a bridge. The physical entity attributes of alfalfa are a time-space correlation. Therefore, the mapping from X to I can be represented as X × t × x, y, z → I , t represents time, and x, y and z represent a point of space coordinate. The computation entity attributes are time-dependent, and mapping from Y to I can be represented as Y × t → I . The definition of sets X , Y , I , and H are as follows: 1) X is a finite set of physical entity attributes, X ={x 1 , x 2 , . . . , x n }. It describes the characteristics of physical entity attributes and is obtained by the alfalfa growth model. Physical entity attributes include meteorological data, basic soil data, the growth period, leaf area dynamics, potential productivity, yield, soil water content and soil fertility.
2) Y is a finite set of computation attributes, Y ={y 1 , y 2 , . . . , y n }. It describes the characteristics of the computation entity attributes and is obtained by the algorithm of the computation entity. The computation attributes of the precision regulation strategy include the water deficit and the nitrogen deficit. VOLUME 8, 2020 3) I is a finite set of interaction parameters, I ={i 1 , i 2 , . . . , i n }. It describes the interaction parameters of physical to computation and the interaction parameters of computation to physical. 4) H indicates the interaction of computation and physical, H ={h 1 , h 2 , . . . , h n }. Each cyber-physical interaction h i ∈ H . It describes the mapping from I subset to Y subset or I subset to X subset. The interaction of physical and computation goes two ways. Interaction H from physical to computation reflects the physical attributes effect on the computation process. Interaction H from computation to physical reflects the computation attributes effect on the physical process.

B. SUBMODELS OF PRMWFA-ACPS 1) BIOPHYSICAL SUBMODEL
The biophysical submodel is the foundation of PRMWFA-ACPS. Sensors cannot perceive the future changes in the soil. The biophysical model can simulate future alfalfa growth, and its physical environment changes to affect the planning strategy. This is also critical for the accuracy of the precision regulation strategy.
The biophysical submodel integrates the external physical environment and physical entities, simulates the dynamic change of alfalfa and soil under different environments, and provides the physical attribute set X . It includes the alfalfa dynamic model, water balance model and nitrogen balance model.
We define the biophysical attributes set X ={RDS, A, PB, P, SWC, ND, PAR}, where RDS is the growth period, A is the leaf area index (LAI), PB is the photosynthesis and respiration, P is the potential productivity, SWC is the soil water content, ND is the soil nitrogen, and PAR is the yield. The establishment of the biophysical submodel is divided into three steps.

a: ESTABLISHMENT OF THE ALFALFA DYNAMIC MODEL
The alfalfa dynamic model is a continuous dynamic simulation process. It simulates the leaf area dynamic, photosynthesis and respiration, carbohydrates, and potential productivity.
The RDS is based on the effective accumulated temperature. We obtained the alfalfa harvest data for different years in the Ningxia irrigation area of the Yellow River and the effective accumulated temperature to establish the alfalfa growth period.
A is calculated by the leaf area dynamic model, which used differential equations for modeling [31] . k is a constant, the value of which is 0.055 [22]. f (T ) is calculated by the temperature function. P is calculated by the potential productivity model, which used the photosynthesis and respiration functions for modeling [32] where P is the potential productivity. F is the effective day length of photosynthesis (h). The maximum intake of CO 2 during the net photosynthetic of alfalfa is converted to carbohydrates (CH 2 O) with a value of 42.7493 kg/hm 2 ·h [32]. U is the solar radiation function. V is the leaf area function. W is the temperature function. Z is the respiratory consumption function. These four functions constitute photosynthesis and respiration PB, which can be calculated using Equations (3)- (6).
where I is the amount of solar radiation (MJ/m 2 ). ke is the extinction coefficient. E is the daily mean temperature ( • C). R is the daily temperature range ( • C).

b: ESTABLISHMENT OF A WATER BALANCE MODEL
The water balance model can simulate two different water transport possibilities in different soil layers. It includes the surface irrigation mode (surface irrigation or rain [30], [33]) and subsurface drip irrigation mode [30], [34]- [36].
(1) If the water supply method is surface irrigation, the water balance model will select the surface irrigation model for modeling. It calculates the canopy interception, runoff, and the amount of water entering the soil. These factors can be calculated using Equations (7)- (12).
where A(d) is the leaf area index. kp is the parameter of surface interception. rain is the precipitation (mm). C(d) is the canopy interception of alfalfa (mm). prcip is the total water (mm). runoff is the runoff (mm). R 2 is the water retention coefficient. pinf is the water entering the soil (mm). hold(l) is the hold water of layer l (cm). swl(l) is the soil water content of layer l (cm/cm 3 ). sat(l) is the saturated water content of layer l (cm/cm 3 ). dlayer(l) is the soil thickness of layer l. We used a loop structure to calculate the soil water content layer by layer. First, the program judges whether there is unsaturated infiltration (pinf≤hold(l)). If yes, the program calculates the amount of water leaking from layer l to layer l + 1 and the soil water content of layer l, and it updates the pinf. Otherwise, the program calculates the soil water content of layer l without updating the pinf.
(2) If the water supply method is subsurface drip irrigation, the water balance model will select the subsurface drip irriga-tion model for calculating the water supply, vertical distance, and horizontal distance of the wetting volume. These factors can be calculated using Equations (13)- (15).
where M is the water that is applied (m 3 ). F is the radius of the wetted soil volume at its widest point (m). E is the depth of the wetting pattern (m/s). drip is the total amount of water supplied (m 3 ). k s is the soil hydraulic conductivity. q is the dripper discharge. num is the number of emitters. A 1 , A 2 , n 1 , and n 2 are constants.
The soil water content of each layer is then obtained under different water supply methods. The water balance model continues calculating the potential evapotranspiration, potential evaporation, actual evaporation, potential transpiration, root water uptake, and actual transpiration. Finally, we obtain the actual soil water content (SWC), plant water uptake, and soil water deficit factor (SWDF) per day.

c: ESTABLISHMENT OF THE NITROGEN BALANCE MODEL
The nitrogen balance model simulates the nitrogen balance. We estimate the nitrogen requirement of alfalfa in the j th area based on the yield target [30], [37]. The nitrogen requirement (ND) and the nitrogen stress factor (NDEF) can be calculated using Equations (16)- (21).
where NS j is the soil nitrogen supply of the j th area (g/m 2 ). TN sj is the soil nitrogen content of the j th area (%). S is the plot area (hm 2 ). EN is the soil nitrogen supply rate (%). q 10 is the temperature coefficient of soil mineralization. np is the ratio of mineralized nitrogen to total nitrogen. T is the average temperature of the growth period ( • C). GZ is the dry weight of each soil layer (kg). OMS is the soil organic matter (g/kg). NI j is the nitrogen supply (g/m 2 ). NR j is the nitrogen requirement of alfalfa (g/m 2 ). EC is the utilization of nitrogen (%). TNP is the nitrogen requirement for high yields (g/m 2 ). pHn is the influence coefficient of the pH on the soil nitrogen supply. OMN is the influence coefficient of the soil organic matter on the soil nitrogen supply.

d: ESTABLISHMENT OF A BIOPHYSICAL MODEL OF ALFALFA
The actual yield of alfalfa is affected by the harvest index, water, and fertilizer factors [30], [38]. The PAR can be calculated as PAR = P · HI · min(SWDF, NDEF) (22) where the PAR is the actual yield (kg/hm 2 ). HI is the harvest index.

2) COMPUTATION SUBMODEL
The computation submodel consists of the precision regulation strategy for water and fertilizer. It is a comprehensive algorithm, and it is a complex multi-factor process that needs to consider the growth status and environmental factors of alfalfa. We established a multi-factor precision regulation algorithm for water and fertilizer based on rules (MWFPAR). It can accurately calculate the water and fertilizer deficit. The precision control factors and threshold settings are as follows: The MWFPAR calculates the optimum soil water content for the current alfalfa period, compares it with the current soil water content, and then calculates the water deficit of each soil layer.

b: CUTS FACTOR
The MWFPAR optimizes the irrigation strategy of the second and third cuts, which adds another 5% of the irrigation amount based on the current water deficit.

c: GROWTH PERIOD FACTOR (RDS)
Combined with the field irrigation methods and basic soil conditions of alfalfa in the Ningxia irrigation area of the Yellow River, we controlled the soil water content threshold while ensuring a good yield. Under subsurface drip irrigation, when the growth period was pre-branched or branched, the setting SWC was not less than 70% of the field capacity. When the growth period was in the bud stage, the setting SWC was not less than 85% of field capacity. Under other irrigation conditions, when the growth period was pre-branched or branched, the setting SWC was not less than 70% of field capacity. When the growth period was the bud stage, the setting SWC was not less than 80% of field capacity. The mathematical relationship between RDS and SWC is shown in Equation (23) The MWFPAR-ACPS can simulate the growth of alfalfa and the dynamics of the soil moisture based on the meteorological VOLUME 8, 2020 conditions of the next day. If alfalfa requires irrigation, the algorithm first judges whether it will rain the next day. If yes, the biophysical submodel simulates the dynamic growth of alfalfa (such as LAI and RDS) and the soil water content under future weather conditions. The soil water contents of each soil layer are then updated. Finally, the algorithm determines whether to wait for the rain without affecting the output or immediately perform the irrigation task.

e: SOIL LAYER FACTOR
The MWFPAR applies the loop structure to compute the water deficit of each soil layer. The final total amount of irrigation is the sum of the water deficits in each soil layer.

f: NITROGEN FACTOR
The current soil fertility testing technology cannot provide real-time dynamic monitoring. The MWFPAR estimated the nitrogen requirement of alfalfa in the j th district based on current soil total nitrogen content and the target yield. Before irrigation, the algorithm judges the current cuts and the number of alfalfa irrigation times, chooses different proportions of nitrogen application strategies, and applies fertilizer during the first irrigation. The set of computation entity attributes Y = {S w , S n }, where S w represents the water deficit and S n represents the nitrogen deficit. The MWFPAR is shown in Algorithm 1.
where x 1 is an example of weather data for the next day. RDS is the growth period. SWC L is the actual soil water content of layer L(cm 3 ·cm −3 ). OPT_SWC is the optimum water content threshold for the current growth period (cm 3 ·cm −3 ). SAT L is the saturated water content of layer L(cm 3 ·cm −3 ). dlayer(L) is the thickness of layer L(cm). In plot j, NR j is the nitrogen requirement of the crops, NS j is the nitrogen supply of crops, and EC is the nitrogen use efficiency.

3) CYBER-PHYSICAL INTERACTION SUBMODEL
The cyber-physical interaction submodel includes the interaction from physical to computation and the interaction from computation to physical. The construction of these two submodels are intended to 1) define the interactive interface and 2) design the interactive function.

a: DEFINE THE INTERACTIVE INTERFACE
This construction includes the interface from physical to computation and the interface from computation to physical. Therefore, the set is I ={I pc , I cp }, where I pc is a set of interaction parameters from physical to computation and I cp is a set of interaction parameters from computation to physical. We define the interaction set h pc from physical to computation, which is the mapping from the X subset to the I pc subset. We define the interaction set h cp from computation to physical, which is the mapping from the Y subset to the I cp subset. In the PRMWFA-ACPS, the interaction interface from physical to computation is I pc ={SWC l , SWC 2 , SWC 3 , SAT l , SAT 2 , SAT 3 , RDS, cuts, j, EC, FC, NR j , NS j }, and the interaction interface from computation to physical is I cp ={S w , S n }.

Input:
The model steps N during one episode, irrigation methods IRR_MET, optimum soil water content OPT_SWC, soil layer L, the cuts times cuts, the irrigation times j, and the nitrogen use efficiency EC. Initialize crop data and flag. Initialize meteorological data. Initialize soil water and fertilizer data. Output:Water and fertilizer deficit. The values of some interaction parameters in the mapping set of I pc are relatively stable situations in certain cuts, such as the field management, initial soil data on fertility, and field capacity. Therefore, they are uniformly defined as global variables in Ptolemy.

b: DESIGN THE INTERACTIVE FUNCTION
The alfalfa dynamic growth and the external physical environment change are a dynamic continuous biophysical process. The precision regulation strategy of water and fertilizer is performed by computer technology, which is a discrete calculation process. Therefore, the interaction model from physical to computation completes the sampling function. It can discretize biophysical process set h pc to form interaction parameters by sampling. Due to the different water and fertilizer regulation strategies, the calculation results of the water deficit and nitrogen deficit are different. The interaction model from computation to physical is responsible for completing the conversion calculation of the actual irrigation amount of set h cp . The irrigation amount and nitrogen application rate be calculated using Equations (24)- (25).
where Area is the plot area (m 2 ) and Cont is the N content of fertilizer (%). Cyber-physical interactions are performed by interactive parameters. When the PRMWFA-ACPS predicts the irrigation amount, the MWFPAR algorithm judges whether alfalfa requires irrigation according to the current soil moisture status. If yes, the algorithm calculated the water and fertilizer deficit according to the rainfall in the next day and they are transferred to the biophysical submodel as a set of interaction parameters. The biophysical submodel transfers the alfalfa and soil information as a set of interaction parameters to the computation submodel for decision-making. For example, if the current soil water content is less than the optimum water content, it needs irrigation. First, the MWFPAR calculates the irrigation amount according to whether there will be rainfall in the next day. If yes (Rainfall>0), set forecast=1 to indicate that the current state is predicted state (otherwise, it indicates that the state is direct calculation state). Second, we enter the meteorological data of the next day in the PRMWFA-ACPS. The biophysical submodel simulates the growth of alfalfa and its physical environment dynamics in the next day and forms the interactive parameter set I pc . Then the I pc is transferred to the computation submodel to calculate the water and fertilizer deficit under this rainfall condition. If Rainfall≤0, the water and fertilizer deficit is directly calculated and transferred to the biophysical submodel for execution.

IV. PRMWFA-CPS DESIGN IN PTOLEMY
We designed and implemented the PRMWFA-ACPS with Ptolemy, which was developed by Berkeley University in the United States [40]- [41]. We used the role-oriented and model stratification to design the PRMWFA-ACPS, and we applied ports to complete the system construction and data communication. The PRMWFA-ACPS based on Ptolemy is shown in Figure 2.
We packaged the biophysical submodel, computation submodel and cyber-physical interaction submodels of PRMWFA-ACPS in different containers. The details regarding the container name, model function and output evaluation index of each submodel in Ptolemy is shown in Table 1.
Since the leaf area index affects the physical entity as a global variable, the LAI container and the Physical Model container were designed to be the same level. During the operation of the PRMWFA-ACPS system, the Physical Model container first simulates the physical alfalfa entities and the VOLUME 8, 2020 soil dynamics, and it transmits them to the PC_inter container through the cyber-physical interaction port. In the PC_inter container, the continuous data are sampled and passed to the Computation Model container, which applies the MWFPAR to calculate the water deficit and the nitrogen deficit. The water and nitrogen deficits are then transmitted to the CP_inter container. The CP_inter container combined with the actual field, and it converts the water and fertilizer amounts and sends them to the driving device for execution.
Finally, the regulation strategy involves feedback to the Physical Model container to provide the loop feedback control of the ACPS. This regulation ultimately affects and changes the physical environment.

A. BIOPHYSICAL SUBMODEL DESIGN
The biophysical submodel was packaged in the Physical Model to simulate the alfalfa growth. We divided each sub-function into different actors. The data for each container were transmitted through ports. Figure 3 is the biophysical submodel of PRMWFA-ACPS based on Ptolemy. A large number of mathematical models were involved in the biophysical submodel. Using the simulation of leaf area dynamics of alfalfa as an example, the temperature affects the growth of the alfalfa leaf area. It is a typical dynamic continuous biophysical process. When the temperature is lower than 5 • C or higher than 35 • C, the alfalfa stops growing [32]. Figure 4 is the leaf area dynamic model based on Ptolemy. LAI and f(T) are containers, and Tm, A m and A are parameters.

B. COMPUTATION SUBMODEL DESIGN
The computation submodel includes the MWFPAR. The MWFPAR needs to classify impact factors step by step. Therefore, we used controls (such as SetVariable and BooleanSwitch) in Ptolemy to build the Computation Model container hierarchically by roles. We controlled the execution direction of the algorithm according to the data flow direction. To develop the computation submodel, first, we used Parameters and SerVariable controls to declare the data set in the Computation Model container uniformly. Second, we used the BooleanSwitch controls to calculate the optimal soil water content under different irrigation methods and obtain the irrigation signal. The irrigation signal is then transmitted to the COMPUT container through the data input port. Finally, the COMPUT container calculates in turn based on the algorithm of MWFPAR to obtain the water and nitrogen deficit. Figure 5 is the computation submodel of PRMWFA-ACPS based on Ptolemy.

C. CYBER-PHYSICAL INTERACTION SUBMODEL DESIGN
The cyber-physical interaction submodel primarily completes the interaction and fusion of the physical and computation processes. In PC_inter container, we used the PeriodicSampler controls to perform sampling and collect discrete continuous data, which was transmitted by the physical process (such as the soil water content of each layer, or the alfalfa growth period). Based on the actual irrigation method and the field area, the CP_inter container completes the conversion and implementation tasks of the water deficit and nitrogen   deficit. The interaction model PC_inter based on Ptolemy is shown in Figure 6 (a). The interaction model CP_inter based on Ptolemy is shown in Figure 6 (b).

V. VALIDATION AND METHOD FOR PRMWFA-ACPS
Experiments were performed to verify the accuracy of the PRMWFA-ACPS results in the Ningxia irrigation area of the Yellow River from 2016-2018 (four cuts per year). Using the field data from 2016, we have finished setting the physical environment parameters in the model [30]. In this paper, we designed a number of evaluation indicators and selected field data from the first and third cuts in 2017-2018 to verify and evaluate the accuracy and applicability of the PRMWFA-ACPS.  experimental area is temperate continental and semi-arid. The mean annual temperature is approximately 8 • C; the absolute minimum is attained January and the absolute maximum occurs between July and August. The annual average precipitation (approximately 180-220 mm) is primarily distributed in June-September. The total evaporation is approximately 3000 mm.
The soil is a light gray calcium soil. The field capacity, wilting point, and bulk density were measured for each layer of a representative soil profile (Table 2). For the soil layer ranged from 0-60 cm, the pH is 8.61, the organic matter content is 13.4 g·kg −1 , the total nitrogen content is 0.76 g·kg −1 , the available phosphorus is 10.65 mg·kg −1 , and the available potassium is 128.26 mg·kg −1 . The experimental field has a flat terrain and convenient drainage.
The experimental site and the deployment of agricultural sensors are shown in Figure 7. Two meteorological stations and four soil moisture-sensing items were installed above ground. Six types of sensors were employed to monitor the following agricultural conditions continuously: the wind speed, air humidity, air pressure, air temperature, net radiation, and soil moisture. Each station has a field-data hub to gather all the real-time data. The experimental alfalfa is Medicago sativa No. 7, which is a salt-tolerant variety. The drip irrigation materials involve a sidewall drip irrigation belt. The distance between the emitters is 30 cm. The emitter flow rate is 3.0 L/h. The distance between the belts is 60 cm and the VOLUME 8, 2020   The experiment design is based on meteorological data from 2017-2018 from the experimental field. The PRMWFA-ACPS was used to calculate the irrigation amount, nitrogen application rate, and application time. In 2017, the first cuts irrigation quota was 1950 m 3 ·hm −2 and the nitrogen application rate was 72 kg·hm −2 , and the third cuts irrigation quota was 1425 m 3 ·hm −2 and the nitrogen application rate was 24 kg·hm −2 . In 2018, the first cuts irrigation quota was 1500 m 3 ·hm −2 and the nitrogen application rate was 72 kg·hm −2 , the third cuts irrigation quota was 1125 m 3 ·hm −2 and no nitrogen was applied. The date and the amount of irrigation were implemented in batches according to different soil water deficit times and deficits during different growth periods. The fertilizer was urea (including N46.4%), and the soil basic fertility was measured after each cuts. A nitrogen application was combined with the first irrigation. During the experiment, the weeding and pest control of the plots were consistent.

2) MODEL PARAMETERS
There are plenty of parameters in PRMWFA-ACPS. According to the different parameters sources, we used different methods to determine each parameter value. We determined these parameters though two approaches [30]: 1) parts of the parameter values are specified according to previous researches, and 2) the other values are measured from field experiments. The relevant parameters and sources of the model are shown in Table 3.
To ensure the reliability of the parameters, experimental data derived from Ningxia irrigation area of the Yellow River was used to verify and calibrate the parameters.

3) EXPERIMENTAL EVALUATION INDICATORS
This study considered the physiological growth characteristics and physical properties of alfalfa, and we defined four evaluation indicators as the verification and evaluation criteria for the PRMWFA-ACPS. The evaluation indicators and their acquisition methods are as follows:

a: GROWTH PERIOD
Refers to the growth period of alfalfa from sowing (turns green) to harvesting. Due to the influence of the temperature, the harvest date is different for different harvest purposes. For forage purposes, alfalfa is harvested during the first flowering period (when flowering reaches 10%). A sample of 1 m 2 was randomly selected from each plot to record the crop density, growth period, and harvest date.

b: LEAF AREA INDEX (LAI)
Refers to the ratio of the total leaf area to the land area. It is an important vegetation index for estimating the light energy status and canopy productivity of plants, and it is also an important parameter for studying the photosynthesis and transpiration of plants. During the experiments, the leaf area index was measured weekly in each plot. Samples of healthy leaves were randomly selected by stratification, and the lengths and widths of the functional leaves (the middle leaves of the three leaflets) were measured with vernier calipers. The leaf area and leaf area index were calculated according to the leaf area estimation formula. If it rained, the measurements were postponed.

c: SOIL WATER CONTENT (SWC)
Refers to the ratio of volume occupied by water in the soil to the total volume of the soil. It is an important indicator of the demand for water by alfalfa. In the experiment, the soil water content was measured using MP406 soil moisture sensing equipment produced in Australia. These sensors were distributed throughout different soil layers at each plot, at depths of 10 cm, 20 cm, and 30 cm, which were measured every 30 minutes and monitor for 24 hours in real time. Simultaneously, the precipitation and irrigation management were recorded.

d: ABOVEGROUND BIOMASS (AGB)
Refers to the total amount of crop dry matter per unit of land area, which does not include the roots. It can reflect the alfalfa productivity. The higher the output is, the stronger the productivity. During the first flowering period, alfalfa with uniform growth was selected for cutting. The aboveground biomass was measured by sampling three 1 m 2 area for each plot and drying them in an oven at 60 • C until they reached a constant weight.

4) MODEL ACCURACY CALCULATION
To evaluate the model performance, we used the measured/simulated ratio and mean relative error (MRE; Eq. [26])  where N is the total number of data points for comparison, V O,i is a given measured value, and V S,i is the corresponding value predicted by the model. A better model prediction will produce a smaller MRE.

B. RESULT ANALYSIS 1) ANALYSIS OF HARVEST AND GROWTH PERIOD
The growth period simulation is based on the effective accumulated temperature index of alfalfa (the sum of daily temperatures greater than 5 • C). The temperature levels during different years have a specific influence on the alfalfa growth. The simulated and measured growth period of the first and third cuts in 2017-2018 are shown in Table 4. Table 4 shows that the mean relative error (MRE) is below 7%, which is between the simulated and measured results for the first and third cuts in 2017-2018. The turn green date of alfalfa in 2017 was March 28, and in 2018, it was April 7th. Therefore, the harvest periods are different under different cuts for different years, which is the primary cause of the error.

2) ANALYZING SIMULATED AND MEASURED VALUES OF LAI
The LAI of alfalfa has an ''S'' shape. The LAI increased rapidly from the turn green stage (regeneration stage) to the first flowering, which approached or reached the maximum of 6.0. After the pod-forming period, the LAI gradually decreased. For forage production in the Ningxia irrigation area of the Yellow River, alfalfa is harvested at first flowering. The LAI shows a parabolic trend from the regeneration stage to the first flowering.
The comparison between simulated and measured LAIs of first and third cuts in 2017-2018 are shown in Figure 8. The curve is the simulated LAI and the point data are measured. Figure 8 shows that the alfalfa LAI grows rapidly after the plant turns green (regeneration stage) and reaches a higher level when it reaches the first flowering period. The LAI increased from 0.1 to 6.0, and the basic simulation trends are basically consistent with the measured ones. The overall trends in measured and simulated results are very consistent. The maximum date of the simulated LAI is close to the measured date. In 2017, the MRE of the LAI simulation was below 9.8%. In 2018, the MRE was below 9.1%. The simulated and measured LAIs showed good fit over two consecutive years.
Although the simulated and measured LAIs deviated slightly, the model of the LAI simulation can basically represent the LAI growth process of alfalfa. The measured error of the experimental and limited samples selected here may have caused the error.

3) ANALYZING SIMULATED AND MEASURED VALUES OF SOIL WATER CONTENT
In combining the meteorological data from the experimental area, the PRMWFA-ACPS simulates the dynamic balance in the soil water content during the alfalfa growth period day by day.
The comparison between the simulated and measured soil water contents for the first and third cuts in 2017-2018 are shown in Figure 9 and Figure 10. We compared the soil water contents in three layers (0-10 cm, 10-20 cm, and 20-30 cm).
The results show that the simulation is highly consistent with the measured data from 2017-2018, and the overall trend is basically the same. In different soil layers (10 cm, 20 cm, and 30 cm), the MRE of the first cuts is between 4.4% and 9.3%, and the MRE of the third cuts is between 4.3% and 7.7% in 2017. The MRE of the first cuts is between 5.9% and 12.8%, and the MRE of the third cuts is between 6.0% and 8.0% in 2018. The soil water content between the simulated and measured results show good fitting in different soil layers under different cuts.
Although the soil water contents between the simulated and measured results are slightly different, the MRE of the first and third cuts is below 12.8% for two consecutive years. This finding indicated that the PRMWFA-ACPS can basically simulate the dynamic change in the soil water content under different precipitation or irrigation regulation strategies. Through repeated experiments for two consecutive years, we found that the PRMWFA-ACPS has higher error when simulating the soil water content of the first cuts, which may be related to the fact that the model does not include the influence of the wind speed on the soil water content. In the Ningxia irrigation area, the wind speed is higher from April to May, which is the primary factor that affects the simulated and measured errors in the first cuts. Other errors may have been caused by 1) related factors such as the age of the sensors, the working state and the performance of the acquisition circuit during the experiment, occasional sensor failure, protocol conversion, packet loss, and other phenomena leading to abnormal detection data, and 2) influence by wear on the irrigation equipment, with errors in the actual irrigation amount, and 3) micro-rainfall recorded in error in different regions.

4) ANALYZING SIMULATED AND MEASURED YIELD VALUES
According to the physical environment data from different years, the PRMWFA-ACPS dynamically formulates the water and fertilizer precision regulation strategies and predicts the alfalfa yield under different strategies. The predicted and actual yields of the first and third cuts in 2017-2018 are shown in Table 5. Table 5 shows that the predicted yield in 2017 (the second year) is lower than the predicted yield in 2018 (the third year). It is consistent with the yields of the third and fourth year being higher, which is presented by Yan et al. [42]. For two consecutive years, the predicted yield of the first cuts was higher than that of other cuts, which is consistent with the study by Sun et al. [43]. In comparing the predicted and measured yields of the first and third cuts, the MRE was between 5.4% and 14.3% in 2017, and between 1.2% and 8.0% in 2018. Under different water and fertilizer regulation strategies, the simulated yield accuracy shows a good fit. The reason for the error may be the environmental difference between actual growth and the model simulation, and others may be the acquisition of data errors, measurement errors, and losses caused by field management activities.

VI. CONCLUSION
Using the results of field experiment, we determined the primary parameters of the PRMWFA-ACPS in 2016, and we evaluated the applicability and accuracy of the PRMWFA-ACPS in the Ningxia irrigation area of the Yellow River. According to the research results, we obtained the following primary conclusions. 1) We introduced an alfalfa growth model into the ACPS, and we developed the PRMWFA-ACP to address the deep interaction between computation processes and physical processes. The PRMWFA-ACPS could predict the growth of alfalfa and the variation in soil water and nitrogen on the basis of weather forecasts. This method improves the accuracy of water and fertilizer regulation strategies by dynamically tracking the alfalfa growth process. Moreover, the MWFPAR comprehensively considers the environmental factors to improve the accuracy of water and fertilizer irrigation management. This is a new attempt at precision grass research and improves the efficiency of resource utilization in northwest China.
2) The PRMWFA-ACPS was adopted for a field experiment for two consecutive years. It calculated the amount of water and fertilizer and predicted the yields. The results show that the mean relative error of yields between simulated and measured results is between 1.2% and 14.3%. The simulated and measured yields fit well. This finding indicates that the PRMWFA-ACPS has good applicability in the Ningxia irrigation area of the Yellow River.
3) For an accurate PRMWFA-ACPS result, we comprehensively evaluated and analyzed the model using a number of indicators such as the alfalfa growth period, leaf area index, and soil water content. The results of the field experiments for two consecutive years indicate that the mean relative error for the growth period between the simulated and measured results is below 6.8%, which is basically consistent with the growth period of forage for harvesting purposes in the Ningxia irrigation area. The mean relative error of the leaf area index between the simulated and measured findings is below 9.8%. The mean relative error of the soil water content between simulated and measured results is below 12.8%. These findings show that the accuracy of the model is higher. Therefore, this model can effectively guide the precision regulation of water and fertilizer applications to alfalfa in the Ningxia irrigation area of the Yellow River and the agro-pastoral ecotone of Northwest China.
In this paper, we developed the PRMWFA-ACPS to achieve a precise regulation of water and fertilizer management for alfalfa. The results show that the model has higher accuracy and better applicability in the Ningxia irrigation area. Moreover, by adjusting the parameters of the physical environment (e.g., the basic soil data, climate data, and parameters of field management) and the parameters of the physical model (leaf area, water balance model, and soil mineralization) of the PRMWFA-ACPS, this model can be extended to the precise regulation of different crops in other different regions in future.
RUI LIU received the M.S. degree in computer science and technology from Ningxia University, China, where she is currently pursuing the Ph.D. degree with the School of Agriculture. She is also an Associate Professor with the School of Information Engineering, Ningxia University. She has worked in the agricultural engineering and information technology. Her research interests include the crop model and cyber-physical systems.
YAHONG ZHANG received the Ph.D. degree in horticulture from China Agricultural University, in 2003. She is currently a Professor with the School of Agriculture, Ningxia University. Her research interests are in agrometeorology and facility horticultural environment, particularly for the assessment of grassland resources and the environment.
YONGQI GE received the Ph.D. degree in computer science and technology from Northwestern Polytechnical University, in 2016. He is currently an Associate Professor with the School of Information Engineering, Ningxia University. His research interests include cyber-physical systems, energy management, and real-time embedded systems, particularly for embedded intelligent systems.
WEI HU is currently pursuing the Ph.D. degree with the School of Agriculture, Ningxia University, China. He is also an Associate Professor with Yibin University. His research interest is in the evaluation of the grassland ecological environment.
BAIPING SHA is currently pursuing the M.S. degree with the School of Agriculture, Ningxia University, China. His research interests are in cultivation, breeding, and utilization of alfalfa and lawn.