Increasing the utilization rate of regenerative braking energy in rail systems is one of the ongoing applications increasing in significance in recent years. This study develops a novelty algorithm within the scope of this objective and provides the calculation of the regenerative braking energy recovery rate and then making a decision for storage or back to grid of this energy. Afterwards, the regenerative braking energy was calculated with the help of this algorithm for Eskisehir-Ankara and Ankara-Eskisehir trips in two different passengers (load) scenarios, using the YHT 65000 high-speed train, which was chosen as a case study. Then, with a decision maker added to this classical regenerative braking energy algorithm, it will be decided whether this energy will be stored or forward back into the grid for the purpose of providing non-harmonic energy to the grid.