A ship resistance prediction method and system based on a physics-informed neural network

By applying a combination of physical information neural network and random forest model in ship drag forecasting, the problems of time-consuming and low accuracy in traditional forecasting are solved, and efficient and accurate ship drag forecasting is achieved.

CN119442487BActive Publication Date: 2025-06-17WUHAN RIANG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510024873.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-06-17
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

The prior art has problems such as long time and low forecast accuracy in the traditional forecast of ship drag, especially the forecast efficiency and accuracy of different river basins.

Method used

The ship resistance forecast is carried out by using a method based on physical information neural network (PINN), and the basin data is obtained through numerical simulation, a PINN neural network model is constructed, and a random forest model is combined for two-way verification to improve the accuracy and efficiency of forecasting.

Benefits of technology

High-precision forecast of ship drag is achieved, computing efficiency is improved, high computing costs of traditional CFD methods are reduced, and the physical reliability of forecast results is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442487B_ABST
    Figure CN119442487B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of intelligent prediction of ship performance, and discloses a ship resistance prediction method and system based on a physics-informed neural network. The method numerically simulates the straight-ahead motion of a ship in still water to obtain the pressure field and velocity field of the flow domain during the straight-ahead motion and the ship resistance information; constructs a total data set and establishes a training set, a test set and a validation set; establishes a PINN neural network model integrating physical knowledge; obtains a neural network model based on physical information; generates a random forest model and conducts training; uses the random forest model to perform two-way verification on the neural network model based on physical information to form a network model for ship resistance prediction. The present invention effectively increases the reliability of the prediction result at the physical level and speeds up the training efficiency of the neural network model, thereby improving the prediction efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent prediction of ship performance, and particularly relates to a ship resistance prediction method and system based on a physics-informed neural network. Background Technique

[0002] Digital transformation is the only way for the future development of industries. As an important starting point for promoting industrial transformation and development, digital twin technology has formed a generally applicable theoretical and technical system and has been relatively deeply applied in the ship industry. On this premise, in order to meet the future intelligent development needs of domestic industrial software in the ship field, it is necessary to do theoretical research work in efficient intelligent prediction.

[0003] Designing a ship with good resistance performance can effectively improve transportation efficiency, reduce economic costs, and protect the marine environment. Therefore, accurately predicting ship resistance is an important content of ship design and hydrodynamic performance research. The traditional prediction methods of ship resistance are mainly divided into three categories: theoretical research method, model test method, and numerical simulation method. The theoretical research method is in the initial stage of ship design. Since the relevant data for calculating resistance performance such as main dimensions and hull lines are not perfect, it is only possible to summarize and analyze a large number of ship model tests and full-scale ship tests, and then apply empirical formulas and basic knowledge of fluid mechanics to approximately estimate ship resistance. Model tests are generally carried out under simplified typical working conditions and cannot fully simulate the complex sea conditions in actual navigation. Certain errors will also occur during the test process due to scale effects, blockage effects, and measurement accuracy. The numerical simulation method is to simulate the viscous flow field around the hull by computer, which can display the information of the flow field around the hull in detail and predict the hydrodynamic performance of the ship. However, there are often large calculation errors and long calculation times for different ship types or basins, so it is necessary to re-estimate different ships at different speeds or in different basins.

[0004] In the traditional solution and prediction of ship speed performance, it is difficult to achieve good results in both speed and accuracy at the same time and cannot meet the real-time and efficient calculation requirements. In recent years, machine learning has been more and more widely applied in ships. By training neural networks with a large amount of ship model test data, this artificial intelligence method based on actual motion data can improve prediction accuracy, but it lacks physical meaning and has poor generalization ability. To improve the interpretability and applicability of deep learning networks for solving partial differential equation systems, among which the physics-informed neural network (PINN), as a new intelligent solution algorithm, has been partially verified in the application of solving Maxwell's equations, Poisson's equations, and Navier-Stokes equations. Integrating mathematical physics equations and artificial intelligence in the calculation of underlying physical quantities related to ship speed performance will provide new ideas for real-time intelligent prediction of ship performance and is of research necessity and importance.

[0005] Through the above analysis, the problems and defects of the prior art are as follows: In the traditional prediction of ship resistance in the prior art, it takes a long time for different river basins, and the artificial intelligence method based only on actual data lacks physical meaning, has poor generalization ability, and has low prediction accuracy for real-time solution of ship resistance. Summary of the Invention

[0006] To overcome the problems in the related art, the disclosed embodiments of the present invention provide a ship resistance prediction method and system based on a physics-informed neural network. The present invention is used for the prediction work of the navigation resistance of a certain ship.

[0007] The technical solution is as follows: A ship resistance prediction method based on a physics-informed neural network, the method comprising:

[0008] S1, numerically simulate the straight-line motion of the ship in still water to obtain the pressure of the river basin during the straight-line motion , velocity field , ship resistance information ; wherein, is the velocity field in the direction, is the velocity field in the direction, is the velocity field in the direction;

[0009] S2, construct a total data set by sorting out the obtained data , establish a training set , test set and validation set ;

[0010] S3, determine the number of layers of the PINN neural network model and the number of neurons in each layer, and initialize the weights and biases of the PINN neural network model; design the loss function of the PINN neural network model for ship resistance prediction, and add control equations as physical constraints to the loss function. The control equations include the Navier-Stokes equation and the ship resistance formula; select a fully connected neural network as the basic model of the algorithm, select an activation function and design a multiple intelligent optimizer to establish a PINN neural network model integrating physical knowledge;

[0011] S4, substitute the data of the training set into the PINN neural network model integrating physical knowledge for training to obtain a neural network model based on physical information;

[0012] S5, based on the obtained pressure field and velocity field , taking the velocity field as the input feature and the ship resistance as the output feature, setting parameters to control the prediction process of the random forest; and randomly sampling from the obtained training set to form multiple sub-training sets. Each decision tree is trained based on a randomly selected subset of samples; for the decision trees generated for each sub-training set, they are integrated by voting to generate a random forest model, and the average value of the prediction results of all decision trees is taken as the final output result;

[0013] S6, substituting the data of the training set into the random forest model for training, using the data of the validation set to verify the accuracy of the random forest model, using the mean square error to evaluate the accuracy of the random forest model, and adjusting the parameters according to the evaluation results to obtain a mean square error within a range less than 5%;

[0014] S7, using the random forest model to conduct two-way verification on the physics-informed neural network model to form a network model for ship resistance prediction.

[0015] In step S1, numerical simulation of the straight-line motion of the ship in still water is carried out, including: carrying out numerical simulation through the CFD software STARCCM+ and using the finite volume method. First, the fluid region to be solved is discretized by volume control, and each control volume integral is solved in the form of computational grid cells, and physical quantity interpolation is performed on the grid calculation nodes to obtain the values of the entire computational region; the straight-line motion of the ship is simulated through experiments, providing a target ship model, and meshing and basin setting are carried out on the target ship model; the ship is placed in the basin at the set relative speed and stabilized, the velocity field and pressure field values around the ship are monitored, the hull resistance is defined as the force required to tow the ship at a constant speed in still water, a monitoring image of the resistance performance changing with time is created, and the ship resistance value is obtained.

[0016] In step S3, a PINN neural network model integrating physical knowledge is established, including:

[0017] (1) In the PINN neural network model, based on the TensorFlow deep learning framework, a fully connected neural network framework is constructed using the Python programming language on the PyCharm platform, and the control equation is constructed through the Navier-Stokes equation to solve the basin information, enhancing the interpretability of the results of the PINN neural network model at the physical level;

[0018] (2) In the PINN neural network model, the input values are the velocity on the control surface far behind the ship and the ship speed , and the output value is the ship navigation resistance , define the loss function for physical constraints based on the ship resistance equation; the loss function includes: the control equation loss and the network prediction loss . The control equation loss is used to constrain the PINN framework to satisfy the Navier-Stokes equation and the ship resistance equation; the network prediction loss is the mean square error between the network output value and the true value, which is used to constrain the weight update of the PINN neural network model.

[0019] In step (1), when , is the fluid viscosity coefficient, is a constant; the differential equation of motion of a viscous compressible Newtonian fluid is the Navier-Stokes equation, and the vector form is as follows:

[0020] ;

[0021] In the formula, is the fluid velocity, is the external force term, is the fluid density, is the gradient operator, is the Laplace operator;

[0022] In the rectangular coordinate system, the scalar form is:

[0023] ;

[0024] ;

[0025] ;

[0026] In the formula, are respectively the external force terms in three directions, is the space-time coordinate, is the viscosity coefficient;

[0027] For an incompressible fluid, there is . Define the loss function for physical constraints based on the simplified Navier-Stokes equation as follows:

[0028] ;

[0029] ;

[0030] ;

[0031] In the formula, are all loss function terms;

[0032] The input quantity is the space-time coordinate and the ship speed , output the flow field velocity at the current time and space and the pressure ; Obtain the basin information during ship navigation, and construct a PINN network structure for obtaining the ship navigation resistance R according to the basic principle of the Jones wake measurement method.

[0033] Furthermore, the wake measurement method includes:

[0034] (1) The momentum loss in the wake plane behind the ship is completely caused by viscosity;

[0035] (2) There is no energy loss between the measurement plane near the hull and the plane at twice the ship's length behind the ship, that is, there is no total head loss; at the control surface, there are no waves; from step (1), The viscous force on the micro-area is equal to the momentum loss per unit time on this area, and the expression is:

[0036] ;

[0037] In the formula, is the micro-area on the control surface, is the viscous force on the micro-area, is the velocity on the control surface far behind the ship;

[0038] The viscous resistance suffered by the hull is obtained by integrating along the entire control area:

[0039] ;

[0040] In the formula, is the ship resistance, is the control surface.

[0041] In step (2), based on the ship resistance equation, the loss function for physical constraints is defined as follows:

[0042] ;

[0043] In the formula, is the loss function term, is the ship resistance, is the fluid density, is the velocity on the control surface far behind the ship, is the ship speed, is the control surface, is the micro-area on the control surface.

[0044] In step (2), the control equation loss is obtained from the mean square error of the control equation error passed, and the network prediction loss is obtained from the mean square error between the training set data, i.e., the basin velocity, pressure, and ship resistance data, and the output result of the fully connected network. The loss function is expressed as follows:

[0045] ;

[0046] represents the error between the network fitting value and the true value, and the expression is:

[0047] ;

[0048] In the formula, is the total number of sample data, represents the th sample, is the network input feature, is another network input feature, is the th true value of the sample, is the network prediction data, is the true data;

[0049] represents the error between the network fitting value and the physical law, and the expression is:

[0050] ;

[0051] In the formula, is the total number of samples, is the network input data feature, is another network input feature, is the loss function of the physical equation.

[0052] In step S4, the training process of the PINN neural network model integrating physical knowledge is as follows:

[0053] Substitute the data of the training set into the PINN neural network model integrating physical knowledge. The PINN neural network model integrating physical knowledge initializes to generate weights and corresponding output values, and calculates the loss function value between the output value and the true value; among them, the loss function consists of a statistical function and a control equation. The statistical function is used to measure the error between the output value and the corresponding true value in the training set, and the control equation is used to physically constrain the result;

[0054] Optimize the result of the loss function through gradient descent. According to the chain rule, forward-propagate the optimized correction value to the hidden layer to correct the weights. After multiple rounds of iteration and weight update, complete the training of the model, realize the intelligent prediction of ship resistance by integrating mathematical physics equations and artificial intelligence, and obtain a neural network model based on physical information.

[0055] Another object of the present invention is to provide a ship resistance prediction system based on a physics-informed neural network. This system implements the ship resistance prediction method based on a physics-informed neural network. The system includes:

[0056] A numerical simulation module, used to perform numerical simulation on the straight-line motion of a ship in still water, and obtain the pressure field and velocity field of the basin and ship resistance information during straight-line motion;

[0057] A data partitioning module, used to construct a total data set by sorting the acquired data, and establish a training set, a test set, and a validation set;

[0058] A PINN neural network model establishment module integrating physical knowledge, used to determine the number of layers of the PINN neural network model and the number of neurons in each layer, initialize the weights and biases of the PINN neural network model, select a fully connected neural network as the basic model of the algorithm, select an activation function and design a multiple intelligent optimizer, and establish a PINN neural network model integrating physical knowledge;

[0059] A neural network model acquisition module based on physical information, used to substitute the data of the training set into the PINN neural network model integrating physical knowledge for training, and obtain a neural network model based on physical information;

[0060] A random forest model generation module, used for the obtained data, taking the velocity field as the input feature and the ship resistance as the output feature, setting parameters to control the prediction process of the random forest; and randomly sampling from the training set obtained in step S2 to form multiple sub-training sets, where each decision tree is trained based on a randomly selected sample subset; for the decision trees generated by each sub-training set, they are integrated by voting to generate a random forest model, and the average value of the prediction results of all decision trees is taken as the final output result;

[0061] A random forest model training module, used to substitute the data of the training set into the random forest model for training, and use the data of the validation set to verify the accuracy of the random forest model. The mean square error is used to evaluate the accuracy of the random forest model, and the parameters are adjusted according to the evaluation results to obtain a mean square error within a range less than 5%;

[0062] The two-way verification module is used to perform two-way verification on the physics-informed neural network model using a random forest model to form a network model for ship resistance prediction.

[0063] Furthermore, the ship resistance prediction system based on the physics-informed neural network is carried on a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the functions in the above-mentioned ship resistance prediction system based on the physics-informed neural network can be realized.

[0064] Combining all the above technical solutions, the beneficial effects of the present invention are as follows: Aiming at the problem of intelligent prediction of ship resistance, the present invention studies the underlying physical characteristics involved in ship speed performance to ensure its accuracy and universality. Subsequently, through in-depth research on the physics-informed neural network method, a parametric solution method for the Navier-Stokes equation is formed. Further, a network model for real-time solving and predicting ship resistance by combining mathematical equations and artificial intelligence technology is proposed. Finally, based on the above research, the surrounding waters of the ship are inverted and predicted, so as to achieve high-precision prediction of ship resistance. This method is of great significance for providing sufficient and accurate real-sea data and ship own data for the ship digital twin model.

[0065] Compared with the prior art, by applying the physics-informed neural network to ship resistance prediction, the present invention effectively solves the problems existing in the traditional numerical simulation using the CFD method, such as difficult mesh generation, large computational cost, and low computational efficiency. It effectively increases the reliability of the prediction results at the physical level, speeds up the training efficiency of the neural network model, thereby improving the prediction efficiency, and uses a random forest model to perform two-way verification on the physics-informed neural network model, and finally realizes the intelligent prediction of ship resistance by integrating mathematical equations and artificial intelligence.

[0066] By introducing an intelligent prediction algorithm that combines the physics-informed neural network (PINN) and the random forest model, the present invention not only improves the accuracy and computational efficiency of ship resistance prediction, but also effectively reduces the high computational cost in the traditional CFD method. This technology can be widely applied in the fields of ship design, shipping scheduling, and ocean engineering, providing more accurate resistance prediction for shipping companies and ship manufacturers, thereby improving ship fuel efficiency, reducing carbon emissions, and bringing considerable commercial value and long-term benefits to the industry under the background of increasingly strict global environmental protection regulations. In addition, the intelligent prediction system based on this technology can also provide strong data support for ship performance optimization and intelligent decision-making, thus promoting the digital transformation of the shipbuilding industry.

[0067] Traditional ship resistance prediction methods mostly rely on CFD-based numerical simulations, but they face problems such as difficult mesh generation, high computational cost, and low efficiency. The present invention combines physics-informed neural networks (PINNs) with machine learning techniques, innovatively integrating physical constraints with artificial intelligence algorithms, breaking through the bottlenecks of traditional technologies and filling the gap in the field of ship resistance prediction technology that combines deep learning and physical information at home and abroad. In addition, the two-way verification mechanism of the random forest model also improves the credibility and robustness of the prediction to a certain extent, further consolidating the technical advantages of the present invention.

[0068] The present invention solves many pain points of traditional CFD methods in ship resistance prediction, especially the problems of high computational cost and low computational efficiency. Previously, although a large amount of research has been invested in ship resistance prediction technology based on numerical simulations, due to the limitation of computing resources, it is difficult to achieve real-time and accurate predictions. The present invention not only greatly improves the computational efficiency by integrating physics-informed neural networks, but also provides high-precision prediction results while ensuring physical consistency, breaking through the dilemma that traditional technologies cannot efficiently solve this problem and having significant technical advantages.

[0069] The present invention overcomes the long-term over-reliance on traditional numerical simulation methods in the field of ship resistance prediction. Although traditional numerical simulation methods are theoretically accurate, due to their high dependence on complex mesh generation and computing resources, they often lead to low computational efficiency and the limitation of being unable to process real-time data. The present invention realizes intelligent prediction in a data-driven manner by combining physics-informed neural networks and machine learning algorithms, overcomes the bias towards traditional methods, and promotes the development of ship resistance prediction technology towards a more intelligent and real-time direction. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure;

[0071] Figure 1 is the network structure diagram of the physics-informed neural network for predicting the velocity field and pressure field provided by an embodiment of the present invention;

[0072] Figure 2 is the network structure diagram of the physics-informed neural network for predicting ship resistance provided by an embodiment of the present invention;

[0073] Figure 3 is the mechanism diagram of the loss function for predicting the velocity field and pressure field provided by an embodiment of the present invention;

[0074] Figure 4 is the mechanism diagram of the loss function for predicting ship resistance provided by an embodiment of the present invention;

[0075] Figure 5 Experimental comparison chart of the BP neural network provided by the embodiment of the present invention and the PINN neural network model of the present invention;

[0076] Figure 6 It is the schematic diagram of the ship resistance prediction method based on the physics-informed neural network provided by the embodiment of the present invention. Detailed implementation manners

[0077] In order to make the above objects, features and advantages of the present invention more obvious and understandable, the following will describe the specific implementation manners of the present invention in detail with reference to the accompanying drawings. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific implementations disclosed below.

[0078] The innovation of the present invention lies in: by optimizing the loss function design, the present invention effectively integrates physical constraints and flow field information into the neural network training process. By adding physical laws and fluid dynamics constraints to the loss function, the model can not only minimize the prediction error, but also ensure the rationality and consistency of the prediction results at the physical level, thereby significantly improving the prediction accuracy, calculation efficiency, and overcoming the high calculation cost and low efficiency problems of traditional methods in ship resistance prediction. At the same time, by introducing a random forest model for two-way verification, the reliability of the prediction results is further improved.

[0079] The present invention constructs a ship resistance prediction model based on the physics-informed neural network, and uses a random forest model to perform two-way verification on the model to provide a method combining mathematical equations and artificial intelligence technology to solve and predict ship resistance in real time.

[0080] Embodiment 1, the ship resistance prediction method based on the physics-informed neural network provided by the embodiment of the present invention includes:

[0081] S1, numerically simulate the straight-line motion of the ship in still water to obtain the pressure of the flow domain during straight-line motion , velocity field , ship resistance information ; where is the direction velocity field, is the direction velocity field, is the direction velocity field;

[0082] Use CFD software to numerically simulate the straight - line motion of a ship in still water, perform mesh generation and domain setting on the target ship model, and collect the initial data required for neural network training of network physical information;

[0083] For obtaining the initial data for network training: Numerically simulate using the CFD software STARCCM+ and the finite - volume method. First, discretize the fluid - solving region by volume control, solve the integral of each control volume in the form of computational grid cells, and interpolate physical quantities at the grid calculation nodes to obtain the values of the entire computational region. Simulate the straight - line motion of the ship through experiments, provide the target ship model, perform mesh generation and domain setting on the target ship model. By placing the ship in a domain with a flow velocity reaching the set relative velocity and stabilizing it, monitor the velocity field and pressure field values around the ship at this time. Define the hull resistance as the force required to tow the ship at a constant speed in still water, create a monitoring image of the resistance performance changing with time, and thus obtain the ship resistance value.

[0084] For obtaining the velocity and pressure of the domain, extract data points in the computational region. By determining the acquisition range, i.e., the point - taking method, construct a large number of data points in the domain to capture the information in the flow field, ensure the training intensity of the physical - information neural network, and improve the calculation speed and accuracy of the network.

[0085] S2. Construct a total data set by sorting out the obtained data , establish a training set , test set and validation set ;

[0086] Among them, the training set is used for the generation and training of the model, the test set is used to verify the accuracy of the model, and the validation set is used to assist in adjusting the series of parameters of the model. It is necessary to fully sample the total data set to ensure that the training set can reflect the characteristics of the total data set.

[0087] S3. Determine the number of layers of the PINN neural network model and the number of neurons in each layer, and initialize the weights and biases of the PINN neural network model; design the loss function of the PINN neural network model for ship resistance prediction, add control equations as physical constraints to the loss function, and the control equations include the Navier - Stokes equation and the ship resistance formula; select a fully - connected neural network as the basic model of the algorithm, select an activation function and design a multi - intelligent optimizer to establish a PINN neural network model integrating physical knowledge;

[0088] Among them, the PINN neural network model (Physics-Informed Neural Network) adopts a multi-layer neural network structure, and its main components include an input layer, a hidden layer, and an output layer. The input layer receives physical variables, the hidden layer contains multiple fully connected neurons, which use non-linear activation functions (such as ReLU or tanh) to process data, and the output layer provides prediction results. The loss function of the network combines data loss, physical loss, and boundary condition loss, enabling the output of the network to not only fit the observed data but also follow physical laws, thus ensuring the physical consistency of the model. The functional principle of the physics-informed neural network lies in combining physical models with deep learning. By introducing physical equations (such as partial differential equations) as constraints, the neural network not only depends on data during the training process but also follows physical laws. The network optimizes model parameters by minimizing the loss function, thereby adaptively learning solutions that conform to physical laws.

[0089] Control equations, including the Navier-Stokes equation and the ship resistance formula, are added to the loss function of the PINN neural network model as physical constraints.

[0090] Specifically, in the construction of the PINN neural network model, it includes setting parameters such as the number of hidden layers, the number of neurons, the learning rate, and the optimization method. It also includes adding a mathematical physics equation term to the error function of the PINN neural network model as a physical constraint to reduce the dispersion of data. Determine the number of layers of the PINN and the number of neurons in each layer, and select the Adaptive Moment Estimation (Adam) optimization method and the Limited-memory B-F-G-S-Bound (L-BFGS-B) optimization method to perform multiple optimizations on the network. The goal of the optimization process is to adjust the weights and biases of the network by minimizing the loss function to obtain the best model fitting effect and physical consistency. The ADAM optimization method can more effectively update model parameters under different parameters and gradients through the joint adjustment of momentum and adaptive learning rate. Compared with the traditional gradient descent algorithm, it combines the characteristics of the momentum method and the adaptive learning rate, and has better convergence and generalization capabilities. The L-BFGS-B optimization method uses a limited storage technique to retain the most recent gradient information, thereby reducing memory consumption. The combination of the two can further optimize the network weights more precisely. The two optimization algorithms will gradually reduce the function value of the loss function while updating the weights and bias values of the fully connected neural network. When the function value of the loss function decreases to a minimum value, the PINN framework at this time satisfies both the control equation and the network prediction, and can accurately simulate the fluid motion process around the hull.

[0091] In the PINN neural network model, based on the TensorFlow deep learning framework, a fully connected neural network framework is constructed using the Python programming language on the PyCharm platform. The control equation is constructed through the Navier-Stokes equation (N-S equation) to solve the watershed information, in order to enhance the interpretability of the model results at the physical level. The Navier-Stokes equation is one of the most important control equations in computational fluid dynamics. When When, the differential equation of motion of a viscous compressible Newtonian fluid is called the Navier-Stokes equation, and its vector form is as follows:

[0092] ;

[0093] In the formula, is the fluid velocity, is the external force term, is the fluid density, is the pressure, is the gradient operator, is the Laplace operator;

[0094] In the rectangular coordinate system, its scalar form is:

[0095] ;

[0096] ;

[0097] ;

[0098] In the formula, are respectively the external force terms in the three directions, is the space-time coordinate, is the velocity field in the direction, is the velocity field in the direction, is the viscosity coefficient;

[0099] For an incompressible fluid, there is , and based on the simplified Navier-Stokes equation, the loss function for physical constraints is defined as follows:

[0100] ;

[0101] ;

[0102] ;

[0103] In the formula, are all terms of the loss function, is the pressure;

[0104] According to the number of variables in the three-dimensional Navier - Stokes equations, construct a PINN network structure as shown in the physical - information neural network for predicting the velocity field and pressure field, which is applicable to the PINN network structure for obtaining watershed information. Among them, the input quantities are spatio - temporal coordinates Figure 1 and the ship speed and output the flow - field velocity at the current spatio - temporal position and the pressure ; Obtain the watershed information during ship navigation, and construct a PINN network structure for obtaining the ship navigation resistance R according to the basic principle of the Jones wake measurement method.

[0105] The partial derivatives in the equations can be calculated using automatic differentiation technology. Automatic differentiation combines the characteristics of symbolic differentiation and numerical differentiation methods. It can not only calculate the derivatives of arbitrarily complex functions but also maintain the numerical stability and accuracy. Automatic differentiation regards the calculation process of a function as a combination of a series of basic operations, and then calculates and solves the function by means of numerical substitution and retaining intermediate results.

[0106] According to the above - mentioned method, the watershed information during ship navigation can be obtained, and further construct a PINN network structure for obtaining the ship navigation resistance R as shown in Figure 2 . In recent years, when studying the classification of hull resistance, the hull resistance is usually divided into two parts: wave - making resistance and viscous resistance. The former can be determined by the wave - pattern analysis method, and the latter can generally be measured by the wake measurement method. This method assumes the following: (1) The momentum loss in the wake plane behind the ship is completely caused by viscosity; (2) There is no energy loss between the measurement plane near the hull and the plane at twice the ship length behind the ship, that is, there is no total - pressure - head loss. At the control surface, it can be considered that there are no waves. From assumption (1), the viscous force on the micro - area should be equal to the momentum loss per unit time on this area, that is:

[0107] ;

[0108] In the formula, is the micro - area on the control surface, is the viscous force on the micro - area, is the velocity on the control surface far behind the ship;

[0109] The viscous resistance suffered by the hull is obtained by integrating along the entire control area:

[0110] ;

[0111] In the formula, is the ship resistance, is the fluid density, is the ship speed, is the control surface.

[0112] In this PINN neural network model, the input values are the velocity on the control surface far behind the ship and the ship speed , and the output value is the ship navigation resistance R. Based on the ship resistance calculation formula, the loss function for physical constraint is defined as follows:

[0113] ;

[0114] In the formula, is the loss function term, is the control surface.

[0115] It can be understood that in the full text formula The corresponding formula is the loss function formula of the present invention designed based on the existing theorem formula. The technical effects are as follows: The loss function design in the physics-informed neural network plays a key role in ensuring that the model output not only conforms to the observed data but also follows the basic physical laws. The loss function usually consists of data loss, physical loss, and boundary condition loss, which can adaptively balance data-driven learning and physical constraints, thereby improving the convergence speed and enhancing the generalization ability of the model. This design enables the model to maintain good performance on unseen test data, while improving interpretability, making the prediction results not only the product of data fitting but also understandable from a physical perspective. In short, the loss function in PINN not only promotes effective learning and optimization but also ensures physical consistency and reliability.

[0116] In the embodiment of the present invention, the loss function includes two parts, namely the control equation loss and the network prediction loss . The control equation loss is the root mean square error of the above control equation loss function, which is used to constrain the PINN framework to satisfy the N-S equation and the ship resistance equation. The network prediction loss is the mean square error between the network output value and the true value, which is used to constrain the update of the PINN network weights.

[0117] The physical control equation loss is obtained from the mean square error of the control equation error in this step; the network prediction loss is obtained from the mean square error between the training set data in step S2, i.e., the basin velocity, pressure, and ship resistance data, and the output result of the fully connected network. The loss function of this embodiment can be expressed by the following formula:

[0118] ;

[0119] Represents the error between the network fitting value and the true value, and the expression is:

[0120] ;

[0121] In the formula, is the total number of sample data, represents the th sample, is the network input feature, is another network input feature, is the true value of the th sample, is the network prediction data, is the true data;

[0122] Represents the error between the network fitting value and the physical law, and the expression is:

[0123] ;

[0124] In the formula, is the total number of samples, is the network input data feature, is another network input feature, is the loss function of the physical equation.

[0125] S4. Substitute the data of the training set into the PINN neural network model integrating physical knowledge for training to obtain a neural network model based on physical information;

[0126] Substitute the data of the training set into the PINN neural network model integrating physical knowledge for training to obtain a neural network model based on physical information; The training process of the PINN neural network model integrating physical knowledge is as follows: Substitute the data of the training set into the PINN neural network model integrating physical knowledge. The PINN neural network model integrating physical knowledge initializes to generate relevant weight values and corresponding output values, and calculates the loss function value of the output value and the true value. Among them, the loss function is composed of a statistical function and a control equation. The statistical function is used to measure the error between the output value and the corresponding true value in the training set, and the control equation is used to perform physical constraints on the results; Perform gradient descent optimization on the result of the loss function, and forward-propagate the optimized correction value to the hidden layer according to the chain rule to correct the weight value; After multiple rounds of iteration and weight update, complete the training of the model, realize the intelligent prediction of ship resistance integrating mathematical and physical equations and artificial intelligence, and obtain a neural network model based on physical information.

[0127] Another exemplary specific training process is as follows: randomly initialize the weights and biases of the network; perform forward propagation of the input data through the network to obtain the output result; use the loss function to calculate the difference between the prediction result and the target output, and obtain the loss value; according to the loss value, calculate the gradient through backpropagation, that is, the derivative of the network parameters with respect to the loss; use the optimizer to update the weights and biases of the network according to the gradient and the learning rate. Repeat the steps after the initialization of the weights and biases until the predetermined number of training iterations is reached or the condition for stopping training is met. After multiple rounds of iterative updates, a PINN neural network model for ship resistance prediction is obtained, that is, a neural network model based on physical information.

[0128] S5. Based on the obtained pressure field and velocity field , use the velocity field as the input feature and the ship resistance as the output feature, and set parameters to control the prediction process of the random forest; and randomly sample from the obtained training set to form multiple sub-training sets. Each decision tree is trained based on a randomly selected sample subset; for the decision trees generated from each sub-training set, they are integrated by voting to generate a random forest model, and the average value of the prediction results of all decision trees is taken as the final output result.

[0129] Another exemplary, the random forest algorithm is an ensemble learning algorithm based on decision trees. By constructing multiple decision trees and combining their results to provide more accurate predictions, it has good prediction performance and robustness, does not exhibit overfitting, and does not require data pruning.

[0130] In the construction of the random forest model, set parameters to control the behavior of the random forest, such as the number of trees in the forest, that is, the number of base estimators. The larger this parameter value, the more time and memory are consumed, and the influence of this parameter on the accuracy of the random forest model is monotonic. After the number of decision trees grows to the decision boundary, the accuracy of the random forest will not increase. Therefore, set it to the default value and adjust it during the subsequent training process to achieve a balance between the training difficulty and the model effect.

[0131] S6. Substitute the data of the training set into the random forest model for training, use the data of the validation set to verify the accuracy of the random forest model, use the mean squared error to evaluate the accuracy of the random forest model, and adjust the parameters according to the evaluation results to obtain a mean squared error within a range less than 5%;

[0132] The smaller the mean squared error, the better the performance. Set the mean squared error not exceeding 5% as the acceptable range.

[0133] Exemplarily, substitute the data of the training set into the random forest model for training, and use the data of the validation set to verify the accuracy of the random forest model. If the accuracy is met, output the model in step S5; otherwise, adjust the model parameters and retrain the model, where the mean square error is used to evaluate the accuracy of the prediction model.

[0134] S7. Use the random forest model to perform two-way verification on the physics-informed neural network model to form a network model for ship resistance prediction.

[0135] Use the PINN model to predict the ship resistance and obtain preliminary results, and use the random forest model to predict the same data set to obtain a second set of prediction results. Compare the prediction results of the two, analyze their differences, set the difference between the prediction results of the two as the evaluation index, and design a threshold to judge whether the prediction result is reliable. Through two-way verification, the accuracy of the PINN model under physical constraints can be ensured, and with the help of the non-linear regression ability of the random forest model, the overall prediction performance and robustness can be improved.

[0136] Exemplarily, based on the validation set in step S2, use the models trained in steps S4 and S6 to predict the ship resistance respectively. Verify the prediction results through the physics-informed neural network algorithm and the machine learning algorithm. If the results of the two algorithms are not much different and the evaluation index performs well, then the prediction result can be considered reliable, realizing the two-way verification of the physics-informed neural network model, and finally forming a network model for ship resistance prediction.

[0137] Among them, the BP neural network is one of the most widely used artificial neural network models and has been applied in the research of the ship field. A typical BP neural network consists of three layers: an input layer, a hidden layer, and an output layer. Select the Bayesian regularization function as the training function, the mean square error regularization function as the performance function, the hyperbolic tangent S-shaped function as the transfer function of the hidden layer, and the linear function as the transfer function of the output layer, and a ship resistance prediction model based on a 3-layer BP neural network model can be constructed.

[0138] Use the above two algorithms to conduct resistance prediction experiments respectively. Take the ship resistance data obtained by CFD software simulation as the true value, obtain the resistance prediction errors of 20 different data set samples, and compare the average values of the prediction errors of the two to obtain Table 1. The experimental comparison between the BP neural network and the PINN neural network model of the present invention is shown in Figure 5 ;

[0139] Table 1 Comparison table of ship resistance prediction errors

[0140]

[0141] In this embodiment, compared with the resistance prediction method based on the BP neural network, the ship resistance prediction method based on the physics-informed neural network improves the prediction accuracy, has a more stable output, and can be used for predicting the navigation resistance of a certain ship.

[0142] Exemplarily, as Figure 6 shown, it is the principle of the ship resistance prediction method based on the physics-informed neural network provided by the embodiment of the present invention.

[0143] Embodiment 2, the embodiment of the present invention provides a ship resistance prediction system based on the physics-informed neural network, including:

[0144] A numerical simulation module for numerically simulating the straight-line motion of a ship in still water to obtain the pressure field and velocity field of the basin and ship resistance information during the straight-line motion;

[0145] A data partitioning module for constructing a total data set by sorting the acquired data and establishing a training set, a test set, and a validation set;

[0146] A PINN neural network model establishment module integrating physical knowledge for determining the number of layers of the PINN neural network model and the number of neurons in each layer, initializing the weights and biases of the PINN neural network model, selecting a fully connected neural network as the basic model of the algorithm, selecting an activation function, and designing a multiple intelligent optimizer to establish a PINN neural network model integrating physical knowledge;

[0147] A neural network model acquisition module based on physical information for substituting the data of the training set into the PINN neural network model integrating physical knowledge for training to obtain a neural network model based on physical information;

[0148] A random forest model generation module for using the obtained data, taking the velocity field as the input feature and the ship resistance as the output feature, setting parameters to control the prediction process of the random forest; and randomly sampling from the training set D train obtained in step S2 to form a plurality of sub-training sets, where each decision tree is trained based on a randomly selected sample subset; for the decision trees generated by each sub-training set, they are integrated by voting to generate a random forest model, and the average value of the prediction results of all the decision trees is taken as the final output result;

[0149] A random forest model training module for substituting the data of the training set into the random forest model for training, using the data of the validation set to verify the accuracy of the random forest model, where the mean square error is used to evaluate the accuracy of the random forest model, and the parameters are adjusted according to the evaluation results to obtain a mean square error within a range less than 5%;

[0150] The two-way verification module is used to perform two-way verification on the physics-informed neural network model using a random forest model to form a network model for ship resistance prediction.

[0151] The invention has various application scenarios in the ship industry, covering multiple aspects from the design stage to operation monitoring, fault diagnosis, and environmental assessment. Shipping companies hope to monitor the resistance of ships in different navigation states in real time to dynamically adjust the speed and route and optimize fuel efficiency. By collecting sensor data during actual navigation and updating the PINN and random forest models, the resistance can be predicted under real-time conditions, providing dynamic decision-making support for shipping companies and achieving lower operating costs and emissions.

[0152] In the ship design stage, engineers need to evaluate the impact of different design parameters (such as hull shape, size, and material) on ship resistance to optimize the design. Using CFD simulation data to generate flow field data for various hull designs and combining physics-informed neural networks and random forest models can predict the resistance of different designs, helping engineers select the optimal solution and achieve higher performance and fuel efficiency.

[0153] During the ship design and operation process, it is necessary to evaluate the impact of different environmental conditions (such as waves, wind speed, and ocean current) on resistance to formulate corresponding operation strategies. By generating flow field data under various environmental conditions through CFD simulation and combining PINNs and random forest models, the change in resistance can be predicted, providing data support for the best navigation strategy of ships in complex waters and improving efficiency and safety.

[0154] As mentioned above, it is only a relatively optimal specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent replacement, and improvement made by those skilled in the art within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A ship resistance prediction method based on physical information neural network, characterized in that: The method includes: S1, numerically simulate the straight-line motion of the ship in still water to obtain the pressure p, velocity field u, v, w, and ship resistance information R of the flow field during the straight-line motion; where u is the velocity field in the x direction, v is the velocity field in the y direction, and w is the velocity field in the z direction; S2, by combing the acquired data to form a total data set D, and establish a training set D train , test set D test and validation set D val ; S3, determine the number of layers of the PINN neural network model and the number of neurons in each layer, initialize the weight and bias of the PINN neural network model; design the loss function of the PINN neural network model for ship resistance prediction, add control equations as physical constraints in the loss function, and the control equations include the Navier-Stokes equations and the ship resistance formula; select the fully connected neural network as the basic model of the algorithm, select the activation function and design multiple intelligent optimizers, and establish the PINN neural network model integrating physical knowledge; S4, the training set D train Substituting the data into the PINN neural network model integrating physical knowledge for training, to obtain a neural network model based on physical information; S5, based on the obtained pressure field p and velocity field u, v, w, the velocity field is used as the input feature and the ship resistance is used as the output feature to set the parameters to control the prediction process of the random forest; and from the obtained training set D train Random sampling is used to form multiple sub-training sets, and each decision tree is trained based on the randomly selected sample subset. The decision trees generated by each sub-training set are integrated by voting to generate a random forest model, and the average of all decision tree prediction results is taken as the final output result. S6, the training set D train The data is substituted into the random forest model for training, and the validation set D is used val The data was used to verify the accuracy of the random forest model. The mean square error was used to evaluate the accuracy of the random forest model, and the parameters were adjusted according to the evaluation results to obtain a mean square error of less than 5%; S7, using the random forest model to perform bidirectional verification on the neural network model based on physical information to form a network model for ship resistance prediction; In step S3, establishing a PINN neural network model integrating physical knowledge includes: (1) In the PINN neural network model, based on the TensorFlow deep learning framework, a fully connected neural network framework was constructed on the PyCharm platform using the Python programming language. The control equations were constructed through the Navier-Stokes equations to solve the watershed information, thus improving the interpretability of the PINN neural network model results at the physical level. (2) In the PINN neural network model, the input value is the speed u on the control surface far behind the ship. ∞ and ship speed U, the output value is the ship's sailing resistance R, based on the ship resistance equation, the loss function used to perform physical constraints is defined; the loss function includes: control equation loss Loss f and network prediction loss Loss g , the control equation loss is used to constrain the PINN framework to satisfy the Navier-Stokes equations and the ship resistance equation; the network prediction loss is the mean square error between the network output value and the true value, which is used to constrain the update of the PINN neural network model weights; In step (1), when μ=const, μ is the fluid viscosity coefficient and const is a constant; the differential equation of motion of the viscous compressible Newtonian fluid is the Navier-Stokes equation, and the vector form is as follows: In the formula, is the fluid velocity, is the external force term, ρ is the fluid density, is the gradient operator, is the Laplace operator; In rectangular coordinates, the scalar form is: In the formula, f x , f y , f z are the external force terms in the x, y, and z directions respectively, t, x, y, and z are the time and space coordinates, and v is the viscosity coefficient; For an incompressible fluid, we have The loss function definition for physical constraints based on the simplified Navier-Stokes equations is as follows: In the formula, e1, e2, and e3 are all loss function terms; Construct a physical information neural network for predicting velocity field and pressure field. The input is the space-time coordinates t, x, y, z and the ship speed U, and the output is the flow field velocity u, v, w and pressure p in the current space-time. Obtain the watershed information when the ship is sailing, and construct a PINN network structure for obtaining the ship's sailing resistance R based on the basic principle of the Jones wake measurement method. Wake measurement methods, including: (1.1) The momentum loss in the wake plane behind the ship is entirely due to viscosity; (1.2) There is no energy loss between the measuring plane near the rear of the hull and the plane at twice the length of the ship behind the ship, that is, there is no total pressure head loss; there is no wave at the control surface; from step (1.1), it is known that the viscous force dR on the micro area dA is equal to the momentum loss per unit time on the micro area, and the expression is: dR=ρdAu ∞ (Uu ∞ ) Where dA is the micro area on the control surface, dR is the viscous force on the micro area, and u ∞ is the speed on the far rear control surface of the vessel; The viscous drag on the hull is divided along the entire control area to give: In the formula, R is the ship resistance, S is the control surface; In step (2), the loss function used for physical constraints is defined as follows based on the ship resistance equation: Where e4 is the loss function term, R is the ship resistance, ρ is the fluid density, and u ∞ is the speed on the control surface far behind the ship, U is the ship speed, S is the control surface, and dA is the micro area on the control surface.

2. The ship resistance prediction method based on physical information neural network according to claim 1 is characterized in that: In step S1, the straight-line motion of the ship in still water is numerically simulated, including: numerical simulation is performed through CFD software STARCCM+ and the finite volume method, first the fluid region to be solved is volumetrically controlled and discretized, each control volume integral is solved in the form of calculation grid units, and the physical quantity interpolation of the grid calculation nodes is performed to obtain the value of the entire calculation area; the straight-line motion of the ship is simulated through experiments, a target ship model is provided, and the target ship model is gridded and the watershed is set; the ship is placed in a watershed where a set relative speed is reached and stabilized, the velocity field and pressure field values ​​around the ship are monitored, the hull resistance is defined as the force required to tow the ship at a constant speed in still water, a monitoring image of the resistance performance changing with time is created, and the ship resistance value is obtained.

3. The ship resistance prediction method based on physical information neural network according to claim 1 is characterized in that: In step (2), the control equation loss is obtained by the mean square error of the control equation error, and the network prediction loss is obtained by the mean square error of the training set data, i.e., the basin velocity, pressure, and ship resistance data, and the output result of the fully connected network. The loss function Loss is expressed as follows: Loss=Loss g +Loss f Loss g Represents the error between the network fitting value and the true value, and the expression is: Where N g is the total number of sample data, i represents the i-th sample, Input features to the network, Input features to another network, g i is the true value of the i-th sample, g(t, x) is the network prediction data, and g is the true data; Loss f Represents the error between the network fitting value and the physical law, and the expression is: Where N f is the total number of samples, Input data features to the network, Input features to another network, f is the loss function of the physical equation.

4. The ship resistance prediction method based on physical information neural network according to claim 1 is characterized in that: In step S4, the training process of the PINN neural network model integrating physical knowledge is as follows: Substitute the data of the training set into the PINN neural network model that integrates physical knowledge, initialize the PINN neural network model that integrates physical knowledge to generate weights and corresponding output values, and calculate the loss function value between the output value and the true value; wherein the loss function is composed of a statistical function and a control equation, the statistical function is used to measure the error between the output value and the corresponding true value in the training set, and the control equation is used to physically constrain the result; The result of the loss function is optimized by gradient descent, and the optimized correction value is forward propagated to the hidden layer according to the chain rule to correct the weights. After multiple rounds of iterations and weight updates, the model training is completed, and the intelligent prediction of ship resistance that integrates mathematical equations and artificial intelligence is realized, and a neural network model based on physical information is obtained.

5. A ship resistance prediction system based on physical information neural network, characterized in that: The system implements the ship resistance prediction method based on physical information neural network according to any one of claims 1 to 4, and the system comprises: Numerical simulation module, used to simulate the straight-line motion of a ship in still water, and obtain the pressure field and velocity field of the watershed and the ship resistance information during the straight-line motion; The data partitioning module is used to construct a total data set by combing the acquired data, and to establish a training set, a test set, and a validation set; The PINN neural network model building module integrating physical knowledge is used to determine the number of layers of the PINN neural network model and the number of neurons in each layer, initialize the weights and biases of the PINN neural network model, select the fully connected neural network as the basic model of the algorithm, select the activation function and design multiple intelligent optimizers, and build the PINN neural network model integrating physical knowledge; A neural network model acquisition module based on physical information, used for substituting the data of the training set into the PINN neural network model integrating physical knowledge for training, so as to obtain a neural network model based on physical information; The random forest model generation module is used to set parameters to control the prediction process of the random forest based on the acquired data, taking the velocity field as the input feature and the ship resistance as the output feature; and the training set D obtained from step S2 train Random sampling is used to form multiple sub-training sets, where each decision tree is trained based on a randomly selected sample subset; the decision trees generated by each sub-training set are integrated by voting to generate a random forest model, and the average of all decision tree prediction results is taken as the final output result; A random forest model training module, used to substitute the data of the training set into the random forest model for training, and use the validation set data to verify the accuracy of the random forest model, wherein the mean square error is used to evaluate the accuracy of the random forest model, and the parameters are adjusted according to the evaluation results to obtain a mean square error within a range of less than 5%; The bidirectional verification module is used to bidirectionally verify the neural network model based on physical information using the random forest model to form a network model for ship resistance prediction.

6. The ship resistance prediction system based on physical information neural network according to claim 5 is characterized in that: The ship resistance prediction system based on physical information neural network is carried on a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it can realize the functions of the above-mentioned ship resistance prediction system based on physical information neural network.

Citation Information

Patent Citations

  • CFD-based ship energy-saving device performance extrapolation forecasting method

    CN117473652A

  • Underwater full-rotation navigation body resistance prediction method and optimization system based on physical information neural network

    CN118520778A