An lstm-mpc collaborative closed-loop multivariable constraint optimal control method based on green ammonia production system

By employing the LSTM-MPC collaborative closed-loop multivariable constraint optimal control method, the control challenges of the green ammonia generation system under complex operating conditions were solved, achieving precise adjustment of the ammonia generation rate and improving system stability, thereby enhancing economic efficiency.

CN122151512APending Publication Date: 2026-06-05SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610257117.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-04
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Under the conditions of fluctuating renewable energy output and multiple operating conditions, the green ammonia generation system exhibits strong coupling of multiple variables, dense constraints, and significant time-varying and nonlinear characteristics of operating conditions. This makes it difficult for traditional control strategies to meet the requirements of multivariate coordination, constraint satisfaction, and rapid disturbance suppression, thus affecting the safe and stable operation and economy of the plant.

Method used

The LSTM-MPC collaborative closed-loop multivariable constraint optimal control method is adopted. LSTM is used for multi-step prediction and online correction, and MPC is used for constraint optimization in the rolling time domain to generate the optimal control command. The hydrogen mass flow rate, nitrogen mass flow rate and reactor inlet temperature are coordinated to achieve precise control of the ammonia generation rate.

Benefits of technology

It improves the tracking accuracy and dynamic stability of ammonia generation rate, reduces the risk of overshoot and oscillation, increases conversion rate and operating economy, and extends the life of key equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122151512A_ABST
    Figure CN122151512A_ABST
Patent Text Reader

Abstract

The application discloses an LSTM-MPC collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system, and relates to the related technical field of multivariable collaborative optimal control of a green ammonia preparation process. The scheme adopts LSTM to perform multistep prediction on an ammonia generation rate, and utilizes process feedback to perform online correction on prediction errors. Accordingly, an MPC solves a constrained optimization problem in a rolling time domain, and generates optimal control instructions acting on a feed valve opening degree and electric heater power. Model parameters are recursively updated based on MPC execution results and process measurement data, a closed-loop collaborative mechanism of prediction optimization-correction is constructed, accurate tracking of a set value by the ammonia generation rate and suppression of overshoot are realized, and the control quality of the green ammonia preparation process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of multivariate collaborative optimization control in the green ammonia production process, specifically to an LSTM-MPC collaborative closed-loop multivariate constrained optimal control method based on a green ammonia production system. Background Technology

[0002] Energy islands, serving as a connecting hub between land and sea renewable energy sources, can convert offshore renewable electricity into green ammonia for storage and transportation, thereby reducing long-distance power transmission costs and improving energy efficiency. However, renewable energy output is volatile and uncertain, easily leading to fluctuations in power supply and equipment load, which in turn causes operational disturbances in the green ammonia generation process. This results in frequent fluctuations in the ammonia generation rate, severely impacting the safe and stable operation of the equipment, equipment lifespan, and operational economics. Therefore, under conditions of frequent changes in operating conditions, achieving rapid and precise regulation of the ammonia generation rate and controlling it within the allowable deviation range of the set value is crucial for ensuring stable operation of the equipment, improving conversion efficiency, and enhancing economic benefits.

[0003] Under conditions of fluctuating renewable energy output and multiple operating conditions, green ammonia generation systems exhibit strong multivariate coupling, dense constraints, and significant time-varying and nonlinear characteristics. Furthermore, the response to the heat exchange link exhibits substantial lag, causing process gain and dynamic characteristics to drift with changes in the operating point. In this context, a single control strategy struggles to simultaneously meet the requirements of multivariate coordination, constraint satisfaction, and rapid disturbance suppression across the entire operating range. Traditional feedback control based on fixed parameter tuning is susceptible to performance degradation due to loop coupling and amplitude limiting saturation. Even with rolling optimization-type control methods, the control effect remains highly dependent on the accuracy and generalization ability of the predictive model. When model mismatch and time-varying disturbances exist, problems such as reduced tracking accuracy, overshoot, and oscillations may occur. Therefore, it is necessary to introduce data-driven modeling methods with online learning and predictive correction capabilities to perform real-time corrections of key dynamics, thereby improving the adaptability and robustness of the control system under complex operating conditions.

[0004] In the preparation of green ammonia, the mass flow rates of hydrogen and nitrogen, as well as the reactor inlet temperature, are key controllable variables determining the reaction rate and conversion level. The former two directly affect the hydrogen-nitrogen ratio and feed intensity, thus determining the ammonia generation rate. The inlet temperature simultaneously affects the reaction kinetics and the exothermic process, significantly influencing bed temperature rise, catalyst activity, and system stability. Therefore, under conditions of frequent load switching driven by energy fluctuations, coordinated regulation of these variables is the core control requirement for achieving ammonia generation rate and system stability. Based on this, an LSTM-MPC collaborative closed-loop multivariate constrained optimization control framework is proposed: LSTM learns the time-varying nonlinear dynamic relationship of the system from conventional operating data, performs multi-step prediction of the ammonia generation rate, and combines online measurement to correct prediction bias; MPC uses the LSTM prediction information as the basis for rolling time-domain optimization, and under constraints such as valve opening and rate of change, electric heater power limit, and ratio and temperature safety boundaries, solves online for the optimal control commands for hydrogen valve opening, nitrogen valve opening, and heater power, and recursively updates the prediction model through closed-loop feedback. This strategy can improve the tracking accuracy and dynamic stability of ammonia generation rate in scenarios with strong coupling, strong constraints and operating condition drift, reduce the risk of overshoot and oscillation, improve conversion rate and operating economy, and help extend the life of key equipment. Summary of the Invention

[0005] This invention provides an LSTM-MPC collaborative closed-loop multivariable constrained optimal control method based on a green ammonia production system. The technical objective is to use LSTM to make multi-step predictions of the ammonia generation rate and combine this with online measurement to correct prediction deviations. This guides MPC to solve constrained optimization problems in the rolling time domain, generating optimal control commands to reduce the tracking deviation and overshoot of the ammonia generation rate, and to achieve coordinated and precise regulation of hydrogen mass flow rate, nitrogen mass flow rate, and reactor inlet temperature.

[0006] The above-mentioned technical objectives of the present invention are achieved through the following technical solutions:

[0007] A collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system using LSTM–MPC includes the following steps:

[0008] First, establish a multi-step prediction and online correction module based on LSTM, including:

[0009] P1: Construct an LSTM-based ammonia generation rate prediction model. A long short-term memory network is used to model the multivariate time-series data of the green ammonia preparation process: input variables include at least hydrogen mass flow rate, nitrogen mass flow rate, reactor inlet temperature, and related measurable state variables; the output is the ammonia generation rate; enabling multi-step prediction of the ammonia generation rate within the future prediction time domain.

[0010] P2: Introduce an online prediction error correction module. Let the online measured ammonia generation rate be y. k The one-step prediction value given by LSTM for time k is , Define prediction bias Online measurements are used to recursively correct LSTM prediction biases and update model parameters online to improve the accuracy and transferability of predictions in the presence of operating condition drift and disturbances, providing reliable prediction information for subsequent rolling optimization.

[0011] Second, based on the above modules, an LSTM-MPC collaborative closed-loop multivariable constrained optimal control system is constructed, specifically including:

[0012] P3: A model predictive controller (MPC) is used in the control system to achieve rolling time-domain constrained optimization control, and an LSTM predictive correction module is embedded in the MPC prediction stage. The MPC uses the ammonia generation rate as the setpoint as the control objective, and uses the hydrogen feed valve opening, nitrogen feed valve opening, and inlet temperature regulating actuator inputs as manipulated variables. The multi-step prediction output and its correction information provided by the LSTM are used as the MPC prediction model information. The constrained optimization problem is solved online in each sampling period to generate the optimal control command sequence and implement the first control quantity, thereby achieving proactive suppression of operating condition disturbances.

