# Optimizing Regenerative Braking: A Variational Calculus Approach

Authors: L. Q. English; A. Mareno; Xuan-Lin Chen
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

We begin by analyzing, using basic physics considerations, under what conditions it becomes energetically favorable to use aggressive regenerative braking to reach a lower speed over “coasting” where one relies solely on air drag to slow down. We then proceed to reformulate the question as an optimization problem to find the velocity profile that maximizes battery charge. Making a simplifying assumption on battery-charging efficiency, we express the recovered energy as an integral quantity, and we solve the associated Euler–Lagrange equation to find the optimal braking curves that maximize this quantity in the framework of variational calculus. Using Lagrange multipliers, we also explore the effect of adding a fixed-displacement constraint.


---

## Body

## 1. Introduction

Regenerative braking is a process by which some of the initial kinetic energy of a vehicle, rather than wasted as heat, is instead recovered by converting it into electrical energy which in turn is stored as chemical energy in the battery [1]. In the engineering literature, this topic is usually approached from a technological perspective [2–6]. In contrast, here we take a more simplified yet fundamental approach to the subject drawing from classical mechanics and the calculus of variations.There has recently been some debate over the benefits of “1-pedal driving”—this is a mode where as soon as the driver of an electric vehicle (EV) releases pressure on the accelerator pedal, the electric generator is engaged, the battery charges up, and the EV begins to slow down. Tesla, for instance, makes this mode standard in all its cars. Other manufacturers, such as Volkswagen (VW), have opted to preserve the driving experience of conventional internal-combustion-engine (ICE) cars, whereby releasing the accelerator pedal allows the car to coast. Coasting means that neither the motor nor the generator are engaged, and the vehicle slows down solely due to aerodynamic drag and other friction. Some people have argued that coasting is, in fact, always best in terms of efficiency, assuming no constraints on the stopping distance [7].In this paper [8], we start by comparing the two strategies over the same fixed displacement, and we find that aggressive regenerative braking is superior to coasting as long as the final speed is small enough. While it is true that both the electric motor and the generator do not operate at perfect efficiency and produce losses, lowering the speed faster lowers the drag force on the vehicle (relative to coasting). Thus, there exists a trade-off: regenerative braking recovers some of the initial kinetic energy (though not all of it), but the electric motor then has to use additional energy to keep the vehicle in motion. Is more energy initially stored in the battery as is later drawn from it? As we will see, the answer often is yes.In the second part of the paper, we reformulate the question in terms of an optimization problem. Here we ask the following: what should the speed profile be that leaves the battery in the largest state of charge (SOC)? This recovered energy is an integral quantity, and we thus formulate the associated Euler–Lagrange equation whose solution maximizes this quantity and yields the optimal velocity as a function of time. Modeling the regenerative-braking efficiency in the simplest, most tractable way, we solve this non-linear differential equation numerically, as well as analytically in integral form. Finally, we examine the effect of adding a fixed-displacement constraint via a Lagrange multiplier.


## 2. Recoverable Energy Considerations

### 2.1. Coasting

In this scenario, we would like to rely solely on air drag and rolling friction to slow our EV down from an initial speed ofvi to a final speed of vf. Here we ignore the contributions of rolling friction—it only exhibits a weak dependence on vehicle speed [9] and should thus result in a similar energy loss when comparing coasting with regenerative braking. What is the final state of the battery relative to its initial state while coasting? It is clear that they are the same. No energy is transferred to or from the battery.For the sake of comparison with the regenerative-braking scenario, let us calculate the accumulated displacement for this coasting process. Let us assume that the drag force is quadratic in velocity, such that(1)FD=12ρACdv2=Dv2,where A is the cross-sectional area, ρ is the density of air, and Cd is the drag coefficient, and we have combined these parameters into a single constant, D. This form of the drag force is valid for relatively high speeds, such as a car on a highway, but fails at low speeds. We thus arrive at the following differential equation governing coasting:(2)mv˙=−Dv2,where m is the car mass. Equation (2) has the well-known analytical solution(3)1vt=1vi+Dmt.The displacement,Δx=∫0tcvtdt, can then be found, after a few steps.(4)Δx=mDlnvivf.It is clear from equation (4) that we cannot use the quadratic-drag assumption down to a vf of zero.


### 2.2. Regenerative Braking

Instead of coasting, let us now try a different strategy: we will slow the EV down quickly fromvi to vf using regenerative braking, and then we will continue to drive at vf until we have covered the same distance, Δx, as we did in the coasting scenario. For sake of simplicity, let us further assume that in the braking phase, the speed drops linearly in time, and that we accomplish this part in a time, tr, as shown in Figure 1. As we will see in Section 3, this constant-acceleration strategy is not optimal and can still be improved upon, but it serves as a good starting point. The total displacement can now be expressed as(5)Δx=vftr+12vi−vftr+vftf−tr=12vi−vftr+vftf.Figure 1
Speed as a function of time for the two processes: coasting (red line) and regenerative braking (blue line) fromvi to vf. The relevant times are indicated on the horizontal axis.Setting this expression equal to equation (4) for coasting yields(6)tf=m/Dlnvi/vfvf−vi−vf2vftr.Thistf must be longer than the coasting time, tc, of course.Next, let us look at the battery SOC during the two stages—the initial regenerative-braking stage, followed by the constant-speed stage. First, how much energy can be transferred to the battery during the first stage? Here kinetic energy is converted to electrical energy and then stored as chemical energy in the battery. Let us assume that the efficiency from kinetic to chemical-battery energy is given byη. We then have that(7)ΔEbatt1=ηΔT−Wfric1,with ΔT=1/2mvi2−vf2. Equation (7) can also be regarded as a definition of η, the regenerative efficiency [10, 11]. But what is Wfric1 for this stage?We know thatWfric1=∫FDdx=D∫0trv3dt, where the speed is given by(8)vt=vi−vi−vftrt,describing the constant deceleration part shown in Figure 1 (blue line). If we denote vi−vf by w, expand out the cubic term, and change variables of integration, we can show that(9)Wfric1=Dtrvi3−32vi2w+viw2−14w3.We can then substitute equation (9) into equation (7).Now let us turn to the second stage. Here the electric motor has to simply counteract the drag force. The work done by the drag force is given by(10)Wfric2=Dvf2Δx2=Dvf3tf−tr,with tf given by equation (6).Assuming that the efficiency of converting chemical energy stored in the battery to electrical and then mechanical energy isϵ, we arrive at(11)ΔEbatt2=−1ϵWfric2,where Wfric2 is given by equation (10), and so ΔEbatt=ΔEbatt1+ΔEbatt2. The problem is then reduced to determining the sign of ΔEbatt.This expression forΔEbatt is still fairly complicated and includes 7 parameters: vi, vf, tr, D, m, η, and ϵ. Let us simplify things by analyzing the limit of short tr, such that tr≪tf. In this limit of tr⟶0, the equations simplify significantly, starting with equation (6), where we can drop the second term. Furthermore, Wfric1 in equation (9) is zero in this limit, and we arrive at(12)ΔEbatt=12mvi2−vf2η−mvf2lnvivf1ϵ.In other words, we have to determine the sign of the following expression:(13)M=vi2vf2−1η−2lnvivf1ϵ.Equation (13) is plotted in Figure 2 as a function of speed ratio for two different sets of efficiencies. We see that for speed ratios only slightly larger than 1, M is negative. For larger speed ratios, M always turns positive. The crossing depends sensitively on the efficiencies of the motor and generator, with lower efficiency pushing that break-even point out to larger speed ratios, vi/vf.Figure 2
The expressionM of equation (13) plotted as a function of the speed ratio. The red line is for ϵ=η=0.8, and the blue line is for ϵ=η=0.6.The conclusion is that coasting is preferable when the final target speed is not substantially below the initial speed, i.e., for instances where the desired slowdown is only moderate. For instances where a more dramatic slowdown is desired, aggressive regenerative braking wins out. A quick calculation reveals that if we want to slow down to half of our initial speed, say from 60 mph to 30 mph, and assuming thatη=ϵ, any efficiency larger than η=ϵ=68% will favor regenerative braking.


### 2.3. A Concrete Example

So far, the treatment has been theoretical. To make the conclusions more concrete, let us calculate actual numbers from a speed-down experiment with a Tesla (Model 3) [12]. For concreteness, consider decreasing the speed from 50 mph (22.35 m/s) to 25 mph (11.18 m/s) and compare regenerative braking to coasting. The parameters of this vehicle are given as follows: the drag coefficient Cd=0.23, the frontal area A = 2.22 m2, and the weight of the car (with a driver) m = 1280 kg [13]. The density of dry air is ρ=1.225kg/m3.Assuming an efficiency ofϵ=η=0.75, tf is calculated from equation (6) as(14)tf=253.8−0.5tr.Next, from equations (7) and (11) and ΔEbatt=ΔEbatt1+ΔEbatt2, we get(15)ΔEbatt=32103.7−354.7tr.According to equations (14) and (15), tf and ΔEbatt have a linear relationship with tr, and ΔEbatt is positive only when tr<92s. Furthermore, we can also get the time of coasting tc=183s from equation (3), and thus we explicitly verify the time ordering, tr<tc<tf when ΔEbatt>0.In an actual speed-down experiment with a Tesla Model 3 we were able to reach a minimumtr of around 5.0 s. This is much below the theoretical cutoff value of 92 s (where ΔEbatt=0), as calculated above. We have to remember, however, that calculated tc and tr are too long compared to realistic numbers, as the real dissipation is not just in the form of air drag but also includes rolling friction (tire and road) and internal friction. Nonetheless, 5 s is significantly below 92 s, and it is also well below realistic coasting times. It is thus very likely that this speed-down experiment left the battery with a larger charge than what coasting would have accomplished.


## 2.1. Coasting

In this scenario, we would like to rely solely on air drag and rolling friction to slow our EV down from an initial speed ofvi to a final speed of vf. Here we ignore the contributions of rolling friction—it only exhibits a weak dependence on vehicle speed [9] and should thus result in a similar energy loss when comparing coasting with regenerative braking. What is the final state of the battery relative to its initial state while coasting? It is clear that they are the same. No energy is transferred to or from the battery.For the sake of comparison with the regenerative-braking scenario, let us calculate the accumulated displacement for this coasting process. Let us assume that the drag force is quadratic in velocity, such that(1)FD=12ρACdv2=Dv2,where A is the cross-sectional area, ρ is the density of air, and Cd is the drag coefficient, and we have combined these parameters into a single constant, D. This form of the drag force is valid for relatively high speeds, such as a car on a highway, but fails at low speeds. We thus arrive at the following differential equation governing coasting:(2)mv˙=−Dv2,where m is the car mass. Equation (2) has the well-known analytical solution(3)1vt=1vi+Dmt.The displacement,Δx=∫0tcvtdt, can then be found, after a few steps.(4)Δx=mDlnvivf.It is clear from equation (4) that we cannot use the quadratic-drag assumption down to a vf of zero.


## 2.2. Regenerative Braking

Instead of coasting, let us now try a different strategy: we will slow the EV down quickly fromvi to vf using regenerative braking, and then we will continue to drive at vf until we have covered the same distance, Δx, as we did in the coasting scenario. For sake of simplicity, let us further assume that in the braking phase, the speed drops linearly in time, and that we accomplish this part in a time, tr, as shown in Figure 1. As we will see in Section 3, this constant-acceleration strategy is not optimal and can still be improved upon, but it serves as a good starting point. The total displacement can now be expressed as(5)Δx=vftr+12vi−vftr+vftf−tr=12vi−vftr+vftf.Figure 1
Speed as a function of time for the two processes: coasting (red line) and regenerative braking (blue line) fromvi to vf. The relevant times are indicated on the horizontal axis.Setting this expression equal to equation (4) for coasting yields(6)tf=m/Dlnvi/vfvf−vi−vf2vftr.Thistf must be longer than the coasting time, tc, of course.Next, let us look at the battery SOC during the two stages—the initial regenerative-braking stage, followed by the constant-speed stage. First, how much energy can be transferred to the battery during the first stage? Here kinetic energy is converted to electrical energy and then stored as chemical energy in the battery. Let us assume that the efficiency from kinetic to chemical-battery energy is given byη. We then have that(7)ΔEbatt1=ηΔT−Wfric1,with ΔT=1/2mvi2−vf2. Equation (7) can also be regarded as a definition of η, the regenerative efficiency [10, 11]. But what is Wfric1 for this stage?We know thatWfric1=∫FDdx=D∫0trv3dt, where the speed is given by(8)vt=vi−vi−vftrt,describing the constant deceleration part shown in Figure 1 (blue line). If we denote vi−vf by w, expand out the cubic term, and change variables of integration, we can show that(9)Wfric1=Dtrvi3−32vi2w+viw2−14w3.We can then substitute equation (9) into equation (7).Now let us turn to the second stage. Here the electric motor has to simply counteract the drag force. The work done by the drag force is given by(10)Wfric2=Dvf2Δx2=Dvf3tf−tr,with tf given by equation (6).Assuming that the efficiency of converting chemical energy stored in the battery to electrical and then mechanical energy isϵ, we arrive at(11)ΔEbatt2=−1ϵWfric2,where Wfric2 is given by equation (10), and so ΔEbatt=ΔEbatt1+ΔEbatt2. The problem is then reduced to determining the sign of ΔEbatt.This expression forΔEbatt is still fairly complicated and includes 7 parameters: vi, vf, tr, D, m, η, and ϵ. Let us simplify things by analyzing the limit of short tr, such that tr≪tf. In this limit of tr⟶0, the equations simplify significantly, starting with equation (6), where we can drop the second term. Furthermore, Wfric1 in equation (9) is zero in this limit, and we arrive at(12)ΔEbatt=12mvi2−vf2η−mvf2lnvivf1ϵ.In other words, we have to determine the sign of the following expression:(13)M=vi2vf2−1η−2lnvivf1ϵ.Equation (13) is plotted in Figure 2 as a function of speed ratio for two different sets of efficiencies. We see that for speed ratios only slightly larger than 1, M is negative. For larger speed ratios, M always turns positive. The crossing depends sensitively on the efficiencies of the motor and generator, with lower efficiency pushing that break-even point out to larger speed ratios, vi/vf.Figure 2
The expressionM of equation (13) plotted as a function of the speed ratio. The red line is for ϵ=η=0.8, and the blue line is for ϵ=η=0.6.The conclusion is that coasting is preferable when the final target speed is not substantially below the initial speed, i.e., for instances where the desired slowdown is only moderate. For instances where a more dramatic slowdown is desired, aggressive regenerative braking wins out. A quick calculation reveals that if we want to slow down to half of our initial speed, say from 60 mph to 30 mph, and assuming thatη=ϵ, any efficiency larger than η=ϵ=68% will favor regenerative braking.


## 2.3. A Concrete Example

So far, the treatment has been theoretical. To make the conclusions more concrete, let us calculate actual numbers from a speed-down experiment with a Tesla (Model 3) [12]. For concreteness, consider decreasing the speed from 50 mph (22.35 m/s) to 25 mph (11.18 m/s) and compare regenerative braking to coasting. The parameters of this vehicle are given as follows: the drag coefficient Cd=0.23, the frontal area A = 2.22 m2, and the weight of the car (with a driver) m = 1280 kg [13]. The density of dry air is ρ=1.225kg/m3.Assuming an efficiency ofϵ=η=0.75, tf is calculated from equation (6) as(14)tf=253.8−0.5tr.Next, from equations (7) and (11) and ΔEbatt=ΔEbatt1+ΔEbatt2, we get(15)ΔEbatt=32103.7−354.7tr.According to equations (14) and (15), tf and ΔEbatt have a linear relationship with tr, and ΔEbatt is positive only when tr<92s. Furthermore, we can also get the time of coasting tc=183s from equation (3), and thus we explicitly verify the time ordering, tr<tc<tf when ΔEbatt>0.In an actual speed-down experiment with a Tesla Model 3 we were able to reach a minimumtr of around 5.0 s. This is much below the theoretical cutoff value of 92 s (where ΔEbatt=0), as calculated above. We have to remember, however, that calculated tc and tr are too long compared to realistic numbers, as the real dissipation is not just in the form of air drag but also includes rolling friction (tire and road) and internal friction. Nonetheless, 5 s is significantly below 92 s, and it is also well below realistic coasting times. It is thus very likely that this speed-down experiment left the battery with a larger charge than what coasting would have accomplished.


## 3. Optimizing Regenerative Braking

### 3.1. Charging Efficiency Considerations

From the previous discussion, and in particular from equation (15), it becomes clear that without any further consideration of the charging efficiency involved, the best strategy is to brake very severely to reach the desired target speed as quickly as possible and then to remain at that constant speed for the rest of the way. This was also embodied in our examined limit of very short tr. As we now show, a variational calculus formulation of that problem confirms this observation. In an initial attempt to shift into this framework, we seek to maximize the following functional:(16)S=∫0TLdt,where(17)L=Lv,v˙=−mvv˙−Dv3.The expression forL is derived from the combination of dT=−mvv˙dt and dWfric=Dv3dt (where T denotes the kinetic energy). The associated Euler–Lagrange equation,(18)ddt∂L∂v˙=∂L∂v,then quickly leads to the result that vt=0.If we think about it a bit, this result should not be unexpected. Since we have assumed that the regenerative efficiency,η, is entirely constant, it makes sense that the energetically best thing we could do is to immediately slow down to zero. If we have a constraint that we must travel a certain distance, i.e., that ∫0Tvtdt=d, the analysis can be modified by adding a Lagrange multiplier, but the end result is similar: it is best to immediately slow down to a small constant speed (consistent with the distance, d).It is clear that the culprit for this trivial answer is our assumption of constant efficiency. In reality, what EVs do when they need to slow down quickly is to blend in the physical brakes to assist the regenerative braking. The more severe the required deceleration is, the more heavily the EV relies on brake pads and rotors. This means that the efficiency of converting kinetic energy into battery energy goes down significantly as the braking action quickens. The battery can only accept so much power delivered to it, and this maximum power also depends sensitively on the battery SOC and temperature. Even before we reach that power limit, Ohmic losses tend to increase with charging power to reduce efficiency [11, 14], and friction braking is often blended in [4, 5, 10].How should we model these effects on efficiency? To start, it is clear that the efficiency is a monotonically decreasing function of the braking power that the battery ideally would be expected to “absorb.” This power, in turn, could be approximated by the reduction in kinetic energy of the vehicle,P≈−dT/dt=−mvv˙. Thus, we can write η=ηp=ηv,v˙. We will later choose a linearly decreasing function. Such choice of ηP, while not accounting for the full complexity, does capture the overall effect on efficiency heuristically and keeps the mathematics tractable.


### 3.2. Optimal Braking Curves without Distance Constraints

Informed by these considerations, we now seek to maximize the following functional:(19)S=∫0Tηv,v˙−mvv˙−Dv3dt.The function,ηv,v˙, should be close to η0 for low vv˙ and then decrease for larger vv˙.Let us next substitute this newL of equation (19) into the Euler–Lagrange equation, equation (18), and this returns a fairly complicated equation with several terms:(20)∂η∂v−ddt∂η∂v˙−mvv˙−Dv3=η3Dv2−η˙mv+∂η∂v˙−mvv¨−mv˙2−3Dv2v˙.It is interesting to note that the first part of equation (20) is in the form of an Euler–Lagrange equation involving η as the functional. We must now specify a functional form for η to proceed. To keep things mathematically tractable, let us choose the following functional form for η:(21)ηv,v˙=η0+bmvv˙.Here we have assumed that the efficiency drops linearly with power; the two parameters are they-intercept η0 and the slope, b. Note that b here is positive, since v˙ is negative. A side benefit of this choice for η is that it forces the left side of equation (20) to zero, yielding(22)∂η∂v˙mvv¨+mv˙2+3Dv2v˙+mvη˙−3ηDv2=0.From equation (21), ∂η/∂v˙=bmv and ∂η/∂v=bmv˙, and we get(23)mvη˙=mv∂η∂vv˙+∂η∂v˙v¨=bm2vv˙2+bm2v2v¨.Substituting equations (23) and (21) into equation (22) yields (after a few steps) the following differential equation:(24)2bm2v2v¨+2bm2vv˙2−3η0Dv2=0.Although not imperative, it can be helpful to non-dimensionalize equation (24). For this purpose, we introduce the non-dimensional quantities u and τ, defined as τ=t/α, with α=m/Dvi, and u=αD/mv=v/vi. Inserting these definitions into equation (24), we arrive at the governing equation:(25)u2u″+uu′2−γu2=0.Here the prime indicates differentiation with respect toτ, and(26)γ=3α3η0D22m3b=3η02Dbvi3.Equation (25) represents a second-order non-linear differential equation that we can reduce to a first-order one. Dividing by u2 and introducing w=u′, we can rewrite equation (25) in the following form:(27)dwdu+wu=γw.We recognize this as a Bernoulli-type equation, which can be solved to obtain(28)wu=−2γu3+k13u.Herek1 is a constant of integration that can be computed from the initial conditions as follows: since w1=u′τ=0=u0′, equation (28) leads to k1=3u0′2−2γ.To obtainuτ, we remember that u′=w. Thus,(29)∫1udu˜wu˜=∫0τdτ˜,and finally(30)τ=∫1u3u˜du˜2γu˜3+k1.The integral on the right side of equation (30) can be evaluated in closed form (which would involve hypergeometric functions) or numerically integrated.Alternatively, we could of course solve the original differential equation, equation (25), numerically by specifying the initial conditions u0,u′0. In either case, it is important to estimate realistic values of γ given by equation (26). Every constant therein is straightforward with the exception of b. To get a reasonable estimate of this constant, we can start with maximum charging rates for the Tesla Model 3 (SR+) of about 100 kW. It is likely that for this vehicle, the maximum regenerative power is software-limited to the somewhat lower threshold of around 75 kW. In our mathematical model, of course, the efficiency goes down linearly with power. Let us assume that we reduce η to η0/2 for 75 kW. This then implies a value of b=5∗10−6s/J, which yields γ=67.5 for η0=0.75 and vi=50 mph.Figure3(a) shows some typical numerical solutions obtained with Mathematica using the “NDSolve” command [15]. For the blue trace, we set γ to 40, and for the red trace, γ=70. The initial conditions were u0=1 for both, and u′0 was adjusted to obtain the same stopping time, τf=0.14 (defined by vτf=0). For the red trace, this implies u′0=−7.01, and for the blue, u′0=−5.65. It should be noted that we get indistinguishable curves by using equation (30) and inverting the resulting τu.Figure 3
Numerical solutions foruτ such that the stopping time is 0.14. (a) Blue curve shows γ=40, and red curve shows γ=70. For comparison, the black trace depicts the constant-power curve. (b) The same data plotted as an acceleration graph. All accelerations become extremely negative near τ=0.14, so we plot only to 0.13 to highlight to essential differences between the traces.
(a)(b)Also shown for comparison in Figure3(a) is the speed profile for a run where the extracted power is constant in time (black trace), with that constant adjusted to again yield the same stopping time. A straightforward calculation reveals that for constant power, vt=v02−κt.When comparing the red and black traces, it is evident that the optimal solution is one where initially, at high speeds, more power is extracted than for lower speeds. This makes sense, since the goal is to minimize losses from air drag, and drawing out more energy from the available kinetic energy during the initial phase is advantageous.Notice also that, according to equation (26), when the parameter γ is raised, b decreases, assuming the same EV is driven (identical m,D,η0) and the same starting speed, vi, is used. For smaller slope, b, governing ηP, the regenerative braking can be made more severe without incurring additional efficiency penalties. This explains the more negative overall acceleration seen in the red trace at the start, when compared with the blue trace.Finally, Figure3(b) plots the same data as an acceleration graph, u′ versus τ. As before, the γ=70 solution appears in red, γ=40 in blue, and the constant-power curve in black. For all curves, u′ diverges to negative infinity as u⟶0. However, it is also apparent that the optimal solutions for both values of γ feature more negative accelerations at the beginning and a less negative acceleration towards the end, compared to the constant-power curve. We again see that air-drag considerations nudge the optimal solutions in the direction of reducing speed at the beginning as much as possible.This feature of the optimal solution is also present when the vehicle does not come to a stop but reaches a non-zero final speed. Mathematically, we need only modify the endpoint condition tovT=vf. Figure 4(a) depicts the three solutions of the previous figure but now for a final (reduced) speed of uτf=0.5, with τf=0.1. In Figure 4(b), the same data are plotted as an acceleration graph that accentuates the differences and again showcases the strategy of making the acceleration as negative as possible at small times (red trace).Figure 4
Numerical solutions foruτ such that u0.1=0.5. (a) Blue curve shows γ=40, and red curve shows γ=70. For comparison, the black trace depicts the constant-power curve. (b) The same data plotted as acceleration versus time. The differences between the various solutions are visually accentuated.
(a)(b)These optimized acceleration curves in Figure4(b) can be compared to accelerometer data from a real test drive in a Tesla Model 3 where the speed was reduced from 50 mph to 25 mph. This measurement is shown in Figure 5. We see that both the magnitude of acceleration, u′, and the recovered power are not constant but largest at short times. In that respect, the result resembles the red curve of Figure 4(b).Figure 5
Accelerometer data from a test drive in a Tesla Model 3 (SR+) where the speed was reduced from 50 mph to 25 mph using full regenerative braking. We see that the acceleration is indeed largest initially when the speed is close to 50 mph.We conclude this section by circling back to the original question: how much energy is added or drawn from the battery after performing braking actions according to these optimized solutions?ΔEbatt is, in fact, given by the functional of equation (19). If this integral, when evaluated for the numerical solutions found earlier, is positive, the battery gains charge during the examined time interval. Casting this definite integral in terms of the non-dimensional variables, u and τ, we get that ηu,u′=η01+3/2γuu′, and(31)ΔEbatt=η0mvi2∫0τf1+32γuu′−uu′−u3dτ.We use the “NIntegrate” command in Mathematica to evaluate this integral for the traces in Figure3 (where τf=0.14). We thus obtain 0.315 mvi2 for the red trace and 0.293 mvi2 for the blue trace. Both integrals are therefore positive and less than η0Ti−Tf. Both solutions are also improvements over the constant-power curve; when compared to the red trace, it recovers roughly 2% less energy.Similarly, we can compare the optimal braking curves in Figure4 to the constant acceleration case considered earlier in Section 2, where the speed drops linearly with time. When we do this for the γ=70 curve (red trace), for instance, we find that the optimal solution recovers 0.226 mvi2, which is only about 0.1% more energy than constant-acceleration braking. In a sense, this observation retroactively validates the initial, more simplified approach.


### 3.3. Adding a Distance Constraint with a Lagrange Multiplier

We can ask a slightly modified question: what is the optimal braking curve,vt, that connects the two points, v0=vi and vT=vf, given that the car must cover a specified distance? Notice that we now have added another condition at the end. We would like to consider curves of equal displacement, d=∫0Tvdt. Variational calculus tells us that we now need to make the following integral stationary:(32)∫0TL+λvdt,where λ is called the Lagrange multiplier and is related to the displacement. The Euler–Lagrange equation now reads(33)ddt∂L∂v˙=∂L∂v+λ.Following similar steps as before, we thus arrive at the modified non-dimensional governing equation:(34)u2u″+uu′2−γu2−κλ=0,with κ=γ/3η0Dvi2 such that κλ is non-dimensional.Employing the same analytical technique of reducing equation (34) to a first-order equation yields(35)τ=∫1u3u˜du˜2γu˜3+6κλ+k,with k=3u0′2−2γ−6κλ.Figure6 shows the effect of the distance constraint. The three traces correspond to three different values of the Lagrange multiplier and thus braking distances, with γ set to 70. We know that d=∫vdt=m/D∫udτ. Therefore, to find the actual distance traveled, we numerically integrate the traces in Figure 6. Then, using the values in Section 2.3, we obtain d=307,295, and 282 m, respectively, for the red, black, and blue traces. Furthermore, T=ατf=α0.1=18.3s. The recovered energies for the red, black, and blue traces, respectively, are 0.2243 mvi2, 0.2260 mvi2, and 0.2245 mvi2. Not surprisingly, the optimal solution without displacement constraint (black trace) outperforms the other two solutions with the Lagrange multipliers.Figure 6
The optimal braking curves for three different values of the Lagrange multiplierκλ=λ∗. The black, red, and blue curves show the results for λ∗=0,19.2, and −19.2, respectively, and γ=70.


## 3.1. Charging Efficiency Considerations

From the previous discussion, and in particular from equation (15), it becomes clear that without any further consideration of the charging efficiency involved, the best strategy is to brake very severely to reach the desired target speed as quickly as possible and then to remain at that constant speed for the rest of the way. This was also embodied in our examined limit of very short tr. As we now show, a variational calculus formulation of that problem confirms this observation. In an initial attempt to shift into this framework, we seek to maximize the following functional:(16)S=∫0TLdt,where(17)L=Lv,v˙=−mvv˙−Dv3.The expression forL is derived from the combination of dT=−mvv˙dt and dWfric=Dv3dt (where T denotes the kinetic energy). The associated Euler–Lagrange equation,(18)ddt∂L∂v˙=∂L∂v,then quickly leads to the result that vt=0.If we think about it a bit, this result should not be unexpected. Since we have assumed that the regenerative efficiency,η, is entirely constant, it makes sense that the energetically best thing we could do is to immediately slow down to zero. If we have a constraint that we must travel a certain distance, i.e., that ∫0Tvtdt=d, the analysis can be modified by adding a Lagrange multiplier, but the end result is similar: it is best to immediately slow down to a small constant speed (consistent with the distance, d).It is clear that the culprit for this trivial answer is our assumption of constant efficiency. In reality, what EVs do when they need to slow down quickly is to blend in the physical brakes to assist the regenerative braking. The more severe the required deceleration is, the more heavily the EV relies on brake pads and rotors. This means that the efficiency of converting kinetic energy into battery energy goes down significantly as the braking action quickens. The battery can only accept so much power delivered to it, and this maximum power also depends sensitively on the battery SOC and temperature. Even before we reach that power limit, Ohmic losses tend to increase with charging power to reduce efficiency [11, 14], and friction braking is often blended in [4, 5, 10].How should we model these effects on efficiency? To start, it is clear that the efficiency is a monotonically decreasing function of the braking power that the battery ideally would be expected to “absorb.” This power, in turn, could be approximated by the reduction in kinetic energy of the vehicle,P≈−dT/dt=−mvv˙. Thus, we can write η=ηp=ηv,v˙. We will later choose a linearly decreasing function. Such choice of ηP, while not accounting for the full complexity, does capture the overall effect on efficiency heuristically and keeps the mathematics tractable.


## 3.2. Optimal Braking Curves without Distance Constraints

Informed by these considerations, we now seek to maximize the following functional:(19)S=∫0Tηv,v˙−mvv˙−Dv3dt.The function,ηv,v˙, should be close to η0 for low vv˙ and then decrease for larger vv˙.Let us next substitute this newL of equation (19) into the Euler–Lagrange equation, equation (18), and this returns a fairly complicated equation with several terms:(20)∂η∂v−ddt∂η∂v˙−mvv˙−Dv3=η3Dv2−η˙mv+∂η∂v˙−mvv¨−mv˙2−3Dv2v˙.It is interesting to note that the first part of equation (20) is in the form of an Euler–Lagrange equation involving η as the functional. We must now specify a functional form for η to proceed. To keep things mathematically tractable, let us choose the following functional form for η:(21)ηv,v˙=η0+bmvv˙.Here we have assumed that the efficiency drops linearly with power; the two parameters are they-intercept η0 and the slope, b. Note that b here is positive, since v˙ is negative. A side benefit of this choice for η is that it forces the left side of equation (20) to zero, yielding(22)∂η∂v˙mvv¨+mv˙2+3Dv2v˙+mvη˙−3ηDv2=0.From equation (21), ∂η/∂v˙=bmv and ∂η/∂v=bmv˙, and we get(23)mvη˙=mv∂η∂vv˙+∂η∂v˙v¨=bm2vv˙2+bm2v2v¨.Substituting equations (23) and (21) into equation (22) yields (after a few steps) the following differential equation:(24)2bm2v2v¨+2bm2vv˙2−3η0Dv2=0.Although not imperative, it can be helpful to non-dimensionalize equation (24). For this purpose, we introduce the non-dimensional quantities u and τ, defined as τ=t/α, with α=m/Dvi, and u=αD/mv=v/vi. Inserting these definitions into equation (24), we arrive at the governing equation:(25)u2u″+uu′2−γu2=0.Here the prime indicates differentiation with respect toτ, and(26)γ=3α3η0D22m3b=3η02Dbvi3.Equation (25) represents a second-order non-linear differential equation that we can reduce to a first-order one. Dividing by u2 and introducing w=u′, we can rewrite equation (25) in the following form:(27)dwdu+wu=γw.We recognize this as a Bernoulli-type equation, which can be solved to obtain(28)wu=−2γu3+k13u.Herek1 is a constant of integration that can be computed from the initial conditions as follows: since w1=u′τ=0=u0′, equation (28) leads to k1=3u0′2−2γ.To obtainuτ, we remember that u′=w. Thus,(29)∫1udu˜wu˜=∫0τdτ˜,and finally(30)τ=∫1u3u˜du˜2γu˜3+k1.The integral on the right side of equation (30) can be evaluated in closed form (which would involve hypergeometric functions) or numerically integrated.Alternatively, we could of course solve the original differential equation, equation (25), numerically by specifying the initial conditions u0,u′0. In either case, it is important to estimate realistic values of γ given by equation (26). Every constant therein is straightforward with the exception of b. To get a reasonable estimate of this constant, we can start with maximum charging rates for the Tesla Model 3 (SR+) of about 100 kW. It is likely that for this vehicle, the maximum regenerative power is software-limited to the somewhat lower threshold of around 75 kW. In our mathematical model, of course, the efficiency goes down linearly with power. Let us assume that we reduce η to η0/2 for 75 kW. This then implies a value of b=5∗10−6s/J, which yields γ=67.5 for η0=0.75 and vi=50 mph.Figure3(a) shows some typical numerical solutions obtained with Mathematica using the “NDSolve” command [15]. For the blue trace, we set γ to 40, and for the red trace, γ=70. The initial conditions were u0=1 for both, and u′0 was adjusted to obtain the same stopping time, τf=0.14 (defined by vτf=0). For the red trace, this implies u′0=−7.01, and for the blue, u′0=−5.65. It should be noted that we get indistinguishable curves by using equation (30) and inverting the resulting τu.Figure 3
Numerical solutions foruτ such that the stopping time is 0.14. (a) Blue curve shows γ=40, and red curve shows γ=70. For comparison, the black trace depicts the constant-power curve. (b) The same data plotted as an acceleration graph. All accelerations become extremely negative near τ=0.14, so we plot only to 0.13 to highlight to essential differences between the traces.
(a)(b)Also shown for comparison in Figure3(a) is the speed profile for a run where the extracted power is constant in time (black trace), with that constant adjusted to again yield the same stopping time. A straightforward calculation reveals that for constant power, vt=v02−κt.When comparing the red and black traces, it is evident that the optimal solution is one where initially, at high speeds, more power is extracted than for lower speeds. This makes sense, since the goal is to minimize losses from air drag, and drawing out more energy from the available kinetic energy during the initial phase is advantageous.Notice also that, according to equation (26), when the parameter γ is raised, b decreases, assuming the same EV is driven (identical m,D,η0) and the same starting speed, vi, is used. For smaller slope, b, governing ηP, the regenerative braking can be made more severe without incurring additional efficiency penalties. This explains the more negative overall acceleration seen in the red trace at the start, when compared with the blue trace.Finally, Figure3(b) plots the same data as an acceleration graph, u′ versus τ. As before, the γ=70 solution appears in red, γ=40 in blue, and the constant-power curve in black. For all curves, u′ diverges to negative infinity as u⟶0. However, it is also apparent that the optimal solutions for both values of γ feature more negative accelerations at the beginning and a less negative acceleration towards the end, compared to the constant-power curve. We again see that air-drag considerations nudge the optimal solutions in the direction of reducing speed at the beginning as much as possible.This feature of the optimal solution is also present when the vehicle does not come to a stop but reaches a non-zero final speed. Mathematically, we need only modify the endpoint condition tovT=vf. Figure 4(a) depicts the three solutions of the previous figure but now for a final (reduced) speed of uτf=0.5, with τf=0.1. In Figure 4(b), the same data are plotted as an acceleration graph that accentuates the differences and again showcases the strategy of making the acceleration as negative as possible at small times (red trace).Figure 4
Numerical solutions foruτ such that u0.1=0.5. (a) Blue curve shows γ=40, and red curve shows γ=70. For comparison, the black trace depicts the constant-power curve. (b) The same data plotted as acceleration versus time. The differences between the various solutions are visually accentuated.
(a)(b)These optimized acceleration curves in Figure4(b) can be compared to accelerometer data from a real test drive in a Tesla Model 3 where the speed was reduced from 50 mph to 25 mph. This measurement is shown in Figure 5. We see that both the magnitude of acceleration, u′, and the recovered power are not constant but largest at short times. In that respect, the result resembles the red curve of Figure 4(b).Figure 5
Accelerometer data from a test drive in a Tesla Model 3 (SR+) where the speed was reduced from 50 mph to 25 mph using full regenerative braking. We see that the acceleration is indeed largest initially when the speed is close to 50 mph.We conclude this section by circling back to the original question: how much energy is added or drawn from the battery after performing braking actions according to these optimized solutions?ΔEbatt is, in fact, given by the functional of equation (19). If this integral, when evaluated for the numerical solutions found earlier, is positive, the battery gains charge during the examined time interval. Casting this definite integral in terms of the non-dimensional variables, u and τ, we get that ηu,u′=η01+3/2γuu′, and(31)ΔEbatt=η0mvi2∫0τf1+32γuu′−uu′−u3dτ.We use the “NIntegrate” command in Mathematica to evaluate this integral for the traces in Figure3 (where τf=0.14). We thus obtain 0.315 mvi2 for the red trace and 0.293 mvi2 for the blue trace. Both integrals are therefore positive and less than η0Ti−Tf. Both solutions are also improvements over the constant-power curve; when compared to the red trace, it recovers roughly 2% less energy.Similarly, we can compare the optimal braking curves in Figure4 to the constant acceleration case considered earlier in Section 2, where the speed drops linearly with time. When we do this for the γ=70 curve (red trace), for instance, we find that the optimal solution recovers 0.226 mvi2, which is only about 0.1% more energy than constant-acceleration braking. In a sense, this observation retroactively validates the initial, more simplified approach.


## 3.3. Adding a Distance Constraint with a Lagrange Multiplier

We can ask a slightly modified question: what is the optimal braking curve,vt, that connects the two points, v0=vi and vT=vf, given that the car must cover a specified distance? Notice that we now have added another condition at the end. We would like to consider curves of equal displacement, d=∫0Tvdt. Variational calculus tells us that we now need to make the following integral stationary:(32)∫0TL+λvdt,where λ is called the Lagrange multiplier and is related to the displacement. The Euler–Lagrange equation now reads(33)ddt∂L∂v˙=∂L∂v+λ.Following similar steps as before, we thus arrive at the modified non-dimensional governing equation:(34)u2u″+uu′2−γu2−κλ=0,with κ=γ/3η0Dvi2 such that κλ is non-dimensional.Employing the same analytical technique of reducing equation (34) to a first-order equation yields(35)τ=∫1u3u˜du˜2γu˜3+6κλ+k,with k=3u0′2−2γ−6κλ.Figure6 shows the effect of the distance constraint. The three traces correspond to three different values of the Lagrange multiplier and thus braking distances, with γ set to 70. We know that d=∫vdt=m/D∫udτ. Therefore, to find the actual distance traveled, we numerically integrate the traces in Figure 6. Then, using the values in Section 2.3, we obtain d=307,295, and 282 m, respectively, for the red, black, and blue traces. Furthermore, T=ατf=α0.1=18.3s. The recovered energies for the red, black, and blue traces, respectively, are 0.2243 mvi2, 0.2260 mvi2, and 0.2245 mvi2. Not surprisingly, the optimal solution without displacement constraint (black trace) outperforms the other two solutions with the Lagrange multipliers.Figure 6
The optimal braking curves for three different values of the Lagrange multiplierκλ=λ∗. The black, red, and blue curves show the results for λ∗=0,19.2, and −19.2, respectively, and γ=70.


## 4. Conclusion

We started by comparing two braking strategies—coasting and regenerative braking—and found that it is advantageous to employ aggressive regenerative braking for cases where the ratio of initial to final speeds is above a derived threshold that depends sensitively on the efficiencies of the motor and generator. In this analysis, we chose a simplified assumption of a constant regenerative braking acceleration. We then refined the analysis using variational calculus to optimize the functional form of the braking curves. More specifically, we derived acceleration profiles,at, that maximize battery SOC, accounting for reduced battery-charging efficiencies with braking power. The optimal braking strategy was derived by finding both numerical and analytical (integral form) solutions to the associated Euler–Lagrange equation. Finally, we explored the effect of introducing the constraint of fixed displacement (distance traveled) via a Lagrange multiplier.Not unexpectedly, one lesson from the optimal braking curves obtained in this manner is that it pays to make the acceleration as negative as possible at the beginning, in an effort to reduce air-drag losses as much as possible (without cutting into charging efficiencies too severely). The derived solutions thus balance this inherent trade-off in a way that recovers the most energy. To keep the problem mathematically tractable, here we used a linear charging efficiency model, but this model could be refined in a straightforward way in future work, since the Euler–Lagrange equations were derived in fair generality and could be explicitly written for any efficiency model.



---

*Source: 8002130-2021-11-12.xml*