Automatic nitrogen fertilizer management optimization method based on PSO-DSSAT test

Through the automatic optimization method of experimental nitrogen fertilizer management of PSO-DSAT, the problem that traditional methods are difficult to comprehensively consider the impact of multiple variables on the target is solved, and the automated adjustment and target optimization of experimental variables in the DSSAT model is realized, which improves the efficiency and effect of model application.

CN119741144APending Publication Date: 2025-04-01NORTHEAST AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411822526.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

When traditional methods face multiple experimental processing and variables, it is difficult to comprehensively consider the impact of multiple variables on the target, resulting in a one-sided and time-consuming conclusion and poor effect.

Method used

By constructing an automatic optimization method for nitrogen fertilizer management of PSO-DSSAT test, MATLAB R-link is used to interact with the PSO algorithm and the DSSAT model, setting the PSO algorithm parameters, initializing the particle position, updating the particle position information until the end condition is met, and the optimal variable combination and particle process iteration value are output.

Benefits of technology

The automated adjustment of experimental variables in the DSSAT model was achieved, and the goals of crop yield, resource utilization efficiency and environmental impact were optimized, the dependence on user experience was reduced, and the efficiency and effectiveness of model application were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741144A_ABST
    Figure CN119741144A_ABST
Patent Text Reader

Abstract

The invention relates to the field of optimization algorithms, in particular to a PSO-DSSAT test-based nitrogen fertilizer management automatic optimization method, which is characterized in that an interaction environment is constructed outside a DSSAT, MATLAB R-link is used as a bridge, and PSO algorithms written by the DSSAT and MATLAB are connected. By compiling and configuring a DSSAT calling file and a batch processing file, multivariable positioning and target data reading of a test file and output are achieved. A user can set the total number of particles and the number of iterations of the PSO algorithm according to requirements and automatically adjust variable values so as to achieve target optimization. According to the method, particle positions and speeds are initialized, the particle positions are iteratively updated, new positions serve as variable values to be modified in a test file, a target is comprehensively evaluated, and a historical optimal position is updated until an end condition is met. And finally outputting an optimal variable combination and a particle iteration value. According to the method, through an automatic optimization process, manual mechanical repetition and subjective conjecture are reduced, and an optimal processing scheme of a DSSAT specified test under a user target is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of optimization algorithms, and in particular to an automatic optimization method for nitrogen fertilizer management based on a PSO-DSSAT test. Background Art

[0002] The DSSAT (Decision Support System for Agrotechnology Transfer) model is one of the most widely used crop models in the world. It is widely used in the fields of agricultural technology transfer, climate change impact assessment and yield prediction. In China, the model has also been recognized by many scholars. By simulating the actual crop growth conditions, it avoids the tediousness and uncertainty of field experiments. However, the DSSAT model involves many experimental management variables, and there are complex interactions between the variables. When faced with multiple experimental treatments and variables, traditional methods are difficult to comprehensively consider the impact of multiple variables on the target, such as the comprehensive analysis of nitrogen fertilizer management, straw return and irrigation strategies on yield improvement, resource utilization efficiency and environmental impact. These methods rely on the subjective judgment of the user and explore the relationship between variables and targets by setting multiple experimental treatments, resulting in one-sided and time-consuming conclusions and poor results. Therefore, it is particularly urgent to develop a comprehensive method that can automatically optimize DSSAT experimental management according to user goals. Summary of the invention

[0003] The purpose of the present invention is to provide an automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT test in order to solve the above problems.

[0004] The present invention achieves the above-mentioned object through the following technical scheme: a method for automatic optimization of nitrogen fertilizer management based on PSO-DSSAT test, characterized in that it comprises the following steps:

[0005] S1: Construction of program interaction environment: Use MATLAB R-link to interact the external program PSO algorithm with the DSSAT model, write and configure the DSSAT model call file and batch file to call the DSSAT model to run the specified experiment;

[0006] S2: Directory setting: locate multiple variables and targets in the test files and output files;

[0007] S3: PSO algorithm parameter setting: According to user needs, the global search capability, convergence speed, optimization time, etc. of the PSO algorithm are adjusted by setting algorithm parameters, and then the optimal combination of multiple variables is optimized by setting the change interval of the specified variables;

[0008] S4: particle attribute initialization: initializing the particle position and randomly assigning the particle position and velocity direction;

[0009] S5: Particle position information update: For particles within the specified variable variation range, the new position information generated by the PSO algorithm for particles at different positions is used as the variable value to be positioned and overwritten in the test file, the DSSAT model call file is run to wake up the DSSAT model, and the batch file is run to guide the DSSAT model to simulate the target test, and a comprehensive evaluation is performed according to the user's goals. The historical optimal position of the particle is updated and the iterative process is recorded until the end condition is met and the loop ends, otherwise this step is restarted;