[0013] Furthermore, step P3 can be further subdivided into:

[0014] P31: Establish the MPC optimization objective function and rolling time-domain mechanism. Construct a performance index with the tracking error of ammonia generation rate to the setpoint as the main term and the incremental / change rate of the manipulated quantity as the penalty term, and use a rolling time-domain optimization strategy to solve it online to obtain the future control quantity sequence.

[0015] P32: Establish a set of operational constraints and incorporate them into online optimization. Use valve opening limits and rate of change constraints, electric heater power limits and rate of change constraints, hydrogen-nitrogen ratio constraints, and safety boundary constraints such as inlet temperature / pressure as optimization constraints to ensure that control commands meet the safety requirements of the device and the accessibility requirements of the actuators.

[0016] P33: Construct a closed-loop collaborative update mechanism. The execution results of MPC and process measurement data are fed back into the LSTM module for recursively updating prediction bias compensation and model parameters, and synchronously updating the initial state and constraint boundaries of MPC, so that the ammonia generation rate can stably and accurately follow the set value and suppress overshoot and oscillation.

[0017] Finally, the performance of the LSTM-MPC collaborative closed-loop multivariable constrained optimal control method was verified. Comparative experiments were constructed through simulation or field data playback, and compared with conventional feedback control or rolling optimization control schemes without online predictive correction. The control effect was evaluated using indicators such as tracking error, overshoot, oscillation amplitude, constraint violation frequency, and control variable change rate to verify the improved control performance of the present invention under fluctuating operating conditions and disturbances.

[0018] The beneficial effects of this invention are as follows:

[0019] This invention employs an LSTM-MPC collaborative closed-loop multivariable constrained optimal control method to address the stable control requirements of ammonia generation rate in the green ammonia production process. By using LSTM for multi-step prediction and online correction, prediction errors caused by operating condition drift and model mismatch are reduced. Furthermore, MPC achieves multivariable collaborative optimization under constrained conditions, improving the tracking accuracy and dynamic stability of the ammonia generation rate to the setpoint, suppressing overshoot and oscillation, and reducing performance degradation caused by constraint triggering. This ultimately enhances the safe, stable operation and economic efficiency of the plant. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the green ammonia production system in this invention;

[0021] Figure 2 This is a framework diagram of the method of the present invention.

[0022] In the diagram: 100. Power generation unit, 101. Seawater desalination unit, 102. Air liquefaction and separation unit, 103. Proton exchange membrane electrolyzer, 104. Hydrogen storage tank, 105. Multistage compressor, 106. Mixer, 107. First-stage heat exchanger, 108. Heater, 109. Ammonia synthesis reaction tower, 110. Second-stage heat exchanger, 111. Third-stage heat exchanger, 112. Ammonia condenser, 113. Ammonia separator, 114. Flash tank, 115. Stream separator, 116. Circulating compressor, 117. Seawater. Detailed Implementation

[0023] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the specific examples described herein are merely illustrative of the invention and are not intended to limit the invention.

[0024] This invention provides an LSTM–MPC collaborative closed-loop multivariable constraint optimal control method for green ammonia production systems. By combining an LSTM data-driven multi-step prediction and online correction module with an MPC rolling constraint optimization module, it achieves forward-looking adjustment and closed-loop stable control of the ammonia generation rate during the green ammonia preparation process, thereby improving the tracking performance and disturbance rejection capability of the control system under operating condition fluctuations and load disturbances.

[0025] like Figure 1 As shown, the green ammonia production system in this embodiment includes an offshore energy power generation system, a hydrogen and nitrogen feedstock preparation system, a cascade heat exchange system, an ammonia synthesis and separation system, and a circulating gas treatment system.

