CN116757098B - An automated verification method based on SWAT model multi-objective optimization - Google Patents

An automated verification method based on SWAT model multi-objective optimization Download PDF

Info

Publication number
CN116757098B
CN116757098B CN202311036876.7A CN202311036876A CN116757098B CN 116757098 B CN116757098 B CN 116757098B CN 202311036876 A CN202311036876 A CN 202311036876A CN 116757098 B CN116757098 B CN 116757098B
Authority
CN
China
Prior art keywords
model
parameter
swat
verification
swat model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311036876.7A
Other languages
Chinese (zh)
Other versions
CN116757098A (en
Inventor
丁升
曹文志
王飞飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen University
Original Assignee
Xiamen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen University filed Critical Xiamen University
Priority to CN202311036876.7A priority Critical patent/CN116757098B/en
Publication of CN116757098A publication Critical patent/CN116757098A/en
Application granted granted Critical
Publication of CN116757098B publication Critical patent/CN116757098B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/06Multi-objective optimisation, e.g. Pareto optimisation using simulated annealing [SA], ant colony algorithms or genetic algorithms [GA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/08Fluids
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A20/00Water conservation; Efficient water supply; Efficient water use
    • Y02A20/152Water filtration

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an automatic verification method based on SWAT model multi-objective optimization, which comprises the following steps: s1, initializing a verification program of a SWAT model; s2, setting verification parameters, wherein the specific setting process is as follows: s21, setting an optimization algorithm, the initial population number, the iteration number, the sub population number and the cross variation value of the optimization algorithm, and setting the process number; s22, setting a parameter set range for verification and a parameter adjustment mode of each parameter in the model verification process, wherein the parameter adjustment mode comprises a relative change rate method, an absolute change rate method and a replacement rate method; s3, iteratively operating the SWAT model; s4, evaluating the model by using an optimization algorithm; s5, running the SWAT model for checking completion; the invention can perform multi-objective optimization and multi-site verification, improves the verification efficiency, and solves the problems of identical parameter and different parameter of the model.

Description

一种基于SWAT模型多目标优化的自动化校验方法An automated verification method based on SWAT model multi-objective optimization

技术领域Technical field

本发明涉及计算机处理技术领域,具体涉及一种基于SWAT模型多目标优化的自动化校验方法。The invention relates to the field of computer processing technology, and specifically relates to an automated verification method based on SWAT model multi-objective optimization.

背景技术Background technique

SWAT(Soil and Water Assessment Tool)模型是目前应用最广泛的水文水质模型之一。该模型在水文水质模拟和流域治理情景分析等方面作用明显,它对于流域管理人员理解流域水文水质循环过程,制订流域管理方案有很大的帮助。然而,根据SWAT模型的设置,它可能拥有上千或者更多的参数,这些参数需要进行校验之后才可应用于实际研究。SWAT模型的校验方法,一般分为人工标定和自动标定两种方法。人工标定需要使用者具有较高的专业知识并对模型非常熟悉,并且由于SWAT模型参数众多,采用人工标定法校验模型将耗费大量时间和精力。自动校验的实质是试错法,其校验过程要通过计算机不断迭代,优化模拟数据与监测数据的拟合度,最终寻找到使拟合度达到较优的一组参数组合。随着计算机技术和人工智能的发展,目前应用于水文水质模型校验的优化方法主要有SUFI-2、POS、NSGA3和SA等,这些方法目前已经集成于SWAT-CUP和R-SWAT等软件。这些算法和软件虽然加快了SWAT模型的校验过程,但是仍存在三方面缺陷:(1)使用这些算法并不能解决模型同参异效和异参同效的问题;(2)两个软件集成的算法,均为单目标或双目标优化算法,这些算法在应对多站点模型校验任务时可能存在收敛速度慢等问题;(3)软件普遍使用多线程的方式加快模型校验速度,但SWAT模型为一个计算密集型模型,采用多进程的模型迭代方式可以更有效地加快模型校验速度。因此,SWAT模型的校验过程还存在较大的改进空间,仍需进一步优化才能满足人们的实际使用需求。据此,我们发明了一种SWAT模型的自动化校验方法,该自动化校验方法融合了SWAT模型参数修改、多目标优化算法和多进程运行方式等内容。该方法可以为使用者提供多套模型参数方案,在提升模型校验效率的同时,解决模型同参异效和异参同效的问题。The SWAT (Soil and Water Assessment Tool) model is currently one of the most widely used hydrological and water quality models. This model plays an obvious role in hydrology and water quality simulation and watershed management scenario analysis. It is of great help to watershed managers in understanding the hydrology and water quality cycle process in the watershed and formulating watershed management plans. However, depending on the settings of the SWAT model, it may have thousands or more parameters, which need to be verified before they can be used in actual research. The calibration methods of the SWAT model are generally divided into two methods: manual calibration and automatic calibration. Manual calibration requires users to have high professional knowledge and be very familiar with the model, and since the SWAT model has many parameters, using manual calibration to verify the model will consume a lot of time and energy. The essence of automatic calibration is a trial and error method. The calibration process requires continuous iteration by computers to optimize the fit between simulated data and monitoring data, and finally find a set of parameter combinations that achieve a better fit. With the development of computer technology and artificial intelligence, the current optimization methods used in hydrology and water quality model verification mainly include SUFI-2, POS, NSGA3 and SA, etc. These methods have now been integrated into software such as SWAT-CUP and R-SWAT. Although these algorithms and software speed up the verification process of the SWAT model, they still have three shortcomings: (1) Using these algorithms cannot solve the problem of the same parameters and different effects of the model and the same effect of different parameters; (2) Integration of the two software The algorithms are all single-objective or dual-objective optimization algorithms. These algorithms may have problems such as slow convergence when dealing with multi-site model verification tasks; (3) Software generally uses multi-threading to speed up model verification, but SWAT The model is a computationally intensive model, and the multi-process model iteration method can more effectively speed up model verification. Therefore, there is still a large room for improvement in the verification process of the SWAT model, and further optimization is still needed to meet people's actual use needs. Based on this, we invented an automated verification method for the SWAT model, which integrates SWAT model parameter modification, multi-objective optimization algorithm and multi-process operation mode. This method can provide users with multiple sets of model parameter solutions, improve model verification efficiency, and solve the problem of models with the same parameters having different effects and different parameters having the same effect.

发明内容Contents of the invention

本发明的目的在于提供一种基于SWAT模型多目标优化的自动化校验方法,该基于SWAT模型多目标优化的自动化校验方法融合了SWAT模型参数修改、多目标优化算法和多进程运行方式等内容,为使用者提供多套模型参数方案,可进行多目标优化,多站点校验,提升校验效率,并解决模型同参异效和异参同效的问题。The purpose of the present invention is to provide an automated verification method based on SWAT model multi-objective optimization. The automated verification method based on SWAT model multi-objective optimization integrates SWAT model parameter modification, multi-objective optimization algorithm and multi-process operation mode. , providing users with multiple sets of model parameter solutions, which can carry out multi-objective optimization and multi-site verification, improve verification efficiency, and solve the problem of models with the same parameters having different effects and different parameters having the same effect.

为实现上述目的,本发明采用以下技术方案:In order to achieve the above objects, the present invention adopts the following technical solutions:

一种基于SWAT模型多目标优化的自动化校验方法,包括以下步骤:An automated verification method based on SWAT model multi-objective optimization, including the following steps:

S1、初始化SWAT模型的校验程序,构建将SWAT模型与多目标优化方法耦合的框架结构,在此框架下,将多目标优化方法应用于SWAT模型校验,具体初始化过程为:S1. Initialize the verification program of the SWAT model, and construct a framework structure that couples the SWAT model with the multi-objective optimization method. Under this framework, the multi-objective optimization method is applied to the SWAT model verification. The specific initialization process is:

S11、从ArcSWAT模型中复制已经构建好的SWAT模型的输入输出文件夹;S11. Copy the input and output folders of the constructed SWAT model from the ArcSWAT model;

S12、确定进行校验的水文水质指标,并创建相应指标的监测数据的EXCEL文件;S12. Determine the hydrology and water quality indicators for verification, and create an EXCEL file of monitoring data for the corresponding indicators;

S13、将SWAT模型中的位置表导出到location_table文件夹;S13. Export the location table in the SWAT model to the location_table folder;

S2、设置校验参数,具体设置过程为:S2. Set the verification parameters. The specific setting process is:

S21、设置使用的优化算法以及优化算法的初始种群数量、迭代次数、子种群数量和交叉变异值,并设置使用的进程数量;S21. Set the optimization algorithm used and the initial population number, iteration number, sub-population number and cross-mutation value of the optimization algorithm, and set the number of processes used;

S22、设置用于校验的参数集范围以及每个参数在模型校验过程中的参数调整方式,参数调整方式包括相对变化率定方法、绝对变化率定方法和替换率定方法;S22. Set the parameter set range for verification and the parameter adjustment method of each parameter during the model verification process. The parameter adjustment methods include the relative change rate determination method, the absolute change rate determination method and the replacement rate determination method;

相对变化率定方法的计算公式为:The calculation formula of the relative change rate determination method is: ,

绝对变化率定方法的计算公式为:The calculation formula of the absolute change rate determination method is: ,

替换率定方法的计算公式为:The calculation formula of the substitution rate determination method is: ,

其中,是修改的参数值,/>是SWAT模型中参数的原始值,x是参数变化因子;in, is the modified parameter value,/> is the original value of the parameter in the SWAT model, and x is the parameter change factor;

S3、迭代运行SWAT模型;S3. Iteratively run the SWAT model;

S4、使用优化算法对模型进行评估;S4. Use optimization algorithms to evaluate the model;

S5、运行完成校验的SWAT模型。S5. Run the verified SWAT model.

优选地,步骤S13中所述位置表包括hru表、rch表和sub表。Preferably, the location table in step S13 includes an hru table, a rch table and a sub table.

优选地,步骤S3按照步骤S21中设置的初始种群和各代次的子种群数量将SWAT模型进行迭代运行,具体过程为:Preferably, step S3 iteratively runs the SWAT model according to the initial population and the number of sub-populations of each generation set in step S21. The specific process is:

S31、利用采样方法,根据初始种群数量或子种群数量,从步骤S22的参数集范围中采集参数样本,并生成参数表集合;S31. Use the sampling method to collect parameter samples from the parameter set range in step S22 according to the initial population number or sub-population number, and generate a parameter table set;

S32、根据步骤S21中设置的进程数量进行迭代运行SWAT模型。S32. Run the SWAT model iteratively according to the number of processes set in step S21.

优选地,步骤S31中所述采样方法为随机采样、二项式随机采样或超拉丁立方体采样;步骤S32的具体过程为:Preferably, the sampling method in step S31 is random sampling, binomial random sampling or hyper-Latin cube sampling; the specific process of step S32 is:

S321、将步骤S31中的参数表与步骤S13中的位置表相对应,生成需要修改的位置参数表;S321. Correlate the parameter table in step S31 with the position table in step S13, and generate a position parameter table that needs to be modified;

S322、根据位置参数表从输入输出文件夹中筛选出对应的文件,并储存在内存中;S322. Filter out the corresponding files from the input and output folders according to the position parameter table, and store them in the memory;

S323、针对位置参数表中需要修改的文件,依据每个文件的属性使用不同的函数进行修改,并将已经修改好的和保持现状的文件导入到运行文件夹中进行模型模拟;S323. For the files that need to be modified in the position parameter table, use different functions to modify them according to the attributes of each file, and import the modified and current files into the running folder for model simulation;

S324、运行文件夹中的SWAT模型运行完毕之后进行以下操作,先根据步骤S322中筛选出的文件,将运行文件夹中的模型文件恢复到模型的原始状态,再使用读取文件模块将运行文件夹中的模型结果读取出来,读取文件包括水文响应单元数据、子流域数据和河流数据,并将读取文件、参数表以及位置参数表一起保存在输出文件夹中,用于与监测数据进行对计算模型模拟值和监测值的拟合度。S324. After the SWAT model in the running folder has been run, perform the following operations. First, restore the model files in the running folder to the original state of the model based on the files filtered in step S322, and then use the read file module to read the running files. The model results in the folder are read out. The read files include hydrological response unit data, sub-basin data and river data, and the read files, parameter tables and location parameter tables are saved together in the output folder for use with monitoring data. Carry out the fitting degree of the simulation values and monitoring values of the calculation model.

优选地,步骤S4的具体过程为:Preferably, the specific process of step S4 is:

S41、依据步骤S12创建的监测数据的EXCEL文件和步骤S324读取的模拟值,计算拟合度指数,拟合度指数的计算公式为: 其中,/>表示拟合优度,/>表示第i个数据,表示纳什系数,/>表示第i个监测值,/>表示所有监测值的平均值,/>表示第i个模拟值,/>表示模拟值的平均值;S41. Calculate the fitting degree index based on the EXCEL file of the monitoring data created in step S12 and the simulation value read in step S324. The calculation formula of the fitting degree index is: Among them,/> Indicates the goodness of fit,/> represents the i-th data, represents the Nash coefficient,/> Represents the i-th monitoring value,/> Represents the average of all monitoring values,/> Represents the i-th analog value,/> Represents the average value of simulated values;

S42、初始种群和子种群中所有的模拟结果均按照上述步骤S41的拟合指数进行计算,并将所有拟合度指标储存在内存中;S42. All simulation results in the initial population and sub-population are calculated according to the fitting index in step S41 above, and all fitness indicators are stored in the memory;

S43、将初始种群和子种群的所有SWAT模拟结果重复步骤S41的计算过程;S43. Repeat the calculation process of step S41 for all SWAT simulation results of the initial population and sub-populations;

S44、根据步骤S21设置的优化算法和迭代次数,重复步骤S31-步骤S42,并在初始种群和子种群筛选出非支配解;S44. According to the optimization algorithm and the number of iterations set in step S21, repeat steps S31 to S42, and screen out non-dominated solutions in the initial population and subpopulations;

S45、当所有的迭代次数运算结束,计算所有非支配解并获得Parteo最优解。S45. When all iteration calculations are completed, calculate all non-dominated solutions and obtain the Parteo optimal solution.

优选地,步骤S5的具体过程为:Preferably, the specific process of step S5 is:

S51、比较所有Parteo最优解对应的SWAT模型的参数表,筛选符合流域模拟条件的解作为模型的最终参数集;S51. Compare the parameter tables of the SWAT model corresponding to all Parteo optimal solutions, and select solutions that meet the watershed simulation conditions as the final parameter set of the model;

S52、将最终参数集代入SWAT模型,完成模型自动化校验。S52. Substitute the final parameter set into the SWAT model to complete automatic model verification.

采用上述技术方案后,本发明具有如下有益效果:After adopting the above technical solution, the present invention has the following beneficial effects:

1、本发明可进行多目标优化,多站点校验,在SWAT模型校验过程中嵌入了多种优化算法(如表1所示),相较于之前的单目标优化算法,它可以针对多个水文水质的监测站点和多种拟合度评估指标对校验结果进行分析,这些优化算法有效优化了校验过程。1. The present invention can perform multi-objective optimization and multi-site verification. A variety of optimization algorithms are embedded in the SWAT model verification process (as shown in Table 1). Compared with the previous single-objective optimization algorithm, it can target multiple The calibration results are analyzed using several hydrology and water quality monitoring stations and multiple fitness evaluation indicators. These optimization algorithms effectively optimize the calibration process.

表1 采用的优化算法Table 1 Optimization algorithm used

2、本发明可有效提升校验效率,在SWAT模型中加入了多进程框架,可以利用计算机CPU同时对多个SWAT模型进行模拟,这使的本发明的校验效率高于SWAT-CUP和R-SWAT。2. The present invention can effectively improve the verification efficiency. It adds a multi-process framework to the SWAT model and can use the computer CPU to simulate multiple SWAT models at the same time. This makes the verification efficiency of the present invention higher than that of SWAT-CUP and R. -SWAT.

3、本发明可有效解决模型同参异效和异参同效的问题,采用优化算法对SWAT模型进行校验,它将返回多个参数集,使用者可以通过对比几个参数集的模拟结果,并结合专业知识判断出更符合流域水文水质模拟状况的参数集,可以解决模型同参异效和异参同效的问题。3. The present invention can effectively solve the problem of models with the same parameters having different effects and different parameters having the same effect. It uses an optimization algorithm to verify the SWAT model. It will return multiple parameter sets. The user can compare the simulation results of several parameter sets. , and combined with professional knowledge to determine a parameter set that is more consistent with the hydrology and water quality simulation conditions of the basin, which can solve the problem of the same parameters and different effects of the model and the same effect of different parameters.

附图说明Description of the drawings

图1为本发明的流程图;Figure 1 is a flow chart of the present invention;

图2为本发明的单次SWAT模型校验流程图。Figure 2 is a flow chart of a single SWAT model verification of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with examples. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.

如图1至图2所示,一种基于SWAT模型多目标优化的自动化校验方法,包括以下步骤:As shown in Figures 1 to 2, an automated verification method based on SWAT model multi-objective optimization includes the following steps:

S1、初始化SWAT模型的校验程序,构建将SWAT模型与多目标优化方法耦合的框架结构,在此框架下,将多目标优化方法应用于SWAT模型校验,具体初始化过程为:S1. Initialize the verification program of the SWAT model, and construct a framework structure that couples the SWAT model with the multi-objective optimization method. Under this framework, the multi-objective optimization method is applied to the SWAT model verification. The specific initialization process is:

S11、从ArcSWAT模型中复制已经构建好的SWAT模型的输入输出文件夹;S11. Copy the input and output folders of the constructed SWAT model from the ArcSWAT model;

S12、确定进行校验的水文水质指标,并创建相应指标的监测数据的EXCEL文件;S12. Determine the hydrology and water quality indicators for verification, and create an EXCEL file of monitoring data for the corresponding indicators;

S13、将SWAT模型中的位置表导出到location_table文件夹;S13. Export the location table in the SWAT model to the location_table folder;

步骤S13中所述位置表包括hru表、rch表和sub表;The location table described in step S13 includes hru table, rch table and sub table;

S2、设置校验参数,具体设置过程为:S2. Set the verification parameters. The specific setting process is:

S21、设置使用的优化算法以及优化算法的初始种群数量、迭代次数、子种群数量和交叉变异值,并设置使用的进程数量;S21. Set the optimization algorithm used and the initial population number, iteration number, sub-population number and cross-mutation value of the optimization algorithm, and set the number of processes used;

S22、设置用于校验的参数集范围以及每个参数在模型校验过程中的参数调整方式,参数调整方式包括相对变化率定方法、绝对变化率定方法和替换率定方法;S22. Set the parameter set range for verification and the parameter adjustment method of each parameter during the model verification process. The parameter adjustment methods include the relative change rate determination method, the absolute change rate determination method and the replacement rate determination method;

相对变化率定方法的计算公式为:The calculation formula of the relative change rate determination method is: ,

绝对变化率定方法的计算公式为:The calculation formula of the absolute change rate determination method is: ,

替换率定方法的计算公式为:The calculation formula of the substitution rate determination method is: ,

其中,是修改的参数值,/>是SWAT模型中参数的原始值,x是参数变化因子;in, is the modified parameter value,/> is the original value of the parameter in the SWAT model, and x is the parameter change factor;

S3、迭代运行SWAT模型;S3. Iteratively run the SWAT model;

步骤S3按照步骤S21中设置的初始种群和各代次的子种群数量将SWAT模型进行迭代运行,具体过程为:Step S3 iteratively runs the SWAT model according to the initial population and the number of sub-populations of each generation set in step S21. The specific process is:

S31、利用采样方法,根据初始种群数量或子种群数量,从步骤S22的参数集范围中采集参数样本,并生成参数表集合;S31. Use the sampling method to collect parameter samples from the parameter set range in step S22 according to the initial population number or sub-population number, and generate a parameter table set;

S32、根据步骤S21中设置的进程数量进行迭代运行SWAT模型;S32. Iteratively run the SWAT model according to the number of processes set in step S21;

步骤S31中所述采样方法为随机采样、二项式随机采样或超拉丁立方体采样;步骤S32的具体过程为:The sampling method described in step S31 is random sampling, binomial random sampling or hyper-Latin cube sampling; the specific process of step S32 is:

S321、将步骤S31中的参数表与步骤S13中的位置表相对应,生成需要修改的位置参数表;S321. Correlate the parameter table in step S31 with the position table in step S13, and generate a position parameter table that needs to be modified;

S322、根据位置参数表从输入输出文件夹中筛选出对应的文件,并储存在内存中;S322. Filter out the corresponding files from the input and output folders according to the position parameter table, and store them in the memory;

S323、针对位置参数表中需要修改的文件,依据每个文件的属性使用不同的函数进行修改,并将已经修改好的和保持现状的文件导入到运行文件夹中进行模型模拟;S323. For the files that need to be modified in the position parameter table, use different functions to modify them according to the attributes of each file, and import the modified and current files into the running folder for model simulation;

S324、运行文件夹中的SWAT模型运行完毕之后进行以下操作,先根据步骤S322中筛选出的文件,将运行文件夹中的模型文件恢复到模型的原始状态,再使用读取文件模块将运行文件夹中的模型结果读取出来,读取文件包括水文响应单元数据、子流域数据和河流数据,并将读取文件、参数表以及位置参数表一起保存在输出文件夹中,用于与监测数据进行对计算模型模拟值和监测值的拟合度;S324. After the SWAT model in the running folder has been run, perform the following operations. First, restore the model files in the running folder to the original state of the model based on the files filtered in step S322, and then use the read file module to read the running files. The model results in the folder are read out. The read files include hydrological response unit data, sub-basin data and river data, and the read files, parameter tables and location parameter tables are saved together in the output folder for use with monitoring data. Perform the fitting of the calculation model simulation values and monitoring values;

S4、使用优化算法对模型进行评估;S4. Use optimization algorithms to evaluate the model;

步骤S4的具体过程为:The specific process of step S4 is:

S41、依据步骤S12创建的监测数据的EXCEL文件和步骤S324读取的模拟值,计算拟合度指数,拟合度指数的计算公式为: 其中,/>表示拟合优度,/>表示第i个数据,表示纳什系数,/>表示第i个监测值,/>表示所有监测值的平均值,/>表示第i个模拟值,/>表示模拟值的平均值;S41. Calculate the fitting degree index based on the EXCEL file of the monitoring data created in step S12 and the simulation value read in step S324. The calculation formula of the fitting degree index is: Among them,/> Indicates the goodness of fit,/> represents the i-th data, represents the Nash coefficient,/> Represents the i-th monitoring value,/> Represents the average of all monitoring values,/> Represents the i-th analog value,/> Represents the average value of simulated values;

S42、初始种群和子种群中所有的模拟结果均按照上述步骤S41的拟合指数进行计算,并将所有拟合度指标储存在内存中;S42. All simulation results in the initial population and sub-population are calculated according to the fitting index in step S41 above, and all fitness indicators are stored in the memory;

S43、将初始种群和子种群的所有SWAT模拟结果重复步骤S41的计算过程;S43. Repeat the calculation process of step S41 for all SWAT simulation results of the initial population and sub-populations;

S44、根据步骤S21设置的优化算法和迭代次数,重复步骤S31-步骤S42,并在初始种群和子种群筛选出非支配解;S44. According to the optimization algorithm and the number of iterations set in step S21, repeat steps S31 to S42, and screen out non-dominated solutions in the initial population and subpopulations;

S45、当所有的迭代次数运算结束,计算所有非支配解并获得Parteo最优解;S45. When all iteration calculations are completed, calculate all non-dominated solutions and obtain the Parteo optimal solution;

S5、运行完成校验的SWAT模型;S5. Run the verified SWAT model;

步骤S5的具体过程为:The specific process of step S5 is:

S51、比较所有Parteo最优解对应的SWAT模型的参数表,筛选符合流域模拟条件的解作为模型的最终参数集;S51. Compare the parameter tables of the SWAT model corresponding to all Parteo optimal solutions, and select solutions that meet the watershed simulation conditions as the final parameter set of the model;

S52、将最终参数集代入SWAT模型,完成模型自动化校验。S52. Substitute the final parameter set into the SWAT model to complete automatic model verification.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above are only preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of changes or modifications within the technical scope disclosed in the present invention. All substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (2)

1. An automatic verification method based on SWAT model multi-objective optimization is characterized by comprising the following steps:
s1, initializing a verification program of a SWAT model, constructing a framework structure for coupling the SWAT model with a multi-objective optimization method, and under the framework, applying the multi-objective optimization method to the verification of the SWAT model, wherein the specific initialization process is as follows:
s11, copying an input/output folder of the constructed SWAT model from the ArcSWAT model;
s12, determining hydrologic water quality indexes for verification, and creating an EXCEL file of monitoring data of the corresponding indexes;
s13, exporting a position table in the SWAT model to a location_table folder;
the position table in the step S13 comprises a hru table, an rch table and a sub table;
s2, setting verification parameters, wherein the specific setting process is as follows:
s21, setting an optimization algorithm, the initial population number, the iteration number, the sub population number and the cross variation value of the optimization algorithm, and setting the process number;
s22, setting a parameter set range for verification and a parameter adjustment mode of each parameter in the model verification process, wherein the parameter adjustment mode comprises a relative change rate method, an absolute change rate method and a replacement rate method;
the calculation formula of the relative change calibration method is as follows:
the calculation formula of the absolute change calibration method is as follows:
the calculation formula of the replacement rating method is as follows:
wherein,is a modified parameter value,/->Is the original value of the parameter in the SWAT model, x is the parameter variation factor;
s3, iteratively operating the SWAT model; step S3, performing iterative operation on the SWAT model according to the initial population quantity, the iterative times and the sub population quantity set in the step S21, wherein the specific process is as follows:
s31, acquiring parameter samples from the parameter set range in the step S22 by using a sampling method according to the initial population quantity or the sub population quantity, and generating a parameter table set;
s32, performing iterative operation on the SWAT model according to the number of processes set in the step S21;
the sampling method in the step S31 is random sampling, binomial random sampling or superpulling Ding Lifang body sampling; the specific process of step S32 is:
s321, corresponding the parameter table in the step S31 to the position table in the step S13, and generating a position parameter table to be modified;
s322, selecting corresponding files from the input/output folders according to the position parameter table, and storing the files in the memory;
s323, modifying files to be modified in the position parameter table by using different functions according to the attribute of each file, and importing the files which are modified and kept in the present state into an operation folder to perform model simulation;
s324, after the SWAT model in the operation folder is operated, firstly recovering the model file in the operation folder to the original state of the model according to the files screened in the step S322, then reading out the model result in the operation folder by using a reading file module, wherein the reading file comprises hydrological response unit data, sub-river basin data and river data, and storing the reading file, a parameter table and a position parameter table in an output folder together for carrying out fitting degree on calculation model simulation values and monitoring values with the monitoring data;
s4, evaluating the model by using an optimization algorithm;
the specific process of step S4 is:
s41, calculating a fitness index according to the EXCEL file of the monitoring data created in the step S12 and the simulation value read in the step S324, wherein the calculation formula of the fitness index is as follows: wherein (1)>Represents goodness of fit, ->The data of the i-th data is represented,representing Nash coefficient,/->Represents the ith monitored value,/-)>Mean value of all monitoring values, +.>Represents the i-th analog value,/, for>Representing an average value of the analog values;
s42, calculating all simulation results in the initial population and the sub population according to the fitting indexes of the step S41, and storing all fitting degree indexes in a memory;
s43, repeating the calculation process of the step S41 on all SWAT simulation results of the initial population and the sub population;
s44, repeating the steps S31-S42 according to the optimization algorithm and the iteration times set in the step S21, and screening non-dominant solutions from the initial population and the sub population;
s45, when all iteration times operation is finished, calculating all non-dominant solutions and obtaining a Parteo optimal solution;
s5, running the SWAT model for checking completion.
2. The automatic verification method based on the multi-objective optimization of the SWAT model as claimed in claim 1, wherein the specific process of the step S5 is as follows:
s51, comparing parameter tables of SWAT models corresponding to all Parteo optimal solutions, and screening solutions meeting the watershed simulation conditions as final parameter sets of the models;
s52, substituting the final parameter set into the SWAT model to complete automatic verification of the model.
CN202311036876.7A 2023-08-17 2023-08-17 An automated verification method based on SWAT model multi-objective optimization Active CN116757098B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311036876.7A CN116757098B (en) 2023-08-17 2023-08-17 An automated verification method based on SWAT model multi-objective optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311036876.7A CN116757098B (en) 2023-08-17 2023-08-17 An automated verification method based on SWAT model multi-objective optimization

Publications (2)

Publication Number Publication Date
CN116757098A CN116757098A (en) 2023-09-15
CN116757098B true CN116757098B (en) 2023-11-10

Family

ID=87951844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311036876.7A Active CN116757098B (en) 2023-08-17 2023-08-17 An automated verification method based on SWAT model multi-objective optimization

Country Status (1)

Country Link
CN (1) CN116757098B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951980A (en) * 2017-02-21 2017-07-14 河海大学 An Adaptive Operation Method of Reservoir Group Based on RCP Scenario
CN109376955A (en) * 2018-11-29 2019-02-22 首都师范大学 An optimal allocation method of agricultural non-point source optimal management measures based on ecological service function
EP3748551A1 (en) * 2019-06-07 2020-12-09 Robert Bosch GmbH Method, device and computer program for adjusting a hyperparameter
CN114580762A (en) * 2022-03-10 2022-06-03 河海大学 An error correction method for hydrological forecast based on XGBoost
CN114818324A (en) * 2022-04-26 2022-07-29 广东工业大学 Method, device, medium and equipment for automatically regulating and controlling water quantity and water quality of basin scale
CN115907429A (en) * 2022-12-28 2023-04-04 清华大学 Combined system overflow optimization control method and device based on PSO algorithm

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951980A (en) * 2017-02-21 2017-07-14 河海大学 An Adaptive Operation Method of Reservoir Group Based on RCP Scenario
CN109376955A (en) * 2018-11-29 2019-02-22 首都师范大学 An optimal allocation method of agricultural non-point source optimal management measures based on ecological service function
EP3748551A1 (en) * 2019-06-07 2020-12-09 Robert Bosch GmbH Method, device and computer program for adjusting a hyperparameter
CN114580762A (en) * 2022-03-10 2022-06-03 河海大学 An error correction method for hydrological forecast based on XGBoost
CN114818324A (en) * 2022-04-26 2022-07-29 广东工业大学 Method, device, medium and equipment for automatically regulating and controlling water quantity and water quality of basin scale
CN115907429A (en) * 2022-12-28 2023-04-04 清华大学 Combined system overflow optimization control method and device based on PSO algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《SWAT模型多目标率定与评价——以梅川江流域为例》;李景等;《中国科学院大学学报 》;第38卷(第5期);590-600 *

Also Published As

Publication number Publication date
CN116757098A (en) 2023-09-15

Similar Documents

Publication Publication Date Title
CN111260462B (en) A Transaction Fraud Detection Method Based on Heterogeneous Relational Network Attention Mechanism
CN113297174B (en) Land use change simulation method based on deep learning
CN112884236B (en) A short-term load forecasting method and system based on VDM decomposition and LSTM improvement
CN113380346A (en) Coupling reaction yield intelligent prediction method based on attention convolution neural network
Kumar et al. Ensemble-based assimilation of nonlinearly related dynamic data in reservoir models exhibiting non-Gaussian characteristics
CN116937559A (en) Power system load forecasting system and method based on recurrent neural network and tensor decomposition
CN111737110A (en) A Test Input Selection Method for Deep Learning Models
CN110309907A (en) A dynamic missing value imputation method based on detracking autoencoder
CN115640888B (en) A method for production prediction based on decreasing function embedded threshold sequence network
CN119478278B (en) A method, device, equipment and storage medium for parallel explicit sampling of geological modeling
CN108898257A (en) A kind of gray prediction method based on particle group optimizing
CN116362076A (en) Sensor optimal arrangement method and system considering damage degree of metal structure
CN116757098B (en) An automated verification method based on SWAT model multi-objective optimization
CN118643746A (en) An automated history matching method integrating geological modeling and numerical simulation proxy models
CN119250848A (en) A real estate valuation method based on Bayesian optimization and machine learning
CN111242379A (en) A Kernel Recursive Maximum Correlation Entropy Time Series Online Prediction Method Based on Stochastic Fourier Features
CN110768825A (en) A business traffic prediction method based on network big data analysis
CN111124489A (en) An Estimation Method of Software Function Points Based on BP Neural Network
CN109523099A (en) A kind of concealed orebody Prognosis Modeling method for taking Target area missing control mine index into account
CN115841150A (en) Method for detecting quality of ceramic powder in multilayer ceramic capacitor based on genetic algorithm
CN112463643A (en) Software quality prediction method
CN119419797B (en) A method for predicting power load in industrial and commercial parks
CN118552338B (en) Fast update history fitting paradigm based on multi-stage history experience migration
CN113537458B (en) Rational function neural network construction method, system and readable storage medium
CN117592319A (en) An intelligent prediction method and system for the plugging section length of old wells in salt cavern gas storage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant