# Energy-Optimized 3D Path Planning for Unmanned Aerial Vehicles
## 6 Calculation the Resulting Velocity and Energy Demand of the Drone  
Figure 5 clearly shows that most of the energy is required by the driving motors of the drone's propellers, and the other consumption is almost negligible. The power of the driving motors is closely related (directly proportional) to drone speed.  
\[\overset{\rightarrow}{P}=\sum\overset{\rightarrow}{F_{(i)}}*\overset{ \rightarrow}{v}; \tag{16}\]  
where \(\overset{\rightarrow}{P}=\frac{\Sigma\overset{\rightarrow}{E_{i}}}{I}\).  
Since the forces and energies were calculated previously (see Equations (1)-(12)), now the velocities should be determined.  
After obtaining the \"wind map\" of the environment, the resulting velocity vector can be calculated. As seen above (see Equation (16)), the velocity directly influences the drone's energy consumption, which means determining the correct resulting velocity is vital. As indicated in Equation (12), \(E_{kinetic}\) considers the wind conditions based on the following principles, seen in Figure 10.  
Figure 10a-c display that the resulting drone velocity is calculated from the signed _vector sum_ of the wind speed and direction, as well as the average drone speed and direction, see Equation (17) (note: in the case of scalar calculations, the resulting velocity, magnitude and direction, must be performed based on well-known trigonometric (cosine) equations, see Equations (18) and (19))  
\[\overset{\rightarrow}{v}_{resulting}+\overset{\rightarrow}{v}_{ drone}+\overset{\rightarrow}{v}_{wind} \tag{17}\]  
in scalar:  
\[\left|\begin{array}{c}v\\ \underset{resulting}{\left(amplitude\right)}\end{array}\right|=\Big{(}v_{ drone}^{2}+v_{wind}^{2}-2v_{ drone}.w_{wind}.cosa\Big{)}^{\frac{1}{2}}; \tag{18}\]  
\[\begin{array}{c}v\\ (orientation)\end{array}\begin{array}{c}resulting\\ (\beta^{\prime})=arccos(\frac{\sum_{wind}^{2}-\sum_{down}^{2}+\sum_{roll}^{2}}{ \sum_{roll}^{2}v_{wind}^{2}});\end{array} \tag{19}\]  
Theoretically (if the drone velocity remains constant), in certain cases the drone may hover in one place. The algorithm avoids this situation by making the drone change its orientation in a direction with lower resistance, and then, after travelling some distance, it turns again towards the target position. This situation is illustrated in the figures below,  
Figure 10: The resulting velocity calculation of the drone. (**a**) Tailwind; (**b**) crosswind; (**c**) headwind. The wind direction is represented by the dashed-arrow lines; the resulting (calculated) velocity vector of the drone is represented by red full-arrow line; the initial velocity and orientation of the drone is represented by blue full-arrow line.  
By combining Equation (16) and the power-energy relation, the following equation can be obtained:  
\[\frac{\overset{\rightarrow}{E}}{t}=\overset{\rightarrow}{F}*\overset{ \rightarrow}{\overset{\rightarrow}{v}}\quad\quad\rightarrow\quad\overset{ \rightarrow}{E}=\overset{\rightarrow}{F}*\overset{\rightarrow}{\overset{ \rightarrow}{v}}*t \tag{20}\]  
This calculated energy is \(\overset{\rightarrow}{E}_{kinetic}\) and must be considered, and added to the final calculation of the node's energy demand.