Ultrashort-Term Power Fluctuation Forecasting Based on the Prediction of the Shipborne Panel Tilt Angle

When a solar ship is navigating in the ocean, the swaying motion of a photovoltaic panel will affect the output power of the photovoltaic (PV) power generation system more frequently and violently. In addition to considering multiple climatic factors, this paper also adopts a ship swaying motion and radiation level of sunlight to establish a suitable calculation model for the output power of photovoltaic systems, which are rarely considered at the same time in previous studies, and also to make ultrashort-term power predictions. Furthermore, this paper proposes a multilayer heterogeneous particle swarm optimization (PSO) algorithm to design the weights and thresholds of a long short-term memory (LSTM) neural network to improve the accuracy of forecasting the changes of a photovoltaic panel’s angle, which is used for accurate power output prediction for the purpose of power planning. The case analysis shows the effectiveness of the algorithm, which provides a more reliable method for designing a power prediction system.


Introduction
With the gradually increasing penetration rate of new energy sources, the development of marine renewable energy has become a hot research topic at both home and abroad, where green solar power, as one of the solutions, will be of great significance for energy saving and emission reduction in the field of environmental transportation. In a land micro-grid, solar power generation is only affected by natural conditions, but shipborne solar systems, such as a mobile micro-grid, are not only affected by natural conditions, but also by the navigation and sway of the ship itself. Such a system's power generation characteristics are more complex and changeable, even when the ship is parked. Due to the sway of the hull, the output of photovoltaic power generation system is constantly changing. Similarly, rapid and random photovoltaic (PV) panel fluctuations add a non-ignorable difficulty to PV power forecasting and calculation [1,2]. The power system in a ship featuring solar photovoltaic power generation is a complex system involving multiple variables and mutual coupling between (1) Aiming at shipborne PV systems, this paper proposes a power calculation model for shipborne photovoltaic panels. Sea wave fluctuation has a non-negligible effect on the output power of the PV system. The measured roll and pitch are reduced to one single angle through a rotation matrix, which is used as an important variable in our model. Then, we calculate the output power through the proposed model and the proposed model is tested with a solar ship swing platform. (2) The accuracy of short-term power prediction is of great significance to power control, so we propose to predict and calculate the power of a photovoltaic system by predicting the inclination of the photovoltaic panel. We use an improved LSTM algorithm to complete this work. (3) According to the year-round weather data of known routes, the solar radiation along the route should be corrected for. The radiation is also variable, according to the season, latitude, and longitude, which provides a reliable reference source for the power scheduling of shipborne PV system. This paper is organized as follows: Section 2 establishes the inclination motion model of the shipborne photovoltaic panel and Section 3 presents the LSTM neural network. Section 4 presents the improved MHPSO algorithm and Section 5 describes the MHPSO structure for optimizing the weights of the LSTM neural network and discusses the proposed structure of the MHPSO-LSTM algorithm and its effectiveness in the prediction of the pitch angle of the photovoltaic panel. In addition, we build a more accurate mathematical model of photovoltaic power based on the proposed prediction algorithm and make ultrashort-term power predictions. Finally, some conclusions are drawn in Section 6.

Model of Ship Photovoltaic Panel Swing Motion
Here, the solar photovoltaic modules are all horizontally arranged on the ship deck, and the photovoltaic modules on the ship will move together with the ship's swing. While sailing in the ocean, due to the effects of wind, waves, and ocean currents, this will produce six degrees of freedom (DOF) movements, namely, surge, sway, heave, roll, pitch, and yaw [17]. This section introduces the calculation model of the spatial motion variation of shipborne photovoltaic panels under the influence of rolling and pitching when the ship is sailing.
The three-dimensional coordinate transformation model in space takes the common transformation between the world and the camera coordinate system as an example. In the rotation matrix of the hull, the Euler angle is rotated by rotating the rigid body around the axis of the origin [18]. As shown in Figure 1, blue coordinates is the starting system (x, y, z), the red is the coordinate system after rotation (x , y , z ). Taking a vector → OP in a three-dim coordinate system to rotate around the z axis by the angle of θ as an example to derive the process of converting the Euler angle of rotation from the world coordinate system to the camera coordinate system, as shown in Figure 2.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 20 (1) Aiming at shipborne PV systems, this paper proposes a power calculation model for shipborne photovoltaic panels. Sea wave fluctuation has a non-negligible effect on the output power of the PV system. The measured roll and pitch are reduced to one single angle through a rotation matrix, which is used as an important variable in our model. Then, we calculate the output power through the proposed model and the proposed model is tested with a solar ship swing platform. (2) The accuracy of short-term power prediction is of great significance to power control, so we propose to predict and calculate the power of a photovoltaic system by predicting the inclination of the photovoltaic panel. We use an improved LSTM algorithm to complete this work. (3) According to the year-round weather data of known routes, the solar radiation along the route should be corrected for. The radiation is also variable, according to the season, latitude, and longitude, which provides a reliable reference source for the power scheduling of shipborne PV system.
This paper is organized as follows: Section 2 establishes the inclination motion model of the shipborne photovoltaic panel and Section 3 presents the LSTM neural network. Section 4 presents the improved MHPSO algorithm and Section 5 describes the MHPSO structure for optimizing the weights of the LSTM neural network and discusses the proposed structure of the MHPSO-LSTM algorithm and its effectiveness in the prediction of the pitch angle of the photovoltaic panel. In addition, we build a more accurate mathematical model of photovoltaic power based on the proposed prediction algorithm and make ultrashort-term power predictions. Finally, some conclusions are drawn in Section 6.

Model of Ship Photovoltaic Panel Swing Motion
Here, the solar photovoltaic modules are all horizontally arranged on the ship deck, and the photovoltaic modules on the ship will move together with the ship's swing. While sailing in the ocean, due to the effects of wind, waves, and ocean currents, this will produce six degrees of freedom (DOF) movements, namely, surge, sway, heave, roll, pitch, and yaw [17]. This section introduces the calculation model of the spatial motion variation of shipborne photovoltaic panels under the influence of rolling and pitching when the ship is sailing.
The three-dimensional coordinate transformation model in space takes the common transformation between the world and the camera coordinate system as an example. In the rotation matrix of the hull, the Euler angle is rotated by rotating the rigid body around the axis of the origin [18]. As shown in Figure 1, blue coordinates is the starting system , the red is the coordinate system after rotation . Taking a vector OP in a three-dim coordinate system to rotate around the z axis by the angle of θ as an example to derive the process of converting the Euler angle of rotation from the world coordinate system to the camera coordinate system, as shown in Figure 2.   In Figure 2a, OP forms P' as a projection on the xOy plane, rotating around the Z axis, equivalent to OP's projection on the xOy plane, which rotates around the origin. As shown in Figure   2b, OP'1 rotates α degrees to OP'2 and OP'1 = OP'2 [13].
It can be obtained that the rotation matrix of β angle rotation around the Z axis is The rotation from the world coordinate changed to the camera coordinate shows that the rotation angle around the Z axis is yaw, where then the rotation angle twirls around the Y axis of the coordinate system after rotation, and then the roll angle is rotated around the X axis of the coordinate system after rotation, where , therefore the final rotation angle matrix is as given follows: Next, one needs to calculate the angle δ change between the photovoltaic panel and the sea level after generating roll angle X R and pitch angle Y R . According to the Equations (3) and (4) The numerical values of the roll and pitch will be forecasted by the proposed algorithm in the next section.

LSTM Neural Network
In this section, we discuss an improved neural network-based method for predicting the inclination of photovoltaic panels for the short-term power prediction of PV systems, recurrent neural network (RNNs) are sequence-based models which are able to form the temporal correlations between previous experiences and the current state [19]. Nevertheless, it is difficult to learn In Figure 2a, OP forms P as a projection on the xOy plane, rotating around the Z axis, equivalent to OP s projection on the xOy plane, which rotates around the origin. As shown in Figure 2b, OP 1 rotates α degrees to OP 2 and OP 1 = OP 2 [13].
It can be obtained that the rotation matrix of β angle rotation around the Z axis is The rotation from the world coordinate changed to the camera coordinate shows that the rotation angle around the Z axis is yaw, where then the rotation angle twirls around the Y axis of the coordinate system after rotation, and then the roll angle is rotated around the X axis of the coordinate system after rotation, where β = roll, γ = pitch, α = heave, therefore the final rotation angle matrix is as given follows: cos(α) cos(γ) cos(α) sin(γ) sin(β) − sin(α) cos(β) cos(α) sin(γ) cos(β) + sin(α) sin(β) sin(α) cos(γ) sin(α) sin(γ) sin(β) + cos(α) cos(β) sin(α) sin(γ) cos(β) − cos(α) sin(β) − sin(γ) cos(γ) sin(β) cos(γ) cos(β) Next, one needs to calculate the angle δ change between the photovoltaic panel and the sea level after generating roll angle R X and pitch angle R Y . According to the Equations (3) and (4), we can get δ: The numerical values of the roll and pitch will be forecasted by the proposed algorithm in the next section.