[0010] S6: Result output: Output the optimal variable combination and particle process iteration value.

[0011] Preferably, the PSO algorithm is written in MATLAB.

[0012] Preferably, the PSO algorithm parameters in S3 include the total number of particles, the number of iterations, cognitive parameters, social parameters, maximum inertia weight, minimum inertia weight and speed limit value.

[0013] Preferably, it is characterized in that the particles at different positions in S5 include particles within a specified range and out-of-bounds particles, and a randomization method is used for the out-of-bounds particles to make their position components return to the variable interval range.

[0014] Preferably, the position information in S5 includes particle velocity and particle position, and the particle velocity and particle position algorithm is as follows:

[0015] v i (t+1)=ω·v i (t)+c1·rand·(p ibest (t)-x i (t))+c2·rand·(p gbest (t)-x i (t))

[0016] x i (t+1)=x i (t)+v i (t+1)

[0017] Where: v i (t) is the velocity component of the ith particle at the tth iteration;

[0018] x i (t) is the position component of the ith particle at the tth iteration;

[0019] ω is the inertia weight; rand is a random number between [0,1];

[0020] c1 and c2 are the cognitive and social parameters of the particle, respectively;

[0021] p ibest (t) is the optimal position component of the ith particle up to the tth iteration;

[0022] p gbest (t) is the optimal position component of all particles up to the tth iteration.

[0023] The beneficial effects of the present invention are:

[0024] 1. By constructing a PSO-DSSAT test nitrogen fertilizer management automatic optimization method, the automatic adjustment of the test variables in the DSSAT model is realized to achieve the optimization of goals such as crop yield, resource utilization efficiency and environmental impact.

[0025] 2. It reduces the model's dependence on user experience and eliminates the limitations of the conclusions drawn when judging the relationship between variables and targets.

[0026] 3. This method realizes automation and batch processing, improves the efficiency and effectiveness of model application, and provides a more scientific and accurate basis for agricultural decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a flow chart of an automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT experiments.

[0028] Figure 2 Optimizing iterative processes and outcomes for nitrogen fertilizer management. DETAILED DESCRIPTION

[0029] Step 1: On the premise of ensuring that the test file can run normally, build a program interaction environment outside DSSAT. MATLAB R-link serves as a bridge between DSSAT and the PSO algorithm written in MATLAB. It transmits the particle position information generated by PSO in real time as a new value to the test file variable, and feeds back the output results of DSSAT to continue the program running; set up the DSSAT call file to facilitate the patent model to wake up DSSAT; write a batch file to run the specified test, so as to guide DSSAT to simulate the target test and make corresponding adjustments when the test changes.

[0030] Step 2: Locate the multiple variables and targets of the test file and output file, and mark them by setting and modifying the test file to facilitate the subsequent particle modification of variables and the data reading of the target output during the comprehensive evaluation.

[0031] Step 3: Set the PSO program algorithm parameters. According to the user's needs for variable optimization, adjust the total number of particles, number of iterations, cognitive parameters, social parameters, maximum inertia weight, minimum inertia weight and speed limit value to balance the global search capability, convergence speed and optimization time of the PSO algorithm.

[0032] Step 4: Initialize the particle position and randomly assign its position and velocity direction.

[0033] Step 5: Update the particle position, obtain the position information of each particle at the new position, and use the randomization method to make the position component of the out-of-bounds particles return to the variable interval range; for particles within the specified range, their position information in the n-dimensional space is used as the new value of the variable and input into the test file. In the test file, make targeted modifications to multiple variables, conduct a comprehensive evaluation of the new position of the particle, judge the quality of the particle position, update the historical optimal position of the particle and record the particle iteration process until the end condition is met and the loop ends, otherwise restart this step.

[0034] Step 6: Output the optimal variable combination and particle process iteration value.

[0035] The present invention is based on the automatic optimization method of nitrogen fertilizer management for DSSAT experiments by PSO, aiming to solve the problem of relying on the user's subjective feeling to set multiple test treatments to judge the relationship between variables and targets in traditional methods. These problems lead to relatively one-sided conclusions, and are often accompanied by high time cost and low efficiency. On the basis of the successful construction of the crop model, MATLAB R-link is set as an interactive bridge between DSSAT and the PSO algorithm written in MATLAB, and the DSSAT call file and the batch file for running the specified experiment are written and set. The DSSAT test variables are optimized with the help of PSO, and the optimal test variable combination for a certain target under the current experiment is calculated. The present invention can realize the optimization of the artificial management scheme of a specified DSSAT experiment according to certain indicators and obtain the optimal test variable combination.

[0036] Example 1

[0037] Taking the corn experiment with known crop variety coefficient as an example, the specific steps to optimize the nitrogen fertilizer management plan of the experiment are as follows:

[0038] Step 1: Build a program interaction environment outside DSSAT. MATLAB R-link serves as a bridge between DSSAT and the PSO algorithm written in MATLAB. Write and set up DSSAT call files and batch files for running specified experiments.

[0039] Step 2, locate the nitrogen fertilizer management variables of the test file and the output file, namely, the amount of nitrogen applied for base fertilizer, the date of application of topdressing, the amount of topdressing and the output data of crop yield, so as to modify the variables and read the output data in a targeted manner.

[0040] Step 3: In this experiment, the scenario considered is that the total nitrogen application rate is 215 kg [N] / ha and the nitrogen application rate is fixed twice, with a full growth period of 148 days. The two variables are the nitrogen application rate of basal fertilizer and the date of topdressing. The search range is set to Taking corn yield as the target, 200 particles were generated for 2 cycles, and the cognitive parameters, social parameters, maximum inertia weight, minimum inertia weight, and speed limit values ​​were 1.5, 2.0, 0.9, 0.4, and 0.15, respectively;

[0041] Step 4: Initialize the particle position and randomly assign its position and velocity direction.

[0042] Step 5: Update the particle position, obtain the position information of each particle at the new position, and use the randomization method to return the position component to the variable range for out-of-bounds particles; for particles within the specified range, their position information in the n-dimensional space is used as the new value of the variable and input into the test file. Multivariate targeted modifications are made in the test file, and the new position of the particle is comprehensively evaluated. Since the goal is to achieve the highest yield, the quality of the particle position can be determined by comparing the output yield, updating the particle's historical optimal position and recording the particle iteration process until the end condition is met and the cycle ends, otherwise this step is restarted.

[0043] Step 6: Output the particle process iteration value and the optimal variable combination [148 56], the result is as follows Figure 2 shown.

[0044] The results show that in the corn experiment, during the entire growth period of 148 days, the optimal nitrogen fertilizer management plan is: basal nitrogen application rate is 67kg[N] / ha, topdressing nitrogen application rate is 215kg[N] / ha-67kg[N] / ha=148kg[N] / ha, and it is applied 56 days after sowing to obtain the maximum target yield of 7260kg / ha, under the premise of a constant total nitrogen application rate of 215kg[N] / ha and a fixed nitrogen application rate of 215kg[N] / ha-67kg[N] / ha=148kg[N] / ha.

Claims

1. A method for automatic optimization of nitrogen fertilizer management based on PSO-DSSAT test, characterized in that: The following steps are involved: S1: Construction of program interaction environment: Use MATLAB R-link to interact the external program PSO algorithm with the DSSAT model, write and configure the DSSAT model call file and batch file to call the DSSAT model to run the specified experiment; S2: Directory setting: locate multiple variables and targets in the test files and output files; S3: PSO algorithm parameter setting: According to user needs, the global search capability, convergence speed, optimization time, etc. of the PSO algorithm are adjusted by setting algorithm parameters, and then the optimal combination of multiple variables is optimized by setting the change interval of the specified variables; S4: particle attribute initialization: initializing the particle position and randomly assigning the particle position and velocity direction; S5: Particle position information update: For particles within the specified variable variation range, the new position information generated by the PSO algorithm for particles at different positions is used as the variable value to be positioned and overwritten in the test file, the DSSAT model call file is run to wake up the DSSAT model, and the batch file is run to guide the DSSAT model to simulate the target test, and a comprehensive evaluation is performed according to the user's goals. The historical optimal position of the particle is updated and the iterative process is recorded until the end condition is met and the loop ends, otherwise this step is restarted; S6: Result output: Output the optimal variable combination and particle process iteration value.

2. The automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT test according to claim 1, characterized in that: The PSO algorithm was written in MATLAB.

3. The automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT test according to claim 1, characterized in that: The PSO algorithm parameters described in S3 include the total number of particles, the number of iterations, cognitive parameters, social parameters, maximum inertia weight, minimum inertia weight and speed limit value.

4. The automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT test according to claim 1 is characterized in that: The particles at different positions in S5 include particles within a specified range and out-of-bounds particles. A randomization method is used for the out-of-bounds particles to make their position components return to the variable interval range.

5. The automatic optimization method for nitrogen fertilizer management based on PSO-DSSAT test according to claim 1, characterized in that: The position information in S5 includes particle velocity and particle position, and the particle velocity and particle position algorithms are as follows: v i (t+1)=ω·v i (t)+c1·rand·(p ibest (t)-x i (t))+c2·rand·(p gbest (t)-x i (t)) x i (t+1)=x i (t)+v i (t+1) Where: v i (t) is the velocity component of the ith particle at the tth iteration; x i (t) is the position component of the ith particle at the tth iteration; ω is the inertia weight; rand is a random number between [0,1]; c1 and c2 are the cognitive and social parameters of the particle, respectively; p ibest (t) is the optimal position component of the ith particle up to the tth iteration; p gbest (t) is the optimal position component of all particles up to the tth iteration.