Ship photovoltaic MPPT method based on improved whale optimization algorithm optimizing BP neural network
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本发明正是针对现有技术中跟踪精度不高且资源易浪费的问题,提供基于改进鲸鱼优化算法优化BP神经网络的船舶光伏MPPT方法,采用改进鲸鱼优化算法与BP神经网络相结合的方法,以适应海洋动态变化的工况
[0056] Compared with existing technologies, this invention offers the following advantages: It comprehensively considers the impact of solar radiation, temperature, and ship swaying characteristics on the output power of photovoltaic panels. By establishing a simulation model of a ship photovoltaic power generation system to obtain sample data, it employs Tent mapping to initialize the population, improving the quality of the initial solution. It introduces a nonlinear convergence factor and adaptive weights to coordinate and enhance global search and local exploitation capabilities, thus improving the problems of uneven initial population distribution, slow convergence speed, weak global search ability, and susceptibility to local optima inherent in WOA (Wide-In-the-Air) algorithms. Furthermore, it combines with a BP neural network to address the issues of long search time, slow convergence speed, susceptibility to local optima, and poor generalization ability inherent in BP neural networks. This algorithm is used to predict the maximum power point voltage (MPPT) and, combined with a PI controller, achieves MPT tracking. The prediction accuracy of the MPT voltage is higher, the MPT tracking speed is faster, and the stability is better.
Smart Images

Figure CN118350405B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of ship photovoltaic power generation, and mainly relates to a ship photovoltaic MPPT method based on an improved whale optimization algorithm to optimize a BP neural network. Background Technology
[0002] The MPPT algorithm is suitable for marine vessel operating conditions, and can improve the efficiency of photovoltaic power generation under marine vessel operating conditions, thereby obtaining more electrical energy.
[0003] Currently, among the commonly used metaheuristic MPPT algorithms, Xu Kailin (“Xu Kailin. Research on Maximum Power Point Tracking of Unmanned Ship Photovoltaic Arrays [D]. Dalian Maritime University, 2022.”) proposed an APSO algorithm based on region-update rules, which improves the problem of low search efficiency of PSO under local shading conditions and establishes a complete NN-APSO tracking strategy, improving the tracking efficiency when local shading changes rapidly. However, when describing rapidly changing local shading conditions, it only uses the method of assigning irradiance values and does not collect the fluctuation characteristics of irradiance changes of unmanned ship photovoltaic arrays, which still has a certain gap with the actual situation. Shang Kailin (“Shang Kailin. Research on Light Tracking and Power Point Tracking Control of Marine Mobile Photovoltaic Solar Energy [D]. Wuhan University of Technology, 2020.”) proposed a photovoltaic cell maximum power point tracking method based on synchronous perturbation stochastic approximation algorithm, and gave an iterative calculation method for searching based on power change gradient information. However, it is aimed at the sudden changes in temperature and solar radiation energy and does not consider the influence of wave fluctuations. Lin Qiao (“Lin Qiao. Research on Maximum Power Point Tracking Control Method of Large Ship Photovoltaic System [D]. Wuhan University of Technology, 2022.”) proposed a maximum power point tracking method based on environmental parameter feature extraction and convolutional neural network. The method extracts features of local shading phenomenon of ship photovoltaic power generation system from a statistical perspective and establishes a tracking model based on convolutional neural network. It can effectively track multiple peak values and significantly reduce the training complexity and training time of the model. However, when the array size is large and the environment is complex, the prediction accuracy decreases significantly. Pachaivannan et al. (“Pachaivannan N, Subburam R, Padmanaban M, et al. Certainty of ANF IS adapted CPHO algorithm tuned MPPT controller for PV arrays under partial shading conditions[J]. Journal of Ambient Intelligence and Humanized Computing, 2021, 12(10): 9923-9938.”) proposed running the metaheuristic algorithm within a pre-selected search space where a global maximum power point may exist. This reduces the search space that the algorithm needs to explore, thereby effectively suppressing invalid search behavior caused by randomness and accelerating the convergence speed of the algorithm. However, sufficient prior knowledge is required to predetermine the search space.Celikel et al. (“Celikel R, Yilmaz M, Gundogdu A voltage scanning-based MPPT method for PV power systems under comprehensive partial shading conditions[J]. Renewable Energy, 2022, 184: 361-373.”) proposed using a voltage scanning method to record the voltage at the maximum power point and continuously compare the voltage at the extreme points to narrow the search space, thereby reducing the tracking time. However, this method is limited to the global maximum power point search in a certain stage.
[0004] Most of the methods described above consider abrupt changes in solar radiation and local shading, neglecting the dynamic changes in ocean conditions. This leads to low tracking accuracy and resource waste. Therefore, improving the tracking accuracy of shipborne photovoltaic MPPT (Multi-Level Photovoltaic Tracking) is an urgent problem to be solved. Summary of the Invention
[0005] This invention addresses the problems of low tracking accuracy and resource waste in existing technologies by providing a ship photovoltaic MPPT method based on an improved whale optimization algorithm and a BP neural network. The method combines the improved whale optimization algorithm with a BP neural network to adapt to the dynamically changing conditions of the ocean. Specifically, an improved whale optimization algorithm is proposed, employing Tent mapping to initialize the population and improve the quality of the initial solution. A nonlinear convergence factor and adaptive weights are introduced to coordinate and improve global search and local exploitation capabilities. This algorithm is also used to optimize the weights and thresholds of the BP neural network, mitigating problems such as long search time, slow convergence speed, susceptibility to local optima, and poor generalization ability caused by randomly selected weights and thresholds. A simulation model is established by analyzing the operating characteristics of the ship's photovoltaic power generation system, and sample data is obtained. The algorithm is used to predict the maximum power point voltage, and combined with a PI controller, maximum power point tracking is achieved, improving tracking accuracy.
[0006] To achieve the above objectives, the technical solution adopted by this invention is: a ship photovoltaic MPPT method based on an improved whale optimization algorithm and optimized BP neural network, comprising the following steps:
[0007] S1: Establish a solar radiation energy simulation model that considers the ship's swaying characteristics and obtain sample data; the simulation model is specifically as follows:
[0008] cosi=cosβsinh+sinβcoshcos(α-γ)
[0009] I n =ξ0I scP m sinh
[0010]
[0011] I g =ρ(I n +I h )
[0012]
[0013]
[0014] Where: β is the tilt angle; h is the solar altitude angle; α is the solar azimuth angle; γ is the azimuth angle of the inclined plane; ξ0 is the Earth orbit eccentricity correction coefficient; I sc θ is the solar constant; P is the atmospheric transparency coefficient; m is the atmospheric optical mass; θ max θ0 is the maximum angle of ship roll; T is the ship roll period; θ0 is the initial phase.
[0015] S2: BP neural network initialization, determine the number of nodes in each layer of the BP neural network, and initialize the weights and thresholds of the BP neural network;
[0016] S3: Based on the improved whale optimization algorithm, optimize the initial weights and thresholds of the BP neural network in step S2; in the improved whale optimization algorithm, the quality of the initial solution is improved by initializing the population using Tent mapping; and a nonlinear convergence factor is introduced. The adaptive weight w coordinates global search and local exploitation capabilities;
[0017] S4: Train the model, calculate the output error of the BP neural network, and update the weights and thresholds;
[0018] S5: When the training count and the minimum error of the training objective are met, output the predicted value of the maximum power point voltage; otherwise, proceed to step S4 to continue model training.
[0019] As an improvement of the present invention, in step S2, the optimal number of hidden layer nodes is selected by comparing the mean square error (MSE) of the training set with different numbers of hidden layer nodes:
[0020]
[0021]
[0022] In the formula: M is the number of input layer nodes; Q is the number of hidden layer nodes; L is the number of output layer nodes; α is a constant between 1 and 10; N is the number of training samples; X i This is the theoretical value; x i These are predicted values.
[0023] As another improvement of the present invention, step S3 specifically includes the following steps:
[0024] S31: Initialize WOA parameters, population size N, maximum number of iterations t max The spatial dimension dim and the searchable space of the population [ub,lb];
[0025] S32: Initialize the population location by using a Tent mapping;
[0026] S33: Calculate the fitness of individual whales, update the position of humpback whales, and by comparison, take the new fitness value that is less than the current fitness value as the current minimum fitness value, and take the position of the whale corresponding to the new fitness value that is less than the current minimum fitness value as the global optimal solution;
[0027] S34: Introducing a nonlinear convergence factor Update the coefficient vector in the early stages of the iteration. The values are relatively large and the decay rate is slow; in the later stages of iteration, It rapidly decays to a smaller value;
[0028] S35: Generate a random operator, select three behaviors: surrounding prey, bubble web attack, and searching for prey, update the individual whale position, and introduce adaptive weight w for updating and adjustment;
[0029] S36: Determine whether the termination condition is met. If it is met, output the optimal weights and threshold of the BP neural network. Otherwise, proceed to step S33 to continue execution. The termination condition is: reaching the maximum number of iterations or the fitness value tending to stabilize.
[0030] As another improvement of the present invention, the method for initializing the whale population in step S32 is specifically as follows:
[0031]
[0032] Where, x n n represents the number of mappings; x n This is the value of the nth mapping function.
[0033] As another improvement of the present invention, in step S33, calculating the individual whale fitness and updating the humpback whale position specifically involves:
[0034] F fitness =(MSE(input_train)+MSE(input_test)) / 2
[0035] Where MSE(·) is the mean squared error; input_train is the input training set; and input_test is the input test set.
[0036] As a further improvement of the present invention, the specific method for surrounding the prey in step S34 is as follows:
[0037]
[0038]
[0039]
[0040]
[0041]
[0042] In the formula, This represents the distance between the whale and the current best individual. Both are coefficient vectors used to adjust the position update of individuals; t is the current iteration number; This is the position of the current optimal solution; This indicates the current location of the individual whale. A random number between [0, 1]; t is the convergence factor; max This represents the maximum number of iterations.
[0043] The specific methods of bubble web attack are as follows:
[0044]
[0045]
[0046]
[0047] In the formula: is the distance between the whale and the current best individual; b is a constant constraining the spiral shape; l is a random number between [-1, 1]; p is a random number between [0, 1].
[0048] The specific methods for searching for prey are as follows:
[0049]
[0050]
[0051] In the formula, This represents the distance from other whales to the target whale. This represents the location of a random individual whale.
[0052] As a further improvement of the present invention, the nonlinear convergence factor The adaptive weight w is specifically as follows:
[0053]
[0054]
[0055] In the formula, a0 is the initial value of the convergence factor; ω max ω min These are the maximum and minimum values of the weighting coefficients, respectively.
[0056] Compared with existing technologies, this invention offers the following advantages: It comprehensively considers the impact of solar radiation, temperature, and ship swaying characteristics on the output power of photovoltaic panels. By establishing a simulation model of a ship photovoltaic power generation system to obtain sample data, it employs Tent mapping to initialize the population, improving the quality of the initial solution. It introduces a nonlinear convergence factor and adaptive weights to coordinate and enhance global search and local exploitation capabilities, thus improving the problems of uneven initial population distribution, slow convergence speed, weak global search ability, and susceptibility to local optima inherent in WOA (Wide-In-the-Air) algorithms. Furthermore, it combines with a BP neural network to address the issues of long search time, slow convergence speed, susceptibility to local optima, and poor generalization ability inherent in BP neural networks. This algorithm is used to predict the maximum power point voltage (MPPT) and, combined with a PI controller, achieves MPT tracking. The prediction accuracy of the MPT voltage is higher, the MPT tracking speed is faster, and the stability is better. Attached Figure Description
[0057] Figure 1 This is a block diagram of the overall structure of the ship photovoltaic power generation system of the present invention;
[0058] Figure 2 This is a diagram of the neural network structure of the present invention based on ship photovoltaic MPPT;
[0059] Figure 3 This is a mean square error diagram of the training set corresponding to different numbers of hidden layer nodes in this invention;
[0060] Figure 4 This is a flowchart of the improved WOA-BP neural network of the present invention;
[0061] Figure 5 This is a bar chart showing the prediction errors of different prediction algorithms in the test examples of this invention;
[0062] Figure 6 This is a schematic diagram illustrating the error between the predicted values and the actual values of different prediction algorithms in the test examples of this invention.
[0063] Figure 7 This is a convergence curve diagram of different prediction algorithms in the test examples of this invention. Detailed Implementation
[0064] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.
[0065] Example 1
[0066] like Figure 1 As shown, the overall structure of the ship photovoltaic power generation system includes a solar radiation energy module considering the ship's swaying characteristics, an MPPT module, and a Boost circuit module. The solar radiation energy I... t The voltage signal V is detected from the PV module by inputting temperature T and an improved WOA-BP neural network module. PV And with the improved WOA-BP neural network module predicting V ref The input PI controller generates a duty cycle signal, which is then compared with a triangular carrier wave to generate a PWM signal. This signal drives the switching transistor of the Boost circuit, ensuring that the external equivalent resistance matches the internal resistance of the photovoltaic panel for a long period of time. The system operates at maximum power, achieving MPPT.
[0067] The ship photovoltaic MPPT method based on the improved whale optimization algorithm and the optimized BP neural network includes the following steps: S1: Establish a simulation model by analyzing the working characteristics of the ship photovoltaic power generation system and obtain sample data.
[0068] Based on formulas (1)-(6), a solar radiation energy simulation model considering the ship's swaying characteristics is built using Simu li nk. The direct radiation energy I is obtained by using the angle i between the incident light and the normal of the tilted photovoltaic panel. n Scattered radiation energy I h and reflected radiation energy I g The calculation formula for solar radiation energy I is constructed. t The simulation model uses angle θ to mathematically describe the ship's rolling characteristics:
[0069] cosi=cosβsinh+sinβcoshcos(α-γ) (1)
[0070] I n =ξ0I sc P m sinh (2)
[0071]
[0072] I g =ρ(I n +I h (4)
[0073]
[0074]
[0075] Where: β is the tilt angle; h is the solar altitude angle; α is the solar azimuth angle; γ is the azimuth angle of the inclined plane; ξ0 is the Earth orbit eccentricity correction coefficient; I sc θ is the solar constant; P is the atmospheric transparency coefficient; m is the atmospheric optical mass; θ max θ is the maximum angle of ship rolling; T is the ship rolling period; θ0 is the initial phase.
[0076] S2: BP neural network initialization, determining the number of nodes in each layer of the BP neural network, and initializing the weights and thresholds of the BP neural network;
[0077] A 2-input, 1-output BP neural network structure is constructed using the collected sample data, as shown in the diagram. Figure 2 As shown. Solar radiation energy and temperature are used as the input layer of the neural network, with 2 nodes, while the maximum power point voltage is used as the output layer, with 1 node. The optimal number of hidden layer nodes is selected by comparing the mean square error (MSE) of the training set with different numbers of hidden layer nodes according to formulas (7)-(8). Figure 3 As shown, the training set mean square error is minimized when the number of hidden layer nodes is 10, therefore the optimal number of hidden layer nodes is 10.
[0078]
[0079]
[0080] In the formula: M is the number of input layer nodes; Q is the number of hidden layer nodes; L is the number of output layer nodes; α is a constant between 1 and 10; N is the number of training samples; X i This is the theoretical value; x i These are predicted values.
[0081] S3: Based on the improved Whale Optimization Algorithm, this algorithm addresses the problems of uneven initial population distribution, slow convergence speed, weak global search capability, and susceptibility to local optima in WOA. It also optimizes the initial weights and thresholds of the BP neural network in step S2, improving the problems of long search time, slow convergence speed, susceptibility to local optima, and poor generalization ability caused by randomly selecting weights and thresholds.
[0082] like Figure 4 As shown, in the improved whale optimization algorithm, the quality of the initial solution is improved by using Tent mapping to initialize the population; and a nonlinear convergence factor is introduced. The adaptive weight w coordinates global search and local exploitation capabilities;
[0083] WOA uses a random method to generate the initial population, which often leads to uneven population distribution, causing the search to fail to traverse the entire global search and get stuck in local optima. However, the Tent mapping has the characteristics of randomness, regularity, and traversability, which can make the population distribution more uniform, improve the global search capability, and prevent it from getting stuck in local optima, thus improving the performance of the algorithm. The whale population is initialized according to formula (9):
[0084]
[0085] Where n is the number of mappings; x n This is the value of the nth mapping function.
[0086] The choice of fitness function usually depends on the specific problem and optimization objective. The smaller the fitness function value, the more accurate the training is, and the better the prediction accuracy of the model is. The fitness function is usually selected by mean square error and root mean square error. Mean square error mainly considers the minimization of the overall error, while root mean square error mainly considers the overall distribution of the error and the sensitivity to large errors. In order to consider the generalization performance of the model, the overall mean square error of the training set and test set of the input data is selected as the fitness function. The fitness of the individual whale is calculated according to formula (10). By comparison, the new fitness value that is smaller than the current fitness value is taken as the current minimum fitness value, and the position of the whale corresponding to the new fitness value that is smaller than the current minimum fitness value is taken as the global optimal solution.
[0087] F fitness =(MSE(input_train)+MSE(input_test)) / 2 (10)
[0088] Where MSE(·) is the mean squared error; input_train is the input training set; and input_test is the input test set.
[0089] Humpback whales can identify the location of prey and surround it. However, since the exact location of the prey cannot be determined in advance, the position of the whale individual in the whale population closest to the prey is defined as the current optimal solution. Then, other whales update their positions based on the optimal solution, thus surrounding the prey. The prey is surrounded according to formulas (11)-(15):
[0090]
[0091]
[0092]
[0093]
[0094]
[0095] In the formula, This represents the distance between the whale and the current best individual. Both are coefficient vectors used to adjust the position update of individuals; t is the current iteration number; This is the position of the current optimal solution; This indicates the current location of the individual whale. A random number between [0, 1]; t is the convergence factor; max This represents the maximum number of iterations.
[0096] Convergence factor in WOA It is linearly decreasing; although its exploration ability is strong in the early stages of iteration, its local development ability is weak in the later stages of iteration, resulting in a slow convergence speed. Based on formula (21), a nonlinear convergence factor is introduced. In the early stages of iteration, Larger values and slower decay rates result in stronger global search capabilities, which helps avoid getting trapped in local optima. In the later stages of iteration, It decays rapidly to a small value, has strong local development capabilities, and is conducive to accelerating the convergence speed.
[0097]
[0098] In the formula: a0 is the initial value of the convergence factor;
[0099] Bubble web attacks simulate the behavior of whales hunting prey, employing two methods: a shrinking encirclement mechanism and a spiral position update. During the predation process, the shrinking encirclement mechanism reduces the convergence factor. Adjustment coefficient vector The range is narrowed to allow for a more focused search for the optimal solution. The spiral update position gradually approaches the prey in a spiral pattern to search for the optimal solution more efficiently. According to formulas (16)-(17), the bubble network attack is as follows:
[0100]
[0101]
[0102] In the formula: is the distance between the whale and the current best individual; b is a constant constraining the spiral shape; l is a random number between [-1, 1];
[0103] Humpback whales swim around their prey in a spiral pattern while simultaneously contracting and encircling it. To simulate this simultaneous behavior and better coordinate the two phases of contraction and encirclement with the spiral position update, it is assumed that there is a 50% probability of choosing between the two methods to update the whale's position. The method of selection is based on formula (18):
[0104]
[0105] In the formula: p is a random number between [0, 1].
[0106] When the coefficient vector At this time, the whales are in the prey-hunting phase. At this time, the whale population will increase the search range and randomly select the location of individual whales as targets in the area outside the shrinking encirclement mechanism, update the whale positions, and search for prey according to formulas (19)-(20):
[0107]
[0108]
[0109] In the formula, This represents the distance from other whales to the target whale. This represents the location of a random individual whale.
[0110] According to formula (22), an adaptive weight is introduced. The weight coefficient decreases nonlinearly with the increase of the number of iterations. In the early stage of iteration, the weight coefficient is larger and has a strong global search capability. It can search in a larger range and prevent getting trapped in local optima. In the later stage of iteration, the weight coefficient is smaller and has a strong local development capability. It can perform fine search in a certain area and improve the accuracy of the solution.
[0111] ω=[0.9·(1-sin(πt / 2t max ))+0.4·sin(πt / 2t max )] (twenty two)
[0112] In the formula: ω max ω min These are the maximum and minimum values of the weighting coefficients, respectively.
[0113] S4: Train the model and determine whether the termination condition is met, i.e., whether the maximum number of iterations has been reached or whether the fitness value has become stable. If the condition is met, output the optimal weights and threshold of the BP neural network; otherwise, proceed to step S3 to continue execution.
[0114] S5: Calculate the output error of the BP neural network, update the weights and thresholds. When the training count is 1000 and the minimum training error is 0.0001, output the predicted value of the maximum power point voltage. Otherwise, proceed to step S4 to continue model training.
[0115] Test case
[0116] Due to various uncertainties in the prediction of photovoltaic maximum power point voltage, the prediction results contain a certain degree of error. The performance of different prediction algorithms can be assessed by comparing and analyzing relevant evaluation indicators. Generally, Mean Absolute Percentage Error (MAPE) and Root Mean Square Error (RMSE) are used to quantitatively analyze the prediction performance of the model. The smaller the value, the stronger the applicability of the algorithm and the higher the prediction accuracy. MAPE reflects the degree of deviation between the predicted and actual values compared to the actual values; RMSE reflects the relative deviation between the predicted and actual values. The square of the error value better reflects the role of larger errors in the overall error assessment.
[0117]
[0118]
[0119] The sample data obtained from the solar radiation energy simulation model that considers the ship's swaying characteristics were divided into training and testing sets in an 80% / 20% ratio. Initial WOA parameters were set: population size N = 50, and maximum number of iterations t. max =500, spatial dimension d im=41, and the searchable space of the population [3,-3]. The training set data was trained using a BP neural network, a WOA-BP neural network, and an improved WOA-BP neural network, respectively. After training, predictions were made using the input test set, and the predicted maximum power point voltage was compared with the actual output test set value based on the corresponding error evaluation index.
[0120] Figure 5 A bar chart showing the prediction errors of different prediction algorithms. Figure 5 As can be seen, the improved WOA-BP neural network achieved MAPE and RMSE of 0.0471% and 0.26794, respectively. Compared to the BP neural network, the MAPE improved by 42.68% and the RMSE by 19.91%. Compared to the WOA-BP neural network, the MAPE improved by 19.32% and the RMSE by 7.45%. All evaluation metrics are superior to both the BP neural network and the WOA-BP neural network, demonstrating high prediction accuracy and good prediction performance.
[0121] To verify the tracking performance of the maximum power point voltage, the predicted maximum power point voltage values of different algorithms were subtracted from the actual values on the output test set, and the average error was calculated. The specific results are as follows: Figure 6As shown, the average prediction error of the BP neural network is 0.21345, the average prediction error of the WOA-BP neural network is 0.15095, and the average prediction error of the improved WOA-BP neural network is 0.14107. This represents an improvement of 33.91% compared to the BP neural network and 6.55% compared to the WOA-BP neural network. Therefore, the predicted value of the improved WOA-BP neural network is closer to the true value, resulting in better tracking performance.
[0122] To verify the effectiveness of the improved WOA algorithm, the fitness value changes of the improved WOA-BP neural network and the WOA-BP neural network were plotted as convergence curves for comparison. This allows direct observation of the algorithm's convergence speed, optimization accuracy, and solution quality when solving functions. Figure 7 The graph shows the convergence curves of different prediction algorithms. It can be seen that the improved WOA-BP neural network has a wider search range, higher optimization accuracy, faster convergence speed, and stronger ability to escape local optima compared to the original WOA-BP neural network. A larger initial fitness value indicates a wider search range; a smaller stable fitness value in the later stages indicates higher optimization accuracy; an earlier inflection point on the curve indicates a faster convergence speed; and a smoother curve indicates a stronger ability to escape local optima.
[0123] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0124] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.
Claims
1. A ship photovoltaic MPPT method based on an improved whale optimization algorithm and optimized BP neural network, characterized in that, Includes the following steps: S1: Establish a solar radiation energy simulation model that considers the ship's swaying characteristics and obtain sample data; the simulation model is specifically as follows: ; ; ; ; ; ; Where: β is the tilt angle; h is the solar altitude angle; α is the solar azimuth angle; γ is the azimuth angle of the inclined plane; ξ0 is the Earth orbit eccentricity correction coefficient; I sc θ is the solar constant; P is the atmospheric transparency coefficient; m is the atmospheric optical mass; θ max θ0 is the maximum angle of ship roll; T is the ship roll period; θ0 is the initial phase. S2: BP neural network initialization, determining the number of nodes in each layer of the BP neural network, and initializing the weights and thresholds of the BP neural network; S3: Based on the improved whale optimization algorithm, optimize the initial weights and thresholds of the BP neural network in step S2; in the improved whale optimization algorithm, the quality of the initial solution is improved by using Tent mapping to initialize the population. By introducing a nonlinear convergence factor The adaptive weight w coordinates global search and local exploitation capabilities; S31: Initialize WOA parameters, population size N, maximum number of iterations t max Spatial dimension dim and the searchable space of the population [ub, lb]; S32: Initialize the population location by using a Tent mapping; S33: Calculate the fitness of individual whales, update the position of humpback whales, and by comparison, take the new fitness value that is less than the current fitness value as the current minimum fitness value, and take the position of the whale corresponding to the new fitness value that is less than the current minimum fitness value as the global optimal solution; S34: Introducing a nonlinear convergence factor Update the coefficient vector in the early stages of the iteration. The values are relatively large and the decay rate is slow; in the later stages of iteration, It rapidly decays to a smaller value; S35: Generate a random operator, select three behaviors: surrounding prey, bubble web attack, and searching for prey, update the individual whale position, and introduce adaptive weight w for updating and adjustment; S36: Determine whether the termination condition is met. If it is met, output the optimal weights and threshold of the BP neural network. Otherwise, proceed to step S33 to continue execution. The termination condition is: reaching the maximum number of iterations or the fitness value tending to stabilize. S4: Train the model, calculate the output error of the BP neural network, and update the weights and thresholds; S5: When the training count and the minimum error of the training objective are met, output the predicted value of the maximum power point voltage; otherwise, proceed to step S4 to continue model training.
2. The ship photovoltaic MPPT method based on the improved whale optimization algorithm and optimized BP neural network according to claim 1, characterized in that: In step S2, the optimal number of hidden layer nodes is selected by comparing the mean square error (MSE) of the training set with different numbers of hidden layer nodes: ; ; In the formula: M is the number of input layer nodes; Q is the number of hidden layer nodes; L is the number of output layer nodes; α is a constant between 1 and 10; N is the number of training samples; X i This is the theoretical value; x i These are predicted values.
3. The ship photovoltaic MPPT method based on the improved whale optimization algorithm and optimized BP neural network according to claim 2, characterized in that: In step S32, the method for initializing the whale population is as follows: ; Where, x n n represents the number of mappings; x n This is the value of the nth mapping function.
4. The ship photovoltaic MPPT method based on the improved whale optimization algorithm to optimize the BP neural network as described in claim 1, characterized in that: In step S33, calculating the individual whale fitness and updating the humpback whale's position specifically involves: ; Where MSE(·) is the mean squared error; input_train is the input training set; and input_test is the input test set.
5. The ship photovoltaic MPPT method based on the improved whale optimization algorithm to optimize the BP neural network as described in claim 1, characterized in that: In step S34, the specific method for surrounding the prey is as follows: ; ; ; ; ; In the formula, This represents the distance between the whale and the current best individual. Both are coefficient vectors used to adjust the position update of individuals; t is the current iteration number; This is the position of the current optimal solution; This indicates the current location of the individual whale. A random number between [0, 1]; t is the convergence factor; max This represents the maximum number of iterations. The specific methods of bubble web attack are as follows: ; ; ; In the formula: is the distance between the whale and the current best individual; b is a constant constraining the spiral shape; l is a random number between [-1, 1]; p is a random number between [0, 1]. The specific methods for searching for prey are as follows: ; ; In the formula, This represents the distance from other whales to the target whale. This represents the location of a random individual whale.
6. The ship photovoltaic MPPT method based on the improved whale optimization algorithm to optimize the BP neural network as described in claim 5, characterized in that: The nonlinear convergence factor The adaptive weight w is specifically as follows: ; ; In the formula, This is the initial value of the convergence factor.