LSTM Neural Network
In this section, we discuss an improved neural network-based method for predicting the inclination of photovoltaic panels for the short-term power prediction of PV systems, recurrent neural network (RNNs) are sequence-based models which are able to form the temporal correlations between previous experiences and the current state [19]. Nevertheless, it is difficult to learn long-term dependence due to the disappearance or eruption of gradients. In [19], the authors firstly proposed a long short-term memory (LSTM) algorithm, where a store cell was draw in by Gers et al. LSTM has three carefully designed structures called "gates", named the input, forget, and output gates, respectively, which have ability to remove or add information to the state of the cell. Gates are a way to select which information is used. With an additional forget gate, this model avoids the problem of gradient disappearance while learning to depend on information for a long range; thereby, adding a structure which is a memory unit to the hidden layer of the time-recurrent neural network to remember past information.
The LSTM model can be described by Equations (5)-(10): The weight matrices W hi , W xi , W h f , W XC , and W hc act on behalf of the LSTM structure activation functions, which will affect loss function, and i t , f t , and o t are the input, forget, and output gates of the LSTM model, respectively. The first step in the LSTM is to decide what message is discarded from the cell state. This step is made through a layer called the forget gate, and then the output gate is used to control how much of the cell state c t will be output to the current output value h t of the LSTM model. Here, stands for an element-wise multiplication, h t is the output gate, h t−1 is the output in the previous moment from the LSTM, and the elements that should be updated are determined by it. The common initialization for h t is zero, sigmoid and tanh are the activation functions. Here, c t is the cell unit on behalf of the current state. The initialization of the model parameters of the LSTM model are stochastic, which leads to a reduction of the nonlinear learning of the existing parameter optimization methods. Figure 3 shows that the repeating module in the LSTM neural network contains four interactive layers. All RNNs have a chained form of repeating neural network modules [20]. In a standard RNN, this repeated module only has a very simple structure, such as a tanh layer. Every arrow line delivers an entire vector from the output to the input of one of the other nodes, respectively. The red circles at the end denote the pointwise operations, such as vector multiplication, and the matrix in yellow is the learned neural network layer. The combined lines indicate the connection of vectors, and the separate lines indicate that the content is copied and then distributed to another locations.

MHPSO-LSTM
As shown in Equations (11) and (12), PSO, as an intelligent optimization structure, can be used to simulate the particles in each bird's search space, during which the speed is adjusted according to  (11) and (12), PSO, as an intelligent optimization structure, can be used to simulate the particles in each bird's search space, during which the speed is adjusted according to the two equations until the conditions converge. Affected by its own best past positionŷ t and the best past position y t i,j of the entire group or neighbors, particles use their own experience and the best experience of their companions to decide their next movement.

As shown in Equations
V t+1 i,j means the velocity of some particles at a specific time, namely i in j at t, and x t i,j is the position of i at t. Additionally, ω is an inertia weight, representing the memorization of particles at a changed position, and the global optimization performance and local optimization performance can be adjusted by adjusting the size of ω. Additionally, c1 and c2 are constant factors related to acceleration, meanwhileŷ t is an individual optimal scheme for one particle at a time, y t i,j is a global optimal solution known at t, and r t 1,2,i,j are random numbers. This paper proposes a multi-layer heterogeneous topology dynamic particle swarm optimization algorithm. In this sense, an algorithm named MHPSO has been developed, with the core goal of establishing vertical interaction between various layers. The particle swarm structure is shown in Figure 4.  (11) and (12), PSO, as an intelligent optimization structure, can be used to simulate the particles in each bird's search space, during which the speed is adjusted according to the two equations until the conditions converge. Affected by its own best past position t ŷ and the best past position t j i y , of the entire group or neighbors, particles use their own experience and the best experience of their companions to decide their next movement.

As shown in Equations
V means the velocity of some particles at a specific time, namely i in j at t , and are random numbers. This paper proposes a multi-layer heterogeneous topology dynamic particle swarm optimization algorithm. In this sense, an algorithm named MHPSO has been developed, with the core goal of establishing vertical interaction between various layers. The particle swarm structure is shown in Figure 4.   The number of particles in each layer are the same, and the algorithm randomly assigns every five particles in the population to a loop, in which a rule tree has taken shape. The total fitness values formed by all the particles in the loop finally decide the quality of each and every loop, where the advantages and disadvantages of the loop determine the position of the loop in the tree and better loops are in a higher position in the tree. During the operation of the algorithm, the position of the loop is dynamically adjusted according to the advantages and disadvantages of the loop. The particles in the parent node within this structure are used as the attracting ones and the particles in the offspring nodes are also their attracting particles. The attracting particles of the top ones are all on the same layer and show the characteristics of better adaptability to the population. In addition to moving to the optimal position in the local and global spaces, they also move to the place where the attractor is located. As shown in Figure 4, the attractor of particle A1 includes 5 particles (B1-B5). The attractor of particles (such as M1) in the loop at the parent node is just 4 other particles in one loop.
In the improved algorithm, the update velocity Equation (13) contains additional terms for attracting particles: Appl. Sci. 2020, 10, 5213 In order to improve the robustness of the algorithm, the particle attraction coefficient r(i) t a,j uses new calculation methods to ensure that the influence of the attractor on each particle is balanced. ( where r t min and r t max are the minimum and maximum attractor coefficients, S(i) t min, j and S(i) t max, j show particle i with both the minimum and maximum values, and S(i) t j is the average coordinate position of all attracted particles.
The main purpose of the algorithm is to use the improved multi-layer heterogeneous particle swarm optimization algorithm to optimize the weights of the LSTM structure, as shown in Figure 5. Table 1 provides the parameter set, where the ultimate goal is to assign the obtained optimal particles to the connection weights of the LSTM structure. The specific solution steps are as follows.
Step 1: Initialize the LSTM network structure with the main goal to determine the number of neurons. PSO includes the size, overall level, and learning factors, and the particle positions and velocities are random. According to the mean square error (MSE) of the data set used by particle i to search for the local optimal solution and the global optimal solution during the training process, this is expressed as follows: where MSE g is the fitness function, and d ij and y ij are the predicted and true values, respectively.
Step 2: Calculate the quality of the loops and establish the particle evaluation function. The fitness function in the population is defined as where n stands for the size of population, Y i is the forecast value of the sample, and y i is the actual output.
Step 3: Calculate and sort each group of fitness values based on Equation (18) and upgrade the local and global optimal positions.
Step 4: If the end condition of the iteration (optimal position) is reached, move back to Step 3 and continue to iterate.
Step 5: Allocate the acquired optimal particles to the LSTM network-related weight. Train the LSTM network prediction model and output the time series prediction optimal solution.

Photovoltaic Panel Motion Prediction
In this section, we analyze and discuss the improved MHPSO-LSTM method and the effect toward forecasting the inclination of the photovoltaic panel on board to predict the change of PV power output within 10 s. The proposed LSTM structure includes structural optimization and photovoltaic panel motion prediction. The flow chart of the algorithm structure is shown in Figure 6.

Photovoltaic Panel Motion Prediction
In this section, we analyze and discuss the improved MHPSO-LSTM method and the effect toward forecasting the inclination of the photovoltaic panel on board to predict the change of PV power output within 10 s. The proposed LSTM structure includes structural optimization and photovoltaic panel motion prediction. The flow chart of the algorithm structure is shown in Figure 6.  In this work, we forecast the future motion data of a PV panel swing state through known historical swing data. In order to verify the precision and advantage of the MHPSO-LSTM method, we used a BP (back propagation) neural network, Kalman filter, LSTM neural network, PSO-LSTM network, and MHPSO-LSTM network model for comparative experiments. We used Equation (19) to normalize the data to a In the simulation process, the measured data input was sourced from level 5 and level 3 sea states. The sea state is divided into 10 levels according to the sea surface fluctuations, and the shape of the wave peaks and the degree of breakage, which is expressed as 0-9 level from low to high. The sampling frequency of the measured PV tilt change was 0.193 s, the quantity of training samples was 250, and the number of predicted samples was 50, respectively. Additionally, the forecast duration In this work, we forecast the future motion data of a PV panel swing state through known historical swing data. In order to verify the precision and advantage of the MHPSO-LSTM method, we used a BP (back propagation) neural network, Kalman filter, LSTM neural network, PSO-LSTM network, and MHPSO-LSTM network model for comparative experiments. We used Equation (19) to normalize the data to a [0,1] interval in order to converge quickly. For the evaluative indicators of the forecast results, we took the mean absolute percentage error (MAPE) and root mean square error (RMSE), wherex t is the prediction results of PV panel motion and x t is the actual values of panel motion.
In the simulation process, the measured data input was sourced from level 5 and level 3 sea states. The sea state is divided into 10 levels according to the sea surface fluctuations, and the shape of the wave peaks and the degree of breakage, which is expressed as 0-9 level from low to high. The sampling frequency of the measured PV tilt change was 0.193 s, the quantity of training samples was 250, and the number of predicted samples was 50, respectively. Additionally, the forecast duration was 9.65 s, and in the improved LSTM structure, the hidden layers were set to 3, the number of neurons was 50, number of iterations was 200, epoch times was 200 and the output data were the tilt angles of the photovoltaic panel, include the roll and pitch, which was then calculated by the matrix proposed in the second section for the Z-axis rotation matrix to get δ.
The above models (Kalman, BP, PSO-LSTM, LSTM, and MHPSO-LSTM) were used to predict the inclination of the PV panel under the level 5 and level 3 sea states. Figure 7 shows a comparison of the angle prediction results of the different prediction methods under the fifth-level sea state. Figure 8 shows a comparative group under a level 3 sea state.
angles of the photovoltaic panel, include the roll and pitch, which was then calculated by the matrix proposed in the second section for the Z-axis rotation matrix to get δ .
The above models (Kalman, BP, PSO-LSTM, LSTM, and MHPSO-LSTM) were used to predict the inclination of the PV panel under the level 5 and level 3 sea states. Figure 7 shows a comparison of the angle prediction results of the different prediction methods under the fifth-level sea state.    Figure 7a indicates the prediction curve of the pitch angle under a level 5 sea state, which corresponds to "pitch" in Equation (4). Similarly, Figure 7b corresponds to "roll" in Equation (4). Figure 9 shows that the prediction error of the proposed PSO algorithm can be controlled to within ±0.1 degree. It can be seen in Table 2 that the values of the MAPE and RMSE are used for the forecast. From the comparison of the forecast results of the proposed methods, it can be seen that the MHPSO structure improves the global search ability of the PSO algorithm by strengthening the message sharing between different particles. Appl. Sci. 2020, 10, x FOR PEER REVIEW 11 of 20 (a) Index of data.
(b) Index of data  Figure 9 shows that the prediction error of the proposed PSO algorithm can be controlled to within ± 0.1 degree. It can be seen in Table 2 that the values of the MAPE and RMSE are used for the forecast. From the comparison of the forecast results of the proposed methods, it can be seen that the MHPSO structure improves the global search ability of the PSO algorithm by strengthening the message sharing between different particles.  Output error of roll angle/(degree) Figure 9. Comparison of the five methods for the photovoltaic (PV) panel angle prediction error.  Table 3 demonstrates the convergence time (s) of five methods under difference sea state, it costs 0.1387 s to convergence for the improved LSTM structure, which is 4/5 to 1/3 of other algorithms in CPU times under AMD Ryzen5-3600X condition, combined with the improvement in accuracy which is stated in Table 2, the performance of the proposed algorithm has been significantly improved. Since there are few studies on the application of a LSTM-based neural network for ship motion attitude forecasting, in the next step we will continue to apply the MHPSO-LSTM model to shipborne photovoltaic panel swing prediction.

Multivariable Coupling Solar Photovoltaic Power Generation Model
According to the estimation of available space being 300,000 tons for large oil tankers, it is expected that 2000 m 2 of YGE145 series photovoltaic modules can be laid. Solar photovoltaic power generation systems include solar cell components, hybrid energy storage devices, controllers, and inverters. In this paper, a series of experiments were carried out on a solar ship swing platform. The device consisted of nine xenon lamps, eight solar photovoltaic panels (power factor: 0.861819573, module efficiency: 0.1451) and a six DOF swing table, as shown in Figure 10, which can simulate the movement of the ship at sea, such as the ship's heave, roll, and pitch, and determine the sunlight spreading coefficient and reflectivity in the shipboard photovoltaic power generation system. The artificial light intensity here was controlled to expanded to a 2000 m 2 area as a scale model.

Multivariable Coupling Solar Photovoltaic Power Generation Model
According to the estimation of available space being 300,000 tons for large oil tankers, it is expected that 2000 m 2 of YGE145 series photovoltaic modules can be laid. Solar photovoltaic power generation systems include solar cell components, hybrid energy storage devices, controllers, and inverters. In this paper, a series of experiments were carried out on a solar ship swing platform. The device consisted of nine xenon lamps, eight solar photovoltaic panels (power factor: 0.861819573, module efficiency: 0.1451) and a six DOF swing table, as shown in Figure 10, which can simulate the movement of the ship at sea, such as the ship's heave, roll, and pitch, and determine the sunlight spreading coefficient and reflectivity in the shipboard photovoltaic power generation system. The artificial light intensity here was controlled to expanded to a 2000 m 2 area as a scale model. The traditional marine photovoltaic power calculation model often only considers the changes in illumination, latitude, and longitude and does not take the PV panel's motion status as a non-negligible variable [21][22][23]. Under the traditional model, for ships with a fixed latitude and longitude, such as marine drilling platforms, the power change of a photovoltaic panel only depends on solar radiation intensity T I [24,25]. In this paper, the change of the photovoltaic panel inclination angle was introduced into the ship's photovoltaic power calculation model and the output power of the photovoltaic system was predicted for 10 s via the improved MHPSO-LSTM algorithm. The improvement of the calculation model provides a reliable basis for the power planning and dispatching of a ship's power grid and is a control method based on prediction. The The traditional marine photovoltaic power calculation model often only considers the changes in illumination, latitude, and longitude and does not take the PV panel's motion status as a non-negligible variable [21][22][23]. Under the traditional model, for ships with a fixed latitude and longitude, such as marine drilling platforms, the power change of a photovoltaic panel only depends on solar radiation intensity I T [24,25]. In this paper, the change of the photovoltaic panel inclination angle was introduced into the ship's photovoltaic power calculation model and the output power of the photovoltaic system was predicted for 10 s via the improved MHPSO-LSTM algorithm. The improvement of the calculation model provides a reliable basis for the power planning and dispatching of a ship's power grid and is a control method based on prediction. The direct solar radiation on the swinging photovoltaic surface can be represented by Figure 11. The traditional marine photovoltaic power calculation model often only considers the changes in illumination, latitude, and longitude and does not take the PV panel's motion status as a non-negligible variable [21][22][23]. Under the traditional model, for ships with a fixed latitude and longitude, such as marine drilling platforms, the power change of a photovoltaic panel only depends on solar radiation intensity T I [24,25]. In this paper, the change of the photovoltaic panel inclination angle was introduced into the ship's photovoltaic power calculation model and the output power of the photovoltaic system was predicted for 10 s via the improved MHPSO-LSTM algorithm. The improvement of the calculation model provides a reliable basis for the power planning and dispatching of a ship's power grid and is a control method based on prediction. The direct solar radiation on the swinging photovoltaic surface can be represented by Figure 11. Since the amount of solar energy received on side AC is equal to the amount of solar energy received on side AB, this can be denoted by Equation (22). The amount of tilted photovoltaic radiation can be expressed by Equations (23) Since the amount of solar energy received on side AC is equal to the amount of solar energy received on side AB, this can be denoted by Equation (22). The amount of tilted photovoltaic radiation can be expressed by Equations (23)-(26): I T,d = (1 + cos δ)/2 (24) where θ is the sun angle, I T,d is the scattered radiation, I T,b is the direct solar radiation, I T,r is the deck reflected radiation, I n is the value of the direct solar radiation incident on the surface, I d is the amount of scattered solar radiation on the horizontal plane, and ρ is the ground reflectivity. Here, δ is the predicted value of the inclination of the deck, which is calculated in Section 5. Since the solar illuminance directly affects the calculation result of the photovoltaic output, this paper corrects the coefficient (cos θ) of the shipborne solar photovoltaic system based on the solar illuminance data from the north of China to the east of Arabia, provided by the GeoModel Solar Company, as shown in Figure 12.
Where χ is the zenith angle, ς is the sun dip angel, λ is the latitude of the ship, τ is the sun angel, and d is the Julian days.
We select the latitudes zone between 1 • to 30 • as an example to calculate the daily average solar radiation of the target ship with different tilt angel δ as shown in Figure 13. It can be seen that under different latitudes and tilt angel, the amount of solar radiation is different. After the correction, the light intensity received by the photovoltaic panel on the deck of the tanker was considered, shown in Figure 14. The yellow, green, orange, and blue lines represent the solar radiation for the four seasons.
We select the latitudes zone between 1° to 30° as an example to calculate the daily average solar radiation of the target ship with different tilt angel δ as shown in Figure 13. It can be seen that under different latitudes and tilt angel, the amount of solar radiation is different. After the correction, the light intensity received by the photovoltaic panel on the deck of the tanker was considered, shown in Figure 14. The yellow, green, orange, and blue lines represent the solar radiation for the four seasons.

Experimental Results
The operating environment here was 1200 W/m 2 , 25 °C temperature, and the power generated by the PV system was fluctuate around 270 kW. Solar PV power generation systems include solar cell components, hybrid energy storage devices, diesel, controllers, and inverters. Here, the AC bus voltage was 440 V and the AC frequency was 60 Hz during the simulation, and the ship's operating conditions were referenced from being anchored. The basic diagram of the solar photovoltaic power generation system is shown as Figure 15.

Experimental Results
The operating environment here was 1200 W/m 2 , 25 °C temperature, and the power generated by the PV system was fluctuate around 270 kW. Solar PV power generation systems include solar cell components, hybrid energy storage devices, diesel, controllers, and inverters. Here, the AC bus voltage was 440 V and the AC frequency was 60 Hz during the simulation, and the ship's operating conditions were referenced from being anchored. The basic diagram of the solar photovoltaic power generation system is shown as Figure 15.

Experimental Results
The operating environment here was 1200 W/m 2 , 25 • C temperature, and the power generated by the PV system was fluctuate around 270 kW. Solar PV power generation systems include solar cell components, hybrid energy storage devices, diesel, controllers, and inverters. Here, the AC bus voltage was 440 V and the AC frequency was 60 Hz during the simulation, and the ship's operating conditions were referenced from being anchored. The basic diagram of the solar photovoltaic power generation system is shown as Figure 15.
The operating environment here was 1200 W/m 2 , 25 °C temperature, and the power generated by the PV system was fluctuate around 270 kW. Solar PV power generation systems include solar cell components, hybrid energy storage devices, diesel, controllers, and inverters. Here, the AC bus voltage was 440 V and the AC frequency was 60 Hz during the simulation, and the ship's operating conditions were referenced from being anchored. The basic diagram of the solar photovoltaic power generation system is shown as Figure 15.  After the route and time were selected, Equations (29) and (30) of the solar PV power generation system were used to calculate output power.
where I t is the light radiation intensity, η PV is the conversion efficiency of the solar panel, A PV is the area for laying the photovoltaic panels on the deck, η PV_rated is the rated PV conversion efficiency of the PV module, η MPPT is the conversion efficiency under MPPT control, ε is the power temperature coefficient of the PV module, T c is the temperature of the surface of the PV module, and T c_re f is the temperature of the PV module under standard conditions. The fluctuation of the inclination is intense and random, and the radiation of the photovoltaic panel changes frequently. Figures 16 and 17 show the fluctuation of solar radiation and PV output power in the short-term. The result of the proposed model shows that the actual power output of PV panel fluctuates randomly within a range (250-275 kW), 265 kW is the average value in one hour. If we adopt the traditional model (fixed PV panel angle) and do not consider the change of inclination as a variable, the power output of Figure 18 can be obtained. Obviously, comparing with the result of our proposed model, the cases of δ = 4 and δ = 8 in Figure 18 are both an ideal state, the extra energy production are higher and lower than the result of the proposed model as shown in Figure 17 by 5 kW and 15 kW respectively. If this error is enlarged to the annual scale, the extra energy production 30,000-60,000 kWh will be mistaken as the value that should be considered in the power planning.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 16 of 20 After the route and time were selected, Equations (29) and (30) of the solar PV power generation system were used to calculate output power.
where t I is the light radiation intensity, PV η is the conversion efficiency of the solar panel, PV A is the area for laying the photovoltaic panels on the deck,  Figure 18 are both an ideal state, the extra energy production are higher and lower than the result of the proposed model as shown in Figure 17 by 5 kW and 15 kW respectively. If this error is enlarged to the annual scale, the extra energy production 30,000-60,000 kWh will be mistaken as the value that should be considered in the power planning. According to the calculation model proposed in previous section, Figures 19 and 20 show the short-term power prediction based on five methods under level-5 and level-3 sea state within 10 s for a shipborne solar power system, Table 4 shows the MAPE and RMSE value of forecasting the energy production. It can be seen that the power prediction accuracy with MHPSO-LSTM structure is improved by 50% to 70% compared with other methods. Therefore, the proposed algorithm reveals better prediction performance in forecasting the short-term power fluctuation.
Index of data. According to the calculation model proposed in previous section, Figures 19 and 20 show the short-term power prediction based on five methods under level-5 and level-3 sea state within 10 s for a shipborne solar power system, Table 4 shows the MAPE and RMSE value of forecasting the energy production. It can be seen that the power prediction accuracy with MHPSO-LSTM structure is improved by 50% to 70% compared with other methods. Therefore, the proposed algorithm reveals better prediction performance in forecasting the short-term power fluctuation. According to the calculation model proposed in previous section, Figures 19 and 20 show the short-term power prediction based on five methods under level-5 and level-3 sea state within 10 s for a shipborne solar power system, Table 4 shows the MAPE and RMSE value of forecasting the energy production. It can be seen that the power prediction accuracy with MHPSO-LSTM structure is improved by 50% to 70% compared with other methods. Therefore, the proposed algorithm reveals better prediction performance in forecasting the short-term power fluctuation.
Index of data.     Table 5 demonstrate the economic and emissions influence under different calculation model of shipborne PV system. In our cases, generating side including diesel generator and solar PV power generation system, case 1 is the shipborne PV system with traditional model, case 2 representative the PV system under considerate the effect of ship's sway. This paper considers the hourly fuel consumption F of diesel generators, defined as

Economic and Environment Influence
where the η = 0.264 (L/h) is diesel generator fuel consumption coefficient, P d is the power generation of the diesel per hour. The hourly fuel cost defined as The price f uel is international oil price in July 2020, defined as 0.71$/L. In the simulation process, the estimated annual energy production of diesel of ship power stations under different model is 3,975,644 kWh and (3,969,636-4,001,909) kWh respectively, the capacity of diesel in PV power generation system is 2 MW. According to the CO 2 emission coefficient, set as 0.92 (kg CO 2 /kg) in this paper, we also could estimate the amount of dioxide emissions.
Due to the swing of the PV panel, the fuel cost and CO 2 emissions of the auxiliary diesel also not a fixed value, but fluctuates within a range, such calculation results could provide a more reliable reference for formulating the energy management strategy of the power grid or the configuration method of energy storage. It is worth noting that the upper limit value of dioxide emissions in case 2 is 12,420 kg higher than case 1, studies related to optimize scheduling that consider environmental protection should take this neglected numerical difference as an important operational constrains. Thus, the proposed calculation model can be used in calculate the power output of shipborne PV, which could provide more reliable operation constraint condition for grid optimization.

Conclusions
Considering the inaccuracy of traditional marine photovoltaic power calculation models, this paper has proposed an improved mathematical model of PV power calculation via considering the effect of ship movements leading to the change of PV panel inclination. According to a rotation matrix, the roll and pitch are reduced to one angle and then introduced into the radiation calculation formula, where the radiation is corrected according to the latitude, longitude, and season. The proposed mathematical model provides a more realistic model and an appropriate calculation method for shipborne PV systems under different sea conditions, also this could be used as a reference for a series of stability control strategies for the output power of PV panels. Secondly, the MHPSO algorithm was improved for the prediction of PV panel inclination change. By reforming the structure and speed update equation of a PSO algorithm, the capacity of convergence was improved; thereby, increasing the solution speed of the system. Meanwhile, the MHPSO and LSTM models were combined to predict the motion of a PV panel. This structure optimizes the initial weights and thresholds of LSTM in order to overcome the problem of inaccurate parameter selection. In addition, we have used five different models, including MHPSO-LSTM, Kalman filter, LSTM network, BP neural net structure, and a PSO-LSTM algorithm to forecast the movement data of photovoltaic panels under the fifth-and third-level sea states.
Our cases show that the proposed method has higher learning accuracy and better performance prediction than the existing methods. The comparison of grid economics and carbon dioxide emissions also shows the necessity of the proposed model. Finally, the ultrashort-term power prediction of a photovoltaic system has been carried out via predicting the fluctuation of the photovoltaic panel inclination.
In future work, reformation for the MHPSO model will be studied to further raise the prediction precision of shipborne PV panels, and this will be combined with other heuristic algorithms to further study the model performance.