A rigid chemical ode implicit solving method based on neural network approximate jacobian

CN122654449APending Publication Date: 2026-08-28SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610648751.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-12
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供了一种基于神经网络近似雅可比的刚性化学ODE隐式求解方法,以在保证精度的前提下提高刚性化学ODE求解效率,缓解了现有技术中无法在保证精度和稳定性的前提下刚性化学ODE隐式快速求解的技术问题

Benefits of technology

[0014]This invention provides an implicit solution method for rigid chemical ODEs based on the approximate Jacobian matrix using a neural network. The method first obtains the system state vector corresponding to the rigid chemical ODE at the current time step, which includes temperature, pressure, and the mass fraction of each component. Then, the system state vector is input into a trained neural network model, which directly predicts the approximate Jacobian matrix. This replaces the time-consuming steps of Jacobian matrix construction and matrix inversion in the traditional implicit solution process with a single inference step of the neural network, effectively solving the bottleneck problem that Jacobian calculation accounts for more than 80% of the computational cost in the traditional method. Next, a residual vector is calculated based on the system state vector. The Newton iteration increment is obtained by multiplying the approximate Jacobian matrix with the residual vector and taking the negative value. Finally, the system state vector is updated based on the Newton iteration increment. The convergence of the Newton iteration is determined based on the residual norm corresponding to the updated system state vector. If convergence is achieved, the solution for the current time step is completed; otherwise, the iteration returns with the updated system state vector to continue. This invention deeply integrates the implicit solution framework of backward difference formula with the approximate Jacobian matrix of neural network, constructing a complete solution mechanism covering "system state perception - neural network approximate Jacobian prediction - Newton iterative incremental calculation - convergence judgment and iterative solution". It fundamentally overcomes the shortcomings of existing technologies, such as the difficulty in balancing solution accuracy and acceleration performance, and the risk of error accumulation and solution divergence in direct prediction of component evolution by neural network. It improves the solution efficiency of rigid chemical ODE while ensuring accuracy, and alleviates the technical problem that existing technologies cannot implicitly and quickly solve rigid chemical ODE while ensuring accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122654449A_ABST
    Figure CN122654449A_ABST
Patent Text Reader

Abstract

The application discloses a rigid chemical ODE implicit solving method based on a neural network approximate Jacobian, and belongs to the cross technical field of combustion numerical simulation and artificial intelligence. The method obtains a system state vector corresponding to a rigid chemical ODE at a current time step; inputs the system state vector into a trained neural network model to obtain an approximate Jacobian matrix through the neural network model; calculates a residual vector based on the system state vector, and calculates a Newton iteration increment by using the approximate Jacobian matrix and the residual vector; updates the system state vector based on the Newton iteration increment, and judges whether the Newton iteration converges or not based on a residual norm corresponding to the updated system state vector; if the Newton iteration converges, the solving of the rigid chemical ODE at the current time step is completed, and the next time step is advanced; if the Newton iteration does not converge, the updated system state vector is returned to continue iteration. The application can improve the solving efficiency of the rigid chemical ODE under the premise of ensuring the accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of combustion numerical simulation and artificial intelligence, and in particular to an implicit solution method for rigid chemical ODE based on neural network approximation of Jacobi. Background Technology

[0002] In combustion numerical simulations, to accurately predict fuel ignition characteristics, flame propagation patterns, and pollutant formation processes, detailed chemical reaction mechanisms involving multiple components and elementary reactions are required. The governing equations for such mechanisms are a set of strongly rigid ordinary differential equations, their rigidity stemming from the extremely large timescale span of the chemical reaction process—from nanoseconds of free radical reactions to milliseconds of macroscopic component changes, a difference of more than ten orders of magnitude. For such rigid systems, explicit numerical methods, constrained by stability, require extremely small time steps, resulting in very low computational efficiency. Implicit multi-step methods, represented by backward difference formulas, have become the industry standard for solving rigid chemical kinetic ODEs due to their large stability region and L-stability. The core of implicit solution methods is that each time step and each Newton iteration step requires two time-consuming operations: first, constructing the system's Jacobian matrix; and second, inverting the Jacobian matrix or solving the corresponding linear equations. For detailed combustion mechanisms involving dozens to hundreds of components, the construction and inversion of the Jacobian matrix accounts for more than 80% of the total time spent solving the rigid ordinary differential equations of the entire chemical reaction, becoming the core bottleneck restricting the improvement of combustion numerical simulation efficiency.

[0003] Extensive research has been conducted both domestically and internationally on accelerating the solution of rigid chemical kinetic ODEs. Traditional mechanism simplification methods reduce the computational load of the Jacobian matrix by eliminating redundant components and non-critical reactions in detailed chemical mechanisms, but they easily overlook low-concentration but important free radicals and intermediate products, affecting the accurate prediction of ignition, flameout, and pollutant formation. Table-based methods replace direct numerical calculations by looking up tables during online solutions, but storage and computational costs increase exponentially with the number of components, resulting in high memory and pre-computation costs for table creation. In recent years, machine learning-based methods for predicting chemical source terms have made significant progress. The main idea is to directly fit chemical reaction source terms using neural networks or directly predict the component concentration at the next moment, completely replacing the chemical kinetic ODE solution process. However, these methods suffer from inherent errors in neural network predictions, which accumulate exponentially during long-term integration, leading to solution divergence. Furthermore, these methods struggle to strictly guarantee physical constraints such as element and energy conservation, easily resulting in non-physical solutions and failing to meet the robustness requirements of engineering-grade combustion simulations.

[0004] Therefore, those skilled in the art are dedicated to developing an implicitly accelerated solution method for rigid chemical ODEs that can guarantee accuracy and stability. Summary of the Invention

[0005] In view of this, the present invention provides an implicit solution method for rigid chemical ODE based on neural network approximation Jacobian, which improves the solution efficiency of rigid chemical ODE while ensuring accuracy, and alleviates the technical problem that the prior art cannot implicitly and quickly solve rigid chemical ODE while ensuring accuracy and stability.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: On one hand, this invention provides an implicit solution method for rigid chemical ODEs based on neural network approximation of Jacobi, comprising: S1: Obtain the system state vector corresponding to the rigid chemical ODE at the current time step; wherein, the system state vector includes temperature, pressure and mass fraction of each component; S2: Input the system state vector into the trained neural network model, and obtain the approximate Jacobian matrix through the neural network model; S3: Calculate the residual vector based on the system state vector, and calculate the Newton iteration increment using the approximate Jacobian matrix and the residual vector; S4: Update the system state vector incrementally based on the Newton iteration, and determine whether the Newton iteration has converged based on the residual norm corresponding to the updated system state vector; if converged, complete the solution of the rigid chemical ODE at the current time step, proceed to the next time step and return to step S1; if not converged, return to step S2 with the updated system state vector to continue the iteration.

[0007] Preferably, the training process of the neural network model in step S2 further includes: S21: During the 0-dimensional ignition numerical integration process, monitor the temperature change at the current time step. When the temperature change is greater than a preset threshold, save the system state vector and the corresponding analytical inverse Jacobian matrix at the current moment as training samples. S22: Perform piecewise power transformation and standardization on the system state vector in the training samples to obtain preprocessed input data; S23: Perform piecewise power transformation on each element of the analytic inverse Jacobian matrix in the training samples to obtain preprocessed output data; S24: Input the preprocessed input data into the neural network model and output the approximate Jacobian matrix corresponding to the training sample; S25: Calculate the loss function based on the approximate Jacobian matrix and the preprocessed output data, update the weight parameters of the neural network model, and complete the training of the neural network model.

[0008] Preferably, the expression for the neural network model in step S24 is:

[0009] in, The approximate Jacobian matrix is... Let L be the activation function of the Lth layer. Let L be the weight matrix of the Lth layer. Let y be the bias vector of the Lth layer, and y be the preprocessed input data.

[0010] Preferably, the expression for the loss function in step S25 is:

[0011] in, The value of the loss function. The mean absolute error function, For approximate Jacobian matrix, Let be the analytic inverse Jacobian matrix. To accurately analyze the Jacobian matrix, It is the identity matrix. These are the weight parameters of the neural network model. and These are the weighting coefficients.

[0012] Preferably, step S4 further includes: S41: Perform Newton iteration to solve the system state vectors corresponding to multiple rigid chemical ODEs; in each Newton iteration, mark the converged samples by using a convergence mask, and only perform residual vector calculation on the non-converged samples, call the neural network model to predict the approximate Jacobian matrix and Newton iteration increment calculation to eliminate redundant calculations of the converged samples. S42: When the number of Newton iterations for a single sample exceeds half of the preset maximum number of iterations, and the Newton iterations have not yet converged, the system automatically switches to resolving the rigid chemical ODE of the sample at the current time step using the exact analytical Jacobian matrix.

[0013] Preferably, the method further includes: The system state vector is input into the neural network model for forward inference to obtain the approximate Jacobian matrix. The approximate Jacobian matrix is ​​then post-processed and the linear equations are solved. The forward inference, post-processing, and solving of the linear equations are all completed on the GPU. Data interaction between the CPU and GPU is only performed at the beginning and end of the process to minimize cross-device transmission latency.

[0014] This invention provides an implicit solution method for rigid chemical ODEs based on the approximate Jacobian matrix using a neural network. The method first obtains the system state vector corresponding to the rigid chemical ODE at the current time step, which includes temperature, pressure, and the mass fraction of each component. Then, the system state vector is input into a trained neural network model, which directly predicts the approximate Jacobian matrix. This replaces the time-consuming steps of Jacobian matrix construction and matrix inversion in the traditional implicit solution process with a single inference step of the neural network, effectively solving the bottleneck problem that Jacobian calculation accounts for more than 80% of the computational cost in the traditional method. Next, a residual vector is calculated based on the system state vector. The Newton iteration increment is obtained by multiplying the approximate Jacobian matrix with the residual vector and taking the negative value. Finally, the system state vector is updated based on the Newton iteration increment. The convergence of the Newton iteration is determined based on the residual norm corresponding to the updated system state vector. If convergence is achieved, the solution for the current time step is completed; otherwise, the iteration returns with the updated system state vector to continue. This invention deeply integrates the implicit solution framework of backward difference formula with the approximate Jacobian matrix of neural network, constructing a complete solution mechanism covering "system state perception - neural network approximate Jacobian prediction - Newton iterative incremental calculation - convergence judgment and iterative solution". It fundamentally overcomes the shortcomings of existing technologies, such as the difficulty in balancing solution accuracy and acceleration performance, and the risk of error accumulation and solution divergence in direct prediction of component evolution by neural network. It improves the solution efficiency of rigid chemical ODE while ensuring accuracy, and alleviates the technical problem that existing technologies cannot implicitly and quickly solve rigid chemical ODE while ensuring accuracy and stability. Attached Figure Description

[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 A flowchart of an implicit solution method for rigid chemical ODE based on neural network approximation Jacobian provided in an embodiment of the present invention; Figure 2 This invention provides a graph showing the variation of the mass fraction of major components and convergence error over time in NN-Jac and precise Jacobian 0-dimensional ignition under the drm22 mechanism; Figure 3 A comparison chart of single-step time consumption between NN-Jac and precise Jacobian under different batch sizes is provided for an embodiment of the present invention. Figure 4This is a comparison chart of the acceleration ratios of NN-Jac under different chemical reaction mechanisms provided in an embodiment of the present invention; Detailed Implementation To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] The embodiments of the present invention are described below with reference to the figures.

[0018] like Figure 1 As shown, this invention provides an implicit solution method for rigid chemical ODEs based on neural network approximation of Jacobi, comprising: S1: Obtain the system state vector corresponding to the rigid chemical ODE at the current time step; wherein, the system state vector includes temperature, pressure and mass fraction of each component.

[0019] In this invention, step S1 aims to obtain complete thermodynamic state information of the combustion reaction system at the current time step, providing input data basis for the neural network model to predict the approximate Jacobian matrix in step S2.

[0020] In combustion numerical simulations, after separating the flow terms and chemical source terms in the governing equations using the operator splitting method, the chemical integral simplifies to a 0-dimensional reaction problem at each grid point. Under adiabatic isobaric conditions, the rigid ordinary differential equations describing the chemical kinetic process can be expressed as:

[0021]

[0022] in, For the first Mass fraction of the components For the first The net formation rate of each component, For the first The molecular weight of the components Let T be the total density, T be the temperature, and t be the current time step. The mass-average specific heat capacity at constant pressure of the mixture For the first The enthalpy of each component based on mass. This represents the total number of chemical species.

[0023] The rigid chemical ODE describing the time evolution of the thermochemical composition of a 0-dimensional isobaric process can be uniformly written as:

[0024] Where y is the thermochemical state vector, which constitutes This state vector fully describes the thermodynamic state of the combustion system at the current moment, including the temperature dimension, pressure dimension, and pressure dimension. Each component has a mass fraction dimension, and the system state vector is the unique input to the neural network model in step S2. The neural network model predicts the corresponding approximate Jacobian matrix based on this state vector.

[0025] In the implicit solution framework of the backward difference formula of this invention, a third-order BDF integrator is preferably used, including a BDF1 start step, a BDF2 transition step, and a BDF3 main step. During the time progression, at the beginning of each time step, the system state vector at the current moment is first obtained. For the initial time step, the system state vector is given by the initial conditions; for subsequent time steps, the system state vector is the solution result after the convergence of the Newton iteration in the previous time step. The system state vector is the unique input of the neural network model in step S2, and the neural network model predicts the corresponding approximate Jacobian matrix based on this state vector.

[0026] S2: Input the system state vector into the trained neural network model, and obtain the approximate Jacobian matrix through the neural network model.

[0027] In this invention, step S2 is the core step for accelerating the solution of the neural network. It aims to use the trained neural network model and the system state vector obtained in step S1 as input to directly predict the corresponding approximate Jacobian matrix. In a single inference, the two core high-time-consuming steps of "Jacobi matrix construction + matrix inversion" that account for more than 80% of the total computation time in the traditional implicit solution process can be completed at the same time.

[0028] Before detailing the neural network model training process, we will first explain the complete numerical method flow of the traditional BDF implicit solution framework. For typical hydrocarbon / air detailed chemical mechanisms, the characteristic timescales span multiple orders of magnitude. For rigid mechanisms, the timescales, depending on the chemical mechanism and thermochemical conditions, are typically [missing information]. Seconds or even smaller, timescales that are orders of magnitude smaller than the time step in computational fluid dynamics, limit the use of explicit methods. Currently, implicit methods such as backward difference formulas are typically used to solve rigid ordinary differential equations.

[0029] The general format of a k-order BDF with equal step size is:

[0030] Where k is the order of the BDF, The fixed coefficients of the i-th BDF are uniquely determined by the order k. For the first Thermochemical state vector at each time step For time step, For BDF fixed coefficients, For the current moment and current state Chemical reaction source term function.

[0031] Construct a system of nonlinear equations in residual form:

[0032] in, For the current time step The corresponding residual vector.

[0033] Calculate the Jacobian of the residuals and construct the Newton iteration matrix.

[0034] in, Let be the system Jacobian matrix at the m-th Newton iteration. Let m be the thermochemical state vector at the nth time step and the mth Newton iteration. Let be the partial derivative of the residual function with respect to the system state vector. It is the identity matrix. Let be the Jacobian matrix of the chemical reaction source terms.

[0035] Each iteration in Newton's iterations requires solving a system of linear equations:

[0036] in, Newton iteration increment, Let be the residual vector at the m-th Newton iteration.

[0037] Iterative updates and convergence criteria:

[0038] in, This is the thermochemical state vector updated after the (m+1)th Newton iteration.

[0039] up to the norm of the residual If the error is less than the error tolerance, the iteration converges, and the solution for the current step is obtained. .

[0040] The biggest bottleneck in traditional Newton-Raphson iterations for solving rigid equations of combustion chemical reactions is the construction of the Jacobian matrix (finite difference / analytic differentiation) and matrix inversion, which severely limits large-scale simulations of detailed mechanisms involving multiple components. This invention uses a neural network to directly predict the inverse Jacobian matrix, skipping the traditional Jacobian construction and inversion steps, while preserving the numerical stability of BDF time-progression. The model is deployed to a GPU before computation begins. During Newton-Raphson iterations, gas state parameters are input into the model, and the neural network infers the approximate inverse of the Jacobian matrix, returning it to the CPU to calculate the changes during Newton-Raphson iterations.

[0041] In some implementations, the training process of the neural network model further includes: S21: During the zero-dimensional ignition numerical integration process, monitor the temperature change at the current time step. When the temperature change exceeds a preset threshold, save the system state vector and the corresponding analytic inverse Jacobian matrix at the current moment as training samples.

[0042] In this invention, during the zero-dimensional ignition numerical integration process, initial conditions such as operating temperature, equivalence ratio, and ambient pressure are set. A large number of initial states are generated by random sampling within a specified range using the Monte Carlo method. A third-order BDF numerical integrator is used to numerically integrate the zero-dimensional ignition control equation. During integration, the temperature change at each time step is monitored. When the temperature change exceeds a preset threshold, it indicates that the system is currently in a region of intense chemical reaction with significant changes in kinetic characteristics. At this point, the system state vector at the current moment and the corresponding analytical inverse Jacobian matrix are saved as training samples. The sampling density is controlled by the temperature change threshold, ensuring that the sampling density in the region of intense reaction is higher than that in the region of mild reaction, thus ensuring that the neural network model has better approximation accuracy in the most sensitive stage of the chemical reaction.

[0043] S22: Perform piecewise power transformation and standardization on the system state vector in the training samples to obtain preprocessed input data.

[0044] In this invention, the solutions to rigid chemical ODEs typically contain multiple timescale components, such as fast-reacting free radicals and slow-reacting components in combustion, leading to significant differences in the numerical magnitudes of different variables. For example, the mass fraction of a substance may vary considerably. Between 1 and 1, the data often exhibits a highly skewed distribution, which does not conform to the default assumption of an approximately normal distribution in neural network training. To eliminate this problem, the system state vector in the training samples is subjected to piecewise power transformation and standardization to obtain preprocessed input data. Piecewise power transformation can effectively compress large numerical ranges, while standardization makes different physical quantities comparable and eliminates dimensional differences.

[0045] The piecewise power transformation uses the following transformation method: ; in, Input as the independent variable, ) is the output, and sign(x) is the sign function. This is a hyperparameter, which is set to 0.1 in this application.

[0046] Here, standardization means subtracting the sample mean from all feature values ​​of the input sample and then dividing by the sample standard deviation, so that the sample mean is zero and the variance is 1.

[0047] S23: Perform piecewise power transformation on each element of the analytic inverse Jacobian matrix in the training samples to obtain preprocessed output data.

[0048] In this invention, due to differences in data magnitude and skewed distribution, the order of magnitude of the component mass fractions and the values ​​of the Jacobian matrix elements differ significantly, resulting in a large difference in the magnitudes of the input and output values. A piecewise power transformation is performed on each element of the analytic inverse Jacobian matrix in the training samples to obtain the preprocessed output data. The piecewise power transformation is used to preprocess the data to overcome the large differences in the magnitudes of different components and the large differences in the magnitudes of the same component at different times, thereby improving the data skewness problem and enhancing the model's generalization effect. While compressing large numerical ranges, the piecewise power transformation strictly preserves the sign information and small numerical details of the data, making it particularly suitable for preprocessing large-range physical quantities such as the Jacobian matrix that contain positive and negative values.

[0049] S24: Input the preprocessed input data into the neural network model and output the approximate Jacobian matrix corresponding to the training sample.

[0050] In this invention, a neural network model is constructed using a fully connected neural network as the main architecture. The input layer of this model has a dimension of Ns+2, corresponding to temperature, pressure, and the mass fractions of Ns components, where Ns is the total number of chemical species; the output layer has a dimension of... This corresponds to all elements of the inverse Jacobian matrix. The preprocessed input data is fed into the neural network model, and through layer-by-layer forward propagation, the approximate Jacobian matrix corresponding to the training samples is output.

[0051] Specifically, the expression for the neural network model is:

[0052] in, The approximate Jacobian matrix is... Let L be the activation function of the Lth layer. Let L be the weight matrix of the Lth layer. Let y be the bias vector of the Lth layer, and y be the preprocessed input data.

[0053] Preferably, the activation function The ReLU function is used to achieve higher inference speed. The network architecture can be set as a three-layer fully connected structure of input layer → 32 → 64 → 128 → output layer, but this invention does not limit the specific number of layers or the dimensions of each layer.

[0054] S25: Calculate the loss function based on the approximate Jacobian matrix and the preprocessed output data, update the weight parameters of the neural network model, and complete the training of the neural network model.

[0055] Specifically, the expression for the loss function is:

[0056] in, The value of the loss function. The mean absolute error function, It is an approximate inverse Jacobian matrix. Let be the analytic inverse Jacobian matrix. To accurately analyze the Jacobian matrix, It is the identity matrix. These are the weight parameters of the neural network model. and These are the weighting coefficients.

[0057] In this invention, the loss function uses the Jacobian matrix similarity as the core optimization objective: the first term The approximate Jacobian matrix is ​​measured by the mean absolute error function. Analytical inverse Jacobian matrix Similarity between them; second item The constrained approximate Jacobian matrix satisfies the mathematical property of the inverse matrix, that is, the product of the approximate Jacobian matrix and the exact Jacobian matrix approaches the identity matrix; the third term This is a regularization term used to prevent overfitting in neural network models.

[0058] Preferably, the weights of the loss function can be set to , The training process is completed by updating the weight parameters of the neural network model through the backpropagation algorithm.

[0059] In this invention, after training, the neural network model takes the system state vector as input and an approximate Jacobian matrix as output, and a single inference can simultaneously replace the time-consuming steps of Jacobian matrix construction and inversion in the traditional process.

[0060] During the inference phase, the neural network model's inference process is deployed entirely on the GPU: preprocessed input data is fed into the neural network model for forward inference to obtain an approximate Jacobian matrix. This approximate Jacobian matrix is ​​then post-processed and the linear equations are solved. All forward inference, post-processing, and linear equation solving are performed on the GPU, with data interaction between the CPU and GPU occurring only at the beginning and end of the process, minimizing cross-device transmission latency. Furthermore, optimization strategies such as TorchScript computation graph freezing and automatic mixed-precision inference can be employed to maximize GPU parallel computing efficiency.

[0061] In one specific implementation, based on the drm22 mechanism, tests on the number of iterations required to converge to machine accuracy using a neural approximation of the Jacobian matrix and an exact analytical Jacobian matrix show that the exact analytical Jacobian matrix has higher convergence efficiency, typically requiring only 1-3 steps to reach machine accuracy. The neural approximation of the Jacobian matrix requires 3-5 iterations, but its convergence efficiency is higher than that of the diagonal approximation of the Jacobian matrix. The iterative convergence efficiency of this method lies between that of the exact analytical Jacobian matrix and the diagonal Jacobian matrix. Furthermore, calculations of the methane ignition process using both the neural approximation and the exact Jacobian matrix show that the results are in perfect agreement, with identical convergence errors. For simultaneously solving 1000 different initial 0-dimensional ignition processes, the calculation of the Jacobian matrix and the solution of the linear equation system account for 90% of the time consumption in a single iteration when using the exact analytical Jacobian matrix. The time consumption of a single neural network inference is on the order of 1.0e-3s. The time consumption of a single sub-iteration using the neural approximation of the Jacobian is 4.39e-3s, while the calculation time consumption using the exact Jacobian is 3.48e-2s. The time consumption of a single sub-iteration differs by about 8 times.

[0062] like Figure 2 As shown, based on the drm22 mechanism, the ignition process of methane is calculated using NN-Jac (i.e., the neural network model training formula) and the exact Jacobian matrix. The results show that the calculated mass fractions of the main components by NN-Jac and the exact Jacobian matrix are in perfect agreement. Treating the Cvode calculation results as the exact solution, the convergence errors of both methods are calculated. The convergence errors of both are exactly the same, indicating that the NN-Jac method can complete the solution while maintaining the same accuracy as the exact solver.

[0063] like Figure 3As shown, the time consumption of numerical methods increases almost linearly with the number of initial conditions, while the time consumption of neural network methods increases slowly with the number of initial conditions, fully demonstrating the advantage of batch inference of neural networks. For the drm22 mechanism, with 10,000 initial conditions solved simultaneously, the time consumption of NN-Jac per time step is 0.204s, while the time consumption of Exact-Jac is 0.714s, resulting in a speedup of 3.5.

[0064] like Figure 4 As shown, the overall trend is that the more components a mechanism has and the more initial conditions are computed simultaneously, the greater the speedup ratio and the better the overall speedup effect. For the USC_Mech_ver II mechanism, the speedup ratio can exceed one order of magnitude.

[0065] It should be noted that the network architecture of this invention is not limited to fully connected neural networks, but may also employ convolutional neural networks, Transformer, and other architectures; the time integration method is not limited to BDF, but may also employ implicit methods such as SDIRGK and Radau; the specific number of layers, dimensions of each layer, activation function type, loss function weight coefficients, etc. of the above-mentioned neural network model can all be adaptively adjusted by those skilled in the art according to the scale and accuracy requirements of the actual reaction mechanism. As long as a neural network model that takes the system state vector as input and an approximate Jacobian matrix as output can be realized, it should fall within the protection scope of this invention.

[0066] S3: Calculate the residual vector based on the system state vector, and calculate the Newton iteration increment using the approximate Jacobian matrix and the residual vector.

[0067] In this invention, step S3 is the core solution step in the Newton iteration process of the BDF implicit solution framework, which uses the approximate Jacobian matrix predicted by the neural network model in step S2 and combines it with the traditional Newton iteration process to calculate the Newton iteration increment of the current iteration step.

[0068] In the traditional Newton-Raphson iteration process, it is necessary to first construct the system's Jacobian matrix and then solve the linear equations to obtain the Newton iteration increment. This invention directly predicts the approximate Jacobian matrix through the neural network model trained in step S2, skipping the time-consuming process of constructing and inverting the Jacobian matrix. This operation is completed in one step by a single inference by the neural network, replacing the time-consuming process of "constructing the Jacobian matrix and solving the linear equations / matrix inversion" in the traditional method. Before the calculation begins, the model is deployed on the GPU. During Newton iteration, the gas state parameters are passed into the model, the neural network inferences to obtain the inverse of the approximate Jacobian matrix, and returns it to the CPU to calculate the change in Newton iteration.

[0069] S4: Update the system state vector incrementally based on the Newton iteration, and determine whether the Newton iteration has converged based on the residual norm corresponding to the updated system state vector; if converged, complete the solution of the rigid chemical ODE at the current time step, proceed to the next time step and return to step S1; if not converged, return to step S2 with the updated system state vector to continue the iteration.

[0070] In this invention, step S4 aims to complete the convergence judgment of the Newton iteration and the closed-loop advancement of the solver. The Newton iteration increment calculated in step S3 is superimposed on the current system state vector to complete one Newton iteration update. Based on the updated system state vector, its corresponding residual vector is recalculated, and the norm of the residual vector is obtained. It is determined whether the residual norm is less than the preset error tolerance: if the convergence condition is met, it means that the rigid chemical ODE of the current time step has been solved, the time is advanced to the next time step, and the process returns to step S1 to start a new round of solving; if the convergence condition is not met, the updated system state vector is used as the new current state, and the process returns to step S2 to continue the next Newton iteration.

[0071] In some implementations, step S4 further includes: S41: Perform Newton iteration to solve the system state vectors corresponding to multiple rigid chemical ODEs; in each Newton iteration, mark the converged samples by using a convergence mask, and only perform residual vector calculation on the non-converged samples, call the neural network model to predict the approximate Jacobian matrix and Newton iteration increment calculation to eliminate redundant calculations of the converged samples.

[0072] In this invention, for converged samples, they are marked as converged, and residual vector calculations and Newton iteration increment calculations are no longer performed on them in subsequent iterations; for non-converged samples, they are returned to step S2 with the updated system state vector to continue iteration. The vectorized batch solution architecture can transform the traditional single-sample serial solution process into a vectorized computation process that solves simultaneously across multiple conditions and grid points, fully utilizing the abundant parallel computing power of GPUs.

[0073] S42: When the number of Newton iterations for a single sample exceeds half of the preset maximum number of iterations, and the Newton iterations have not yet converged, the system automatically switches to resolving the rigid chemical ODE of the sample at the current time step using the exact analytical Jacobian matrix.

[0074] In this invention, when the number of Newton iterations for a single sample exceeds half of the preset maximum number of iterations, and step S4 determines that the Newton iterations for the sample have not yet converged, it indicates that the accuracy of the approximate Jacobian matrix predicted by the current neural network is insufficient to make the sample converge. At this time, it automatically switches to the precise analytical Jacobian matrix to resolve the rigid chemical ODE solution for the current time step of the sample. This fallback mechanism ensures that even if the neural network model has insufficient prediction accuracy for some extreme working conditions, the overall solver can still complete the solution by switching back to the traditional precise solution method, thus guaranteeing the absolute convergence stability of the solver from the architecture.

[0075] This application provides an implicit solution method for rigid chemical ODEs based on neural network approximation of the Jacobian matrix. First, the system state vector corresponding to the rigid chemical ODE at the current time step is obtained. The system state vector includes temperature, pressure, and the mass fraction of each component. Then, the system state vector is input into a trained neural network model, which directly predicts the approximate Jacobian matrix. This replaces the time-consuming steps of Jacobian matrix construction and matrix inversion in the traditional implicit solution process with a single inference step of the neural network, effectively solving the bottleneck problem that Jacobian calculation accounts for more than 80% of the computational cost in the traditional method. Next, the residual vector is calculated based on the system state vector. The Newton iteration increment is obtained by multiplying the approximate Jacobian matrix with the residual vector and taking the negative value. Finally, the system state vector is updated based on the Newton iteration increment. The convergence of the Newton iteration is determined based on the residual norm corresponding to the updated system state vector. If convergence is achieved, the solution for the current time step is completed; otherwise, the iteration returns with the updated system state vector to continue. This invention, through the deep integration of the implicit solution framework of backward difference formula and the approximate Jacobian matrix of neural network, constructs a complete solution mechanism covering "system state perception - neural network approximate Jacobian prediction - Newton iterative incremental calculation - convergence judgment and iterative solution". It fundamentally overcomes the shortcomings of existing technologies, such as the difficulty in balancing solution accuracy and acceleration performance, and the risk of error accumulation and solution divergence in direct prediction of component evolution by neural network. It significantly improves the efficiency and robustness of implicit solution of rigid chemical ODE.

[0076] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for implicitly solving rigid chemical ODEs based on neural network approximation of Jacobi, characterized in that, include: S1: Obtain the system state vector corresponding to the rigid chemical ODE at the current time step; wherein, the system state vector includes temperature, pressure and mass fraction of each component; S2: Input the system state vector into the trained neural network model, and obtain the approximate Jacobian matrix through the neural network model; S3: Calculate the residual vector based on the system state vector, and calculate the Newton iteration increment using the approximate Jacobian matrix and the residual vector; S4: Update the system state vector incrementally based on the Newton iteration, and determine whether the Newton iteration has converged based on the residual norm corresponding to the updated system state vector; if converged, complete the solution of the rigid chemical ODE at the current time step, proceed to the next time step and return to step S1; if not converged, return to step S2 with the updated system state vector to continue the iteration.

2. The method according to claim 1, characterized in that, The training process of the neural network model described in step S2 further includes: S21: During the 0-dimensional ignition numerical integration process, monitor the temperature change at the current time step. When the temperature change is greater than a preset threshold, save the system state vector and the corresponding analytical inverse Jacobian matrix at the current moment as training samples. S22: Perform piecewise power transformation and standardization on the system state vector in the training samples to obtain preprocessed input data; S23: Perform piecewise power transformation on each element of the analytic inverse Jacobian matrix in the training samples to obtain preprocessed output data; S24: Input the preprocessed input data into the neural network model and output the approximate Jacobian matrix corresponding to the training sample; S25: Calculate the loss function based on the approximate Jacobian matrix and the preprocessed output data, update the weight parameters of the neural network model, and complete the training of the neural network model.

3. The method according to claim 2, characterized in that, The expression for the neural network model described in step S24 is: in, The approximate Jacobian matrix is... Let L be the activation function of the Lth layer. Let L be the weight matrix of the Lth layer. Let y be the bias vector of the Lth layer, and y be the preprocessed input data.

4. The method according to claim 2, characterized in that, The expression for the loss function in step S25 is: in, The value of the loss function. The mean absolute error function, For approximate Jacobian matrix, Let be the analytic inverse Jacobian matrix. To accurately analyze the Jacobian matrix, It is the identity matrix. These are the weight parameters of the neural network model. and These are the weighting coefficients.

5. The method according to claim 1, characterized in that, Step S4 further includes: S41: Perform Newton iteration to solve the system state vectors corresponding to multiple rigid chemical ODEs; in each Newton iteration, mark the converged samples by using a convergence mask, and only perform residual vector calculation on the non-converged samples, call the neural network model to predict the approximate Jacobian matrix and Newton iteration increment calculation to eliminate redundant calculations of the converged samples. S42: When the number of Newton iterations for a single sample exceeds half of the preset maximum number of iterations, and the Newton iterations have not yet converged, the system automatically switches to resolving the exact analytical Jacobian matrix.

6. The method according to claim 1, characterized in that, The method further includes: The system state vector is input into the neural network model for forward inference to obtain the approximate Jacobian matrix. The approximate Jacobian matrix is ​​then post-processed and the linear equations are solved. The forward inference, post-processing, and solving of the linear equations are all completed on the GPU. Data interaction between the CPU and GPU is only performed at the beginning and end of the process to minimize cross-device transmission latency.