# An Efficient GPS Algorithm for Maximizing Electric Vehicle Range
## 3 Mathematical Modeling and Proposed Algorithm
It works when the vehicle is decelerating or braking, and it saves energy from this braking and recharges the battery with this energy, which is why all other forces are added to the total forces while this one is subtracted, and can be expressed as follows:  
\[-\textbf{{F}}_{\textbf{green}}=-(\textbf{{\eta}}_{\textbf{{regen}}}\times \textbf{{\eta}}_{\textbf{{battery to wheel}}}\times\textbf{{m}}\times\textbf{{a}}) \tag{4}\]  
here there are two types of efficiencies taken into consideration: '\(\eta_{\textbf{{regen}}}\)' ranges theoretically from 0 to 1 and represents the amount of energy regenerated from braking when powering the wheels the value becomes zero, and for idling or braking the value sometimes reaches about 80%. This value differs according to the vehicle used and regenerative system inside the vehicle. While '\(\eta_{\textbf{{battery to wheel}}}\)' represents the energy losses from the battery to the wheel as a coefficient which ranges theoretically from 0 to 1 and includes the battery efficiency, power electronic converter, and motor efficiency [33; 34]. The last part is the power consumed by the auxiliary loads from lights, horn, air conditioner, and radios, for example, [34]. Therefore, the total power consumed by the vehicle can be finally represented as follows:  
\[\textbf{{P}}_{\textbf{drive}}(\textbf{{Watt}})=\Bigg{(}\frac{\textbf{{A}}+ \textbf{{Bv}}+\textbf{{Cv}}^{2}+\textbf{{mgsin}}\textbf{{\theta}}}{\textbf{{ \eta}}_{\textbf{{battery to wheel}}}}+\frac{\textbf{{ma}}}{\textbf{{\eta}}_{ \textbf{{battery to wheel}}}}-(\textbf{{\eta}}_{\textbf{{regen}}}\textbf{{ \eta}}_{\textbf{{battery to wheel}}}\textbf{{ma}})\Bigg{)}\textbf{{v}}+\frac{ \textbf{{W}}_{\textbf{aux}}}{\textbf{{\eta}}_{\textbf{dc}-\textbf{dc}}} \tag{5}\]  
where '\(\textbf{{\eta}}_{\textbf{dc}-\textbf{dc}}\)' is the efficiency of the dc-to-dc converter used in the vehicle to supply the auxiliary loads [35]. As for the energy consumed per kilometer and the average range that the vehicle can cover, this can be calculated as follows:  
\[\textbf{{E}}_{\textbf{drive}}\bigg{(}\frac{\textbf{{w}}\textbf{{h}}}{\textbf {{k}}\textbf{{m}}}\bigg{)}=\frac{\textbf{{P}}_{\textbf{drive}}(\textbf{{W}} )}{\textbf{{V}}\Big{(}\frac{\textbf{{k}}\textbf{{m}}}{\textbf{{h}}r}\Big{)}} \tag{6}\]  
\[\textbf{{Range}}(\textbf{{k}}\textbf{{m}})=\frac{\textbf{{Battery Capacity}} \times 1000}{\textbf{{E}}_{\textbf{drive}}} \tag{7}\]  
To calculate the total energy for different routes, this process can be carried out by following the flowchart in Figure 4. The flowchart appears to outline a process for calculating and comparing the total energy consumed in different routes to select the optimum route for a specific EV model. The flowchart follows a step-by-step approach:  
* Start: This initial node marks the beginning of the flowchart. * Divide routes into nodes: This step involves dividing the suggested routes into multiple nodes. Each node represents a specific point or location along the route. For instance, a road of 10 km can be divided by 10 nodes. Also, as the number of nodes increases, the results become more accurate. Calculate the energy consumed in a specified distance for each node: Once the routes are divided into nodes, this step calculates the energy consumed at each node for the specified distance. It likely involves considering factors such as the terrain, speed, and efficiency of the EV model. * Repeat for the second node until the destination is reached: This step suggests that the process of calculating energy consumption is repeated for each subsequent node until the destination is reached. This allows for a comprehensive assessment of energy usage throughout the entire route. * Accumulate the energy dissipated for Route 1: At this point, the energy dissipated or consumed at each node is accumulated to determine the total energy consumed for Route 1. This step provides a measure of the energy usage for the entire route.