[0026] The marine energy power generation system is a power generation device 100 that includes wind power generation, photovoltaic power generation and wave power generation. The green electricity generated by the power generation device 100 directly supplies power to the seawater desalination device 101, the air liquefaction separation device 102, the proton exchange membrane electrolyzer 103, the multi-stage compressor 105 and the heater 108. When there is excess electricity, it can store energy through liquid compressed air, supplemented by a certain capacity of electrochemical energy storage, to meet the needs of emergency power supply and black start of the system, increase the rotational inertia of the power system, and realize the combined supply of cold, heat and electricity, while meeting the requirements of air separation.

[0027] The hydrogen and nitrogen feedstock preparation system includes a seawater desalination module, an electrolytic hydrogen production module, and an air separation nitrogen production module. It is used to receive stable green electricity output from the offshore energy power generation system and provide high-purity hydrogen and nitrogen feedstocks for subsequent ammonia synthesis.

[0028] Specifically, in the nitrogen feedstock preparation system,

[0029] The seawater desalination module includes a high-pressure pump and a reverse osmosis seawater desalination device 101. The high-pressure pump drives seawater through a semi-permeable membrane to separate salts, providing standard-compliant water resources for the water electrolysis hydrogen production module.

[0030] The electrolytic hydrogen production module includes a proton exchange membrane electrolyzer 103 and a hydrogen storage tank 104. The stable green electricity output from the marine energy power generation system is connected to the proton exchange membrane water electrolysis device 103 to electrolyze the desalinated seawater into high-purity hydrogen and oxygen. The hydrogen produced at the cathode undergoes separation, deoxygenation, and compression processes to produce green hydrogen with a purity of not less than 99.99%, which is stored in the hydrogen storage tank 104 for subsequent power generation or for ammonia and alcohol production. The oxygen produced at the anode is dried and purified and can be collected for comprehensive utilization.

[0031] The air separation nitrogen generation module includes an air liquefaction separation device 102, which captures nitrogen from the sea air, and after compression, purification, and low-temperature liquefaction distillation, obtains high-purity nitrogen with a purity of not less than 99.99%. The produced green hydrogen and nitrogen are directly mixed at a molar ratio of 3:1 to form fresh raw material gas and transported to the ammonia synthesis and separation system.

[0032] The cascade heat exchange includes a first-stage heat exchanger 107, a second-stage heat exchanger 110, a third-stage heat exchanger 111, a heater 108, and an ammonia condenser 112, forming a three-stage cascade heat exchange network of "reaction product-raw material gas, reaction product-seawater, and reaction product-circulating gas".

[0033] Specifically, in the aforementioned cascade heat exchange system,

[0034] The first stage heat exchanger 107 receives the raw material gas output from the mixer 106 and passes it through the tube side. The 400°C high-temperature reaction product from the ammonia synthesis reaction tower 109 is passed through the shell side of the first stage heat exchanger 107. The high-temperature reaction product and the raw material gas exchange heat in a countercurrent manner, preheating the raw material gas to 356°C and cooling the reaction product to 97°C.

[0035] The heater 108 is driven by green electricity provided by the power generation device 100, which further heats the raw gas, which has been preheated by the first-stage heat exchanger 107, to the temperature required for the ammonia synthesis reaction, 400°C.

[0036] The second-stage heat exchanger 110 uses seawater 117 as the cooling medium. The reaction products after heat exchange in the first-stage heat exchanger 107 are introduced into the tube side of the second-stage heat exchanger 110, and seawater 117 is introduced into the shell side. Through heat exchange, the reaction products are further cooled to 40°C, and the seawater is heated to 45°C. The heated seawater is then transported through pipelines to the pretreatment unit of the seawater desalination device 101 or the island's domestic heating system to realize the secondary utilization of waste heat.

[0037] The third-stage heat exchanger 111 is used to realize the heat exchange between the reaction products and the circulating gas. The shell side of the third-stage heat exchanger 111 is fed with the reaction products cooled by the second-stage heat exchanger 110, and the tube side is fed with the circulating gas discharged from the ammonia separator 113. Through heat exchange, the temperature of the reaction products is reduced to 34°C and the temperature of the circulating gas is increased to 35°C. This can reduce the energy consumption of subsequent compression and preheating of the circulating gas, and at the same time further reduce the temperature of the reaction products, creating conditions for subsequent condensation and separation.

[0038] The reaction products are condensed to 10°C through a three-stage heat exchanger and then through an ammonia condenser 112 to prepare for ammonia separation and purification.

[0039] The ammonia synthesis and separation system includes a multi-stage compressor 105, a mixer 106, an ammonia synthesis reaction tower 109, an ammonia separation tank 113, and a flash tank 114, and is used for the catalytic synthesis and separation purification of ammonia.

[0040] Specifically, in the ammonia synthesis and separation system,

[0041] The multi-stage compressor 105 and mixer 106 are mainly used to pressurize and heat the fresh hydrogen and nitrogen feed gas and mix it with the circulating gas. The green hydrogen produced by the proton exchange membrane electrolyzer 103 and the nitrogen provided by the air liquefaction separation device 102 are fed into the multi-stage compressor 105 at a molar ratio of 3:1 and compressed to 15 MPa through two stages. The pressurized fresh gas is then transported to the mixer 106 through pipelines and fully mixed with the circulating gas returned from the circulating gas treatment module. Then it is directly transported to the first stage heat exchanger 107 of the stepped heat exchange network for preheating.

[0042] The ammonia synthesis reaction tower 109 uses an iron-based catalyst, with the reaction pressure controlled at 15 MPa and the reaction temperature maintained at 400℃. The mixed feed gas, heated by heater 108, is introduced into the ammonia synthesis reaction tower 109 and flows downward along the catalyst bed. The hydrogen-nitrogen mixture undergoes a synthesis reaction under the action of the catalyst. ;

[0043] The ammonia separator 113 and flash tank 114 are used to separate and purify ammonia. The gas-liquid mixture after being condensed by the ammonia condenser 112 is introduced into the middle of the ammonia separator 113. A baffle assembly is installed inside the pipe to prolong the gas-liquid contact time. The liquefied ammonia component settles to the bottom of the tank under gravity, while the unliquefied hydrogen-nitrogen mixture is discharged from the top. The liquid ammonia discharged from the bottom of the ammonia separator 113 is introduced into the flash tank 114 for purification. The ammonia is separated from trace impurities by a sudden pressure drop. The impurity gas escapes from the top of the flash tank 114 and is combined with the purge gas for treatment. The liquid ammonia product is discharged from the bottom and sent to the green ammonia storage tank on the energy island by the product transfer pump.

[0044] The circulating gas treatment system includes a stream distributor 115 and a circulating compressor 116, which are used to improve the utilization rate of raw materials and the energy efficiency of the system.

[0045] Specifically, in the recirculated gas treatment system,

[0046] The stream separator 115 is installed on the gas phase outlet pipeline at the top of the ammonia separation unit 113. Part of the unliquefied hydrogen-nitrogen mixture is discharged as purge gas to remove inert impurities accumulated in the system, and part of it is transported as circulating gas to the third-stage heat exchanger 111 for preheating treatment.

[0047] The circulating compressor 116 compresses the circulating gas, which has been preheated by the third-stage heat exchanger 111, to 15 MPa, matching the pressure of the fresh gas after it has been pressurized. The gas is then sent to the mixer 106 to mix with the fresh gas, thereby realizing the recycling of unreacted raw material gas.

[0048] like Figure 2 As shown, the LSTM-MPC cooperative closed-loop multivariable constraint optimal control method in this embodiment includes the following steps:

[0049] Step 1: Constructing an ammonia generation rate prediction model

[0050] A predictive model for ammonia formation rate was constructed using an LSTM neural network modeling method. The LSTM was used to learn from multivariate time-series data of the green ammonia preparation process to predict the changing trend of the ammonia formation rate over a future period. Let the measured value of the ammonia formation rate be y. k Construct the LSTM input vector s k And establish a single-step prediction mapping:

[0051]

[0052] In the formula, Let θ represent the LSTM nonlinear prediction function, k be the index of the discrete sampling time, and s be the index of the time. k Input feature vectors to LSTM.

[0053] The multi-step prediction sequence in the prediction time domain is obtained through a recursive method:

[0054]

[0055] In the formula, N p To predict the length of the time domain, This is the predicted ammonia generation rate at time k+i based on the information at time k.

[0056] Step 2: Design of Model Predictive Controller Based on Rolling Time-Domain Constraint Optimization

[0057] Model Predictive Control (MPC) is a rolling time-domain optimization control algorithm that predicts future outputs using a predictive model and solves the optimization problem online under constraints to obtain the optimal control command sequence, thus balancing tracking performance and constraint satisfaction. The specific steps of the algorithm implementation are as follows:

[0058] (1) Determine the manipulated variable as the opening degree of the hydrogen feed valve. nitrogen feed valve opening and the power P of the electric heater k And form the manipulator vector:

[0059]

[0060] (2) Due to the reactor inlet temperature T in,k Measurable and adjustable by the electric heater power, a discrete prediction model for the inlet temperature is established to check the temperature constraint in the prediction time domain:

[0061]

[0062] In the formula, This is a one-step prediction of the inlet temperature. Let a be the candidate power at time k in the MPC prediction domain. T For temperature inertia, b T For the power gain with respect to temperature, c T For bias terms;

[0063] And apply inlet temperature safety constraints:

[0064]

[0065] In the formula, N is the predicted value of the inlet temperature at step i. p To predict the number of steps, , These are the safe lower and upper limits for inlet temperature;

[0066] (3) To constrain the hydrogen-nitrogen ratio under valve opening control mode, a mapping function from valve opening to mass flow rate is introduced:

[0067]

[0068]

[0069] In the formula, , Let k be the mass flow rates of hydrogen and nitrogen. , Let k be the opening degree of the hydrogen and nitrogen feed valves. , The pressure difference across the valve. , This is the mapping function from valve opening to mass flow rate;

[0070] And apply hydrogen-nitrogen ratio constraints:

[0071]

[0072] In the formula, , This refers to the permissible range for the hydrogen-nitrogen ratio.

[0073] (4) Construct a rolling optimization objective function to make the ammonia generation rate output follow the setpoint trajectory r as closely as possible. k+i And to suppress excessively rapid changes in valve and power, the objective function is expressed as:

[0074]

[0075] In the formula, Let k be the optimization cost function. Candidate control sequences within the prediction domain, q y To track the weights, R is the smoothed weight matrix, and N... c To control the length of the time domain, For the increment of the manipulation quantity, This is the corrected i-step predicted value of the ammonia formation rate. Manipulated increments are used to suppress drastic changes in the control quantity. The set value is used to predict the ammonia generation rate at step i in the time domain.

[0076] (5) Apply amplitude and rate of change constraints to the actuator, expressed as:

[0077]

[0078]

[0079] In the formula, u min, u max These represent the upper and lower limits of valve opening and electric heater power, respectively. , Set its rate of change limit.

[0080] (6) At each sampling time k, based on the correction prediction sequence obtained in steps one and two... Solve the optimization problem under the above constraints to obtain the optimal control sequence. And only the initial control quantity is issued:

[0081]

[0082] Step 3: Introduce an online prediction deviation correction module

[0083] (1) To improve the accuracy of the prediction model in the presence of operating condition drift and disturbances, closed-loop correction of the LSTM prediction bias is performed using online measurement data. The single-step prediction residual of the LSTM is defined as:

[0084]

[0085] In the formula, This is a one-step prediction of time k based on information from time k-1;

[0086] (2) Bias compensation is applied to the prediction deviation, with a compensation amount of b. k Represented as:

[0087]

[0088] In the formula, α is a recursive coefficient used to adjust the compensation update speed.

[0089] (3) The predicted sequence is corrected using the compensation amount to obtain the corrected multi-step predicted values:

[0090]

[0091] Then, it proceeds to the next sampling time for rolling updates, thus achieving closed-loop control.

[0092] Comparative analysis of the ammonia generation rate following using the LSTM-MPC collaborative control described in this invention versus traditional feedback control or rolling optimization control without online predictive correction shows that the method described in this invention can significantly reduce tracking deviation and overshoot risk under fluctuating and disturbed operating conditions, and maintain control stability while meeting constraints such as valve action, inlet temperature, and ratio, thereby improving the control quality of the green ammonia preparation process.

[0093] The above description is merely a preferred embodiment of the present invention; other effective embodiments are also possible. Any effective improvements proposed by those skilled in the art based on the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system using LSTM–MPC, characterized in that, Includes the following steps: S1. Construct an LSTM-based ammonia generation rate prediction model; use a long short-term memory network to model the multivariate time-series data of the green ammonia preparation process: the input variables include at least hydrogen mass flow rate, nitrogen mass flow rate, reactor inlet temperature and related measurable state variables, and the output is the ammonia generation rate; realize multi-step prediction of the ammonia generation rate in the future prediction time domain; S2. Introduce an online prediction error correction module; the online measured ammonia generation rate is y. k The prediction model gives a one-step prediction value for time k. Define prediction bias Online measurements are used to recursively correct prediction biases and update model parameters online to improve the accuracy and transferability of predictions in the presence of operating condition drift and disturbances, providing reliable prediction information for subsequent rolling optimization. S3. A model predictive controller is used to implement rolling time-domain constraint optimization control, and the correction module is embedded in the prediction link of the model predictive controller (MPC). The MPC uses the ammonia generation rate as the setpoint as the control target, and uses the hydrogen feed valve opening, nitrogen feed valve opening and inlet temperature regulating actuator input as manipulated variables. The multi-step prediction output and its correction information provided by the LSTM-based ammonia generation rate prediction model are used as MPC prediction model information. The constrained optimization problem is solved online in each sampling period to generate the optimal control command sequence and implement the first control quantity, thereby achieving forward-looking suppression of operating condition disturbances.

2. The LSTM-MPC collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system according to claim 1, characterized in that, In step S1, let the measured value of ammonia generation rate be y. k Construct the LSTM input vector s k And establish a single-step prediction mapping: In the formula, Let θ be the LSTM nonlinear prediction function characterized by parameter θ, k be the index of the discrete sampling time, and s be the index of the sampling time. k Input the feature vector to the LSTM; The multi-step prediction sequence in the prediction time domain is obtained through a recursive method: In the formula, N p To predict the length of the time domain, This is the predicted ammonia generation rate at time k+i based on the information at time k.

3. The LSTM-MPC collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system according to claim 1, characterized in that, Step S3 includes: S31. Establish the MPC optimization objective function and rolling time-domain mechanism; construct a performance index with the tracking error of ammonia generation rate to the setpoint as the main term and the incremental / change rate of the manipulated quantity as the penalty term, and use the rolling time-domain optimization strategy to solve it online to obtain the future control quantity sequence; S32. Establish a set of operational constraints and incorporate them into online optimization; use the upper and lower limits of valve opening and rate of change constraints, the upper and lower limits of electric heater power and rate of change constraints, as well as the hydrogen-nitrogen ratio constraints and the safety boundary constraints of inlet temperature / pressure as optimization constraints to ensure that control commands meet the requirements of device safety and actuator accessibility. S33. Construct a closed-loop collaborative update mechanism; feed back the execution results of MPC and process measurement data into the ammonia generation rate prediction model for recursively updating prediction deviation compensation and model parameters, and synchronously update the initial state and constraint boundary of MPC, so that the ammonia generation rate can stably and accurately follow the set value and suppress overshoot and oscillation.

4. The LSTM-MPC collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system according to claim 1, characterized in that, Step S3 specifically includes: (1) Design a model predictive controller based on rolling time-domain constraint optimization. The manipulated variable is determined to be the opening degree of the hydrogen feed valve. nitrogen feed valve opening and the power P of the electric heater k And form the manipulator vector: Due to the reactor inlet temperature T in,k Measurable and adjustable by the electric heater power, a discrete prediction model for the inlet temperature is established to check the temperature constraint in the prediction time domain: In the formula, This is a one-step prediction of the inlet temperature. Let a be the candidate power at time k in the MPC prediction domain. T For temperature inertia, b T For the power gain with respect to temperature, c T For bias terms; And apply inlet temperature safety constraints: In the formula, N is the predicted value of the inlet temperature at step i. p To predict the number of steps, , These are the safe lower and upper limits for inlet temperature; To constrain the hydrogen-nitrogen ratio under valve opening control, a mapping function from valve opening to mass flow rate is introduced: In the formula, , Let k be the mass flow rates of hydrogen and nitrogen. , Let k be the opening degree of the hydrogen and nitrogen feed valves. , The pressure difference across the valve. , This is the mapping function from valve opening to mass flow rate; And apply hydrogen-nitrogen ratio constraints: In the formula, , This refers to the permissible range for the hydrogen-nitrogen ratio. Construct a rolling optimization objective function to make the ammonia generation rate output follow the setpoint trajectory r as closely as possible. k+i And to suppress excessively rapid changes in valve and power, the objective function is expressed as: In the formula, Let k be the optimization cost function. Candidate control sequences within the prediction domain, q y To track the weights, R is the smoothed weight matrix, and N... c To control the length of the time domain, For the increment of the manipulation quantity, This is the corrected i-step predicted value of the ammonia formation rate. Manipulated increments are used to suppress drastic changes in the control quantity. The set value is used to predict the ammonia generation rate at step i in the time domain; Imposing amplitude and rate of change constraints on the actuator is expressed as: In the formula, u min u max These represent the upper and lower limits of valve opening and electric heater power, respectively. , Its rate of change limit; At each sampling time k, based on the obtained corrected prediction sequence, the optimization problem is solved under the above constraints to obtain the optimal control sequence. And only the initial control quantity is issued: (2) Introduce an online prediction deviation correction module To improve the accuracy of the prediction model in the presence of operating condition drift and disturbances, online measurement data is used to perform closed-loop correction of the prediction bias; the single-step prediction residual is defined as: In the formula, This is a one-step prediction of time k based on information from time k-1; Bias compensation is applied to the prediction deviation, with a compensation amount of b. k Represented as: In the formula, α is a recursive coefficient used to adjust the compensation update speed; The predicted sequence is corrected using compensation to obtain the corrected multi-step predicted values: Then, it proceeds to the next sampling time for rolling updates, thus achieving closed-loop control.

5. The LSTM-MPC collaborative closed-loop multivariable constraint optimal control method based on a green ammonia production system according to claim 1, characterized in that, The green ammonia production system includes an offshore energy power generation system, a hydrogen and nitrogen feedstock preparation system, a cascade heat exchange system, an ammonia synthesis and separation system, and a circulating gas treatment system. The offshore energy power generation system comprises wind power, photovoltaic power, and wave power generation devices. The green electricity generated by these devices directly supplies power to the seawater desalination unit, air liquefaction separation unit, proton exchange membrane electrolyzer, multi-stage compressor, and heater. The hydrogen and nitrogen feedstock preparation system includes a seawater desalination module, an electrolytic hydrogen production module, and an air separation nitrogen production module. The cascade heat exchange system includes a first-stage heat exchanger, a second-stage heat exchanger, a third-stage heat exchanger, a heater, and an ammonia condenser. The ammonia synthesis and separation system includes a multi-stage compressor, a mixer, an ammonia synthesis reaction tower, an ammonia separation tank, and a flash tank. The circulating gas treatment system includes a stream distributor and a circulating compressor.