Online electric vehicle chargingwith discrete charging rates

Due to the increasing penetration of electric vehicles (EVs) in the distribution grid, coordinated control of their charging is required to maintain a proper grid operation. Many EV charging strategies assume that the EV can charge at any rate up to a maximum value. Furthermore, many strategies use detailed predictions of uncertain data such as uncontrollable loads as input. However, in practice, charging can often be done only at a few discrete charging rates and obtaining detailed predictions of the uncertain data is difficult. Therefore, this paper presents an online EV scheduling approach based on discrete charging rates that does not require detailed predictions of this uncertain data. Instead, the approach requires only a prediction of a single value that characterizes an optimal offline EV schedule. Simulation results show that this approach is robust against prediction errors in this characterizing value and that this value can be easily predicted. Moreover, the results indicate that incorporating practical limitations such as discrete charging rates and uncertainty in uncontrollable loads can be done in an efficient and effective way. © 2020 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).


Introduction
The penetration of electric vehicles (EVs) is rapidly increasing and coordination of the charging of these EVs is required in order to reduce the wear of grid assets and prevent blackouts [1]. One common control paradigm for EV charging is decentralized energy management (DEM). In DEM, devices individually schedule their energy consumption based on steering signals issued by a central controller. These steering signals in general have the aim to achieve a certain objective on, e.g., the neighborhood level. Examples of these objectives are minimization of (financial) energy costs and flattening out the aggregated power profile. For these objectives, possible steering signals are electricity prices (used in the context of demand response [2]) or desired energy profiles (see, e.g., [3]) respectively.
Many algorithms for scheduling the charging of an EV assume that the EV can charge at any rate up to a given maximum, i.e., that the charging rate is continuous. This is a convenient assumption since, as a consequence, the resulting scheduling problems often involve only continuous variables (see, e.g., [4]). Such problems can generally be solved efficiently using either tailored algorithms (see, e.g., [5]) or general optimization techniques and software (see, e.g., [6]). However, in practice, EVs can generally charge only at a finite number of charging rates due to technical limitations of the EV and/or the EV charging station (see, e.g., [7]). As a consequence, the resulting scheduling problems contain discrete decision variables and the aforementioned solution approaches can no longer be used anymore to solve these problems.
One way to deal with discrete charging rates is to initially treat the charging power as a continuous variable, solve the given EV scheduling problem with continuous charging power, and ''discretize'' this schedule, e.g., by rounding the continuous values to the discrete rates in some way. However, generally it is unclear how and when, given such a schedule, the resulting switching between charging rates should be done [8]. Moreover, extensive switching between charging rates significantly increases the degradation of the EV battery [9] and is thus not desirable. This indicates that alternative approaches must be considered to schedule EVs with discrete charging rates.
A significant amount of works in the literature focus on solution approaches for EV scheduling with discrete rates. Many of these works focus only on the case where an EV can charge at a single rate, i.e., the charging decision is binary (see, e.g., [10][11][12]). However, this focus is insufficient for the common situation where multiple charging rates are available, for example with several rates corresponding to slow and fast charging [7]. In contrast, only a few works focus on EV scheduling problems with more than one discrete charging rate. The authors in [13] present a dynamic programming algorithm to solve EV scheduling problems within deregulated energy markets. In [14], a so-called load profile following approach for EVs is proposed wherein the EV charging behavior is modeled via partial differential equations. Furthermore, [15] uses deep reinforcement learning to solve an EV pricing problem.
Next to the discrete nature of charging rates, a second important aspect of EV scheduling problems concerns the quality of an EV schedule. This quality is often evaluated by means of a cost function that depends on data such as electricity prices, uncontrollable power consumption (base load), or domestic power production from, e.g., solar panels. Many existing algorithms for EV scheduling predict this data on forehand and use the resulting cost functions as input for offline scheduling algorithms for charging the EV. Many of these algorithms are sensitive to small changes in this data, meaning that small prediction errors can lead to low-quality solutions. Since it is hard in practice to obtain accurate predictions of these data (see, e.g., [16][17][18]), there is a need for alternative solution approaches whose performance does not rely heavily on the quality of these predictions. In literature, many approaches exist in the literature for handling such data uncertainty in EV scheduling problems that do not explicitly predict the data itself. Typically used techniques include scenario-based optimization (see, e.g., [19]), robust optimization (see, e.g., [20]), stochastic programming (see, e.g,. [21]), and multi-agent systems (see, e.g., [22]). This paper presents a scheduling approach for EVs that appropriately addresses both issues discussed in the previous paragraphs. Moreover, it satisfies also another important objective: due to its relative simplicity, it is both accessible to non-experts and suitable for implementation within, e.g., existing software systems such as [23]. The proposed online scheduling approach for EVs with discrete charging rates does not require predictions of the cost functions. To derive this approach, first a specific formulation of the EV charging problem is considered that was first proposed in [5]. This paper shows that in this formulation, the optimal charging schedule can be uniquely characterized by a single value. Earlier work investigates similar characterizations for EV scheduling problems with the simplifying assumption that the charging rates are continuous [24][25][26]. The achieved characterization is used to derive an online scheduling approach that does not require any predictions of the data underlying the cost functions, but only the prediction of this characterizing value. In a simulation study, it is shown that this approach is robust against prediction errors in this characterizing value and that this value can be predicted quite well in practice.
The approach in this paper differs from the aforementioned works and techniques in the following way. With regard to addressing the discrete nature of the charging power, the approach in this paper handles arbitrary sets of discrete charging rates. This is in contrast to the mentioned works [13][14][15], where only three rates are possible that correspond to ''no charging'', ''positive charging'', and ''negative charging'', but where the corresponding charging levels are fixed. Moreover, all these works use mathematical techniques that are well-established but still require a significant amount of time and specialized knowledge to be correctly implemented. In contrast, to implement the approach presented in this paper, only a few lines of code and knowledge of basic calculus are needed. With regard to handling data uncertainty, the approach in this paper does not require any knowledge of these data in the form of, e.g., their support or an underlying probability distribution. In contrast, the aforementioned techniques [19][20][21][22] do require some kind of information on the data in order to compute online EV schedules. This induces additional computational overload and uncertainty into the process since this information often has to be estimated or predicted beforehand.
The remainder of this paper is organized as follows. In Section 2, the EV scheduling problem that is studied in this paper is formulated in detail and an optimal solution approach for this problem is described. Section 3 presents the characterization of optimal solutions to the considered scheduling problem and the developed online approach. Section 4 provides an evaluation of the approach and Section 5 contains conclusions and future research directions of the presented research. An overview of all the used variables and parameters in this paper is given in Table 1.

The EV scheduling problem
In this section, the EV scheduling problem that is studied in this paper is introduced (Section 2.1) and an optimal solution approach for this problem is described (Section 2.2).

Problem formulation
A finite scheduling horizon consisting of T time intervals T := {1, . . . , T } is given and the length of a time interval t ∈ T is denoted by ∆ t . For each t ∈ T , the variable x t denotes the average power the EV consumes during interval t and the vector x := (x t ) t∈T denotes the EV charging profile. Furthermore, the total required energy to be charged is known on forehand and denoted by C . Finally, for each interval t ∈ T , let Z t := {z 0 t , . . . , z Mt t } denote the set of available charging rates for interval t. Although in practice the available charging rates are often the same for each time interval, this paper considers this more general setting. The reason for this is that allowing different sets of charging rates for each interval does not complicate the problem and may be useful within a DEM framework. With each time interval t ∈ T , a convex cost function f t (x t ) is associated . Examples of common choices for these cost functions are f t (x t ) = a t x t (minimizing the financial cost of charging where a t is the electricity price) and f t (x t ) = (x t −d t ) 2 (following a desired target load d t as closely as possible).
This leads to the following, basic, optimization problem: For the remainder of this paper, it is assumed without loss of generality that ∆ t = 1 for all t ∈ T , i.e., that all time intervals have unit length.
If the EV can only be charged at one charging rate, i.e., if Z t = {0, Z } for each t ∈ T and some Z ∈ R + , then DiscreteEV can be solved easily by a greedy approach. More precisely, the intervals that are used for charging are those for which the difference f t (Z )−f t (0) is smallest. However, when the EV can choose between multiple charging rates, DiscreteEV is in general NP-hard, even when the sets Z t are the same for each time interval [5]. Therefore, a relaxation of DiscreteEV is considered that allows the EV to switch between charging rates within each interval. This means that now x t represents a convex combination of the charging rates during a time interval t instead of a single rate that is used during the entire interval. The cost for this combined charging in interval t is defined as the corresponding convex combination of the costs of using the individual charging rates within this interval. Since the aim is to minimize the cost and the function f t is convex, it is easy to see that only two consecutive charging rates should be considered in an optimal schedule as part of the combined charging rate x t [5]. More precisely, if z then only the charging rates z j−1 t and z j t are used for charging during this interval and x t is a convex Table 1 Overview of all used variables and indices in this paper.
Required amount of energy to be charged M t Number of available charging rates for time interval t Piece-wise linear convex cost function of the power x t with breakpoints in the set Z t s j t Slope of the piece between the breakpoints z j−1 t and z j t Optimal charging profile s * Optimal slope, i.e., slope of the active piece in x * t * Interval where the slope s * occurŝ s Prediction of the optimal slope s * Online solution to the EV charging problem RelaxEV C Set of charging requirements C that are considered in the evaluation Essentially, this means that a new cost function F t is obtained that is piecewise linear and that is obtained from f t by linearizing it on each of the intervals (z 0 are called the breakpoints of F t . Note, that the slope of the piece between the breakpoints z j−1 t and z j t is given by This implies that one can formulate a relaxation of DiscreteEV as follows: The remainder of this paper focuses on solving RelaxEV. In the next subsection an approach from [5] is sketched to optimally solve RelaxEV. In Section 3, an online approach for RelaxEV is derived.

An optimal greedy solution approach
This subsection describes a greedy solution approach given in [5] that solves RelaxEV to optimality. For this, first the following terminology is introduced . In any solution x ∈ R T to RelaxEV, the piece with slope s j t is said to be • completely used if z j t ≤ x t , i.e., if x t is larger than the right breakpoint of the piece corresponding to s j t . Fig. 1. An example of a piecewise linear function F t obtained from linearizing f t . For x t , the piece with slope s 1 t is completely used, the piece with slope s 2 t is used and active, and the piece with slope s 3 t is not used.
Also the term active piece is introduced, which plays a crucial role in the online approach in Section 3.

Definition 1.
In a solution x ∈ R T to RelaxEV, a piece with slope , if x t is in between the breakpoints z j−1 t and z j t .
In Fig. 1, the introduced terms are illustrated. The following lemma describes an important property of an optimal solution to RelaxEV : [5]). Let x * be an optimal solution to RelaxEV and suppose that the piece with slope s Lemma 1 implies that the used pieces are those with the lowest slope. Thus, roughly speaking, one can solve RelaxEV by a greedy approach wherein iteratively used pieces are included until the current solution satisfies the charging requirement constraint Algorithm 1 captures this greedy approach. For clarity, a block diagram of this algorithm is depicted in Fig. 2. During each iteration of the while-loop, the piece with the smallest slope that has not yet been used (Line 4) is selected , where ties are broken by selecting the slope with the highest time interval index. Subsequently, the charging rate of the corresponding time interval is increased to the next rate (Lines 5 and 6). Notice that in this selection process, for each interval only the slope with the lowest slope-index j that is not used needs to be considered . This is because, for each t ∈ T , one has s 1 t ≤ s 2 t ≤ · · · ≤ s Mt t due to the convexity of f t (as illustrated in Fig. 1). The piece selection process iterates until the charging rate of the selected interval cannot be fully increased to the next charging rate (this happens when in Line 5). In that case, the power on this interval is increased such that the charging requirement C is precisely met.
x t = x t + δ 7: if j < M t then 10: Insert s j+1 t into the ordered set S 11: end if 12: end while An important property of the optimal solution computed by Algorithm 1 is that x t ̸ ∈ Z t for at most one time interval t. This means that in the optimal solution, there is at most one interval wherein the EV switches between two charging rates. This follows directly from Algorithm 1 since in Line 5, one has δ = z j In that case, δ = C and thus C = 0 at the end of the current iteration, hence the whileloop terminates. Note that the piece that was selected in this last iteration is therefore the unique active piece in the optimal solution.
For more details on RelaxEV and Algorithm 1, the reader is referred to [27]. Note that for applying the algorithm, it is essential to know the slopes s j t for each time interval on forehand. However, in practical settings, this knowledge might nog be available, e.g., when the cost functions f t contain uncertain parameters such as future energy prices and base loads. Therefore, the next section presents an online approach for RelaxEV that can better deal with such uncertainties.

An online approach
This section presents an online algorithm for RelaxEV that does not require predictions of the uncertain cost functions f t at the start of the scheduling horizon. Instead, only at the start of each interval such a prediction or measurement is required. For this, first it is shown in Section 3.1 that the optimal solution to RelaxEV, as computed by Algorithm 1, can be characterized by a single value. Subsequently, in Section 3.2, this characterization is used to derive an online algorithm.

Characterization of an optimal solution
In this subsection, a characterization of the optimal solution to RelaxEV as computed by Algorithm 1 is derived. This characterization consists of a single value from which the optimal solution can be reconstructed relatively easily. In other words, if this value is known, one does not have to use Algorithm 1 to solve the problem but can use a much simpler procedure to calculate the optimal solution.
The single characterizing value mentioned in the previous paragraph is the slope of the (unique) active piece in the optimal solution. Recall that this active piece is the piece that was chosen last in Algorithm 1. This slope value is called the optimal slope and is denoted by s * . Moreover, the unique time interval where the optimal slope s * occurs is denoted by t * . Note that the relation between s * and t * is that s * = s j t * for some j ∈ {1, . . . , M t * }.
In the remainder of this subsection, it is shown that the optimal slope s * characterizes the optimal solution x * in the sense that one can easily construct x * when s * is known. Moreover, a simple procedure is given that computes an optimal solution x * given the optimal slope s * .
For this, it is observed first that all pieces with slopes smaller than s * are completely used and all pieces with slopes larger than s * are not used at all in the optimal solution x * . This follows from Lemma 1 and the fact that s * is an active slope. To gain some intuition for this observation, let s j t be an arbitrary slope other than s * that has been selected in Algorithm 1. Since this slope is not the optimal slope, at least one other slope is selected after s j t . Thus, after updating the value x t in Line 6 of Algorithm 1, the while-loop will be entered again. This can only happen if C > 0 after updating this value in Line 7. It follows that the original value of C , i.e., the value of C before the update in Line 7, is larger than the added value δ. By definition of δ in Line 5, this implies that δ = z j t −z j−1 t and thus the value x t has been updated in Line 6 from z j−1 t to z j t . Since no values of the solution x are decreased throughout the course of the algorithm, it follows that x * t ≥ z j t . Thus, by definition, the piece with slope s j t is completely used in x * . Via an analogous analysis, one can deduce that all pieces with slopes s j t that are larger than s * are not used in x * . Based on this characterization, one can obtain the following result for the optimal solution value x * t for t ̸ = t * , i.e., for all intervals that do not correspond to the optimal slope value s * . If for a given t ̸ = t * the value s * is strictly in between two slope values s j t and s j+1 t , then the piece with slope s j t is completely used and the piece with slope s j+1 t is not used. From the iterative structure of Algorithm 1 and the analysis in the previous paragraph, it follows that z j t ≤ x * t since the piece with slope s j t is completely used. However, it also follows that z j t ≥ x * t since the piece with slope s j+1 t is not used. This implies that x * t = z j t (see also Fig. 3).
In other words, for each j = 0, . . . , M t , one has that Thus, given s * , one can use (1) to directly compute x * t for all time intervals t ∈ T \{t * }. This can be done by iterating over the breakpoint/charging rate index j for each t ∈ T and finding that value of j for which s j t < s * < s j+1 t . What remains is to compute x * t * , i.e., the optimal solution value for the time interval t * . Recall that this is the interval where the  optimal slope s * occurs. This computation can be done directly based on the values for x * t for t ̸ = t * that were obtained as described in the previous paragraph using (1). More precisely, one can directly compute x * t * as Algorithm 2 summarizes this approach to compute an optimal solution to RelaxEV given s * . For clarity, a block diagram of this algorithm is depicted in Fig. 4 (1) to compute x * t if s * ̸ = s j ′ t for all 1 ≤ j ′ ≤ M t (Lines 9, 10).

Algorithm 2
Computing an optimal solution to RelaxEV given s * .
1: for t = 1, . . . , T do 2: if s * = s j t for some 1 ≤ j ≤ M t then 3: if t * has not been found yet then 4: t * := t 5: Find 0 ≤ j ≤ M t such that s j t < s * < s j+1 t 10: x * t := z j t 11: end if 12: end for 13: Note that for t ̸ = t * , one can compute x * t using only s * , F t (or, more precisely, the slopes s 1 t , . . . , s Mt t ), and Z t . In other words, given s * , one can compute x * t using only parameters from time interval t. This property is used in the next section to derive an online solution approach.

An online algorithm
In the previous subsection, a characterization of the optimal solution to RelaxEV was derived by means of the value s * . In this subsection, this characterization is used to obtain an online algorithm for RelaxEV that does not include predictions of the individual uncertain cost functions f t .
Suppose that one has a predictionŝ of s * . An approximate online solutionx := (x t ) t∈T to RelaxEV can be computed by usinĝ s as input for Algorithm 2. This means that the characterization rule in (1) is adjusted tô This approach has three advantages. First, one does not need to predict all cost functions f t already at the start of the first time interval. Instead, it is sufficient to have a prediction of the uncertain data underlying f t only at the start of interval t for all t ∈ T . This prediction can rely on measurements or data achieved at the start of interval t. As a consequence, one can use online data measurements to determine the charging rate for the next time interval based on the predictionŝ. This also means that the charging decision for interval t can be postponed to the very start of that interval. Second, in the online solution, switching between charging rates within a time interval occurs in at most one interval. This is in line with the structure of the offline optimal solution as shown by Lemma 1. Third, the approach is robust against unexpected behavior of the data underlying the cost functions. The reason for this is that for any set of cost functions F := {f 1 , . . . , f T }, the corresponding value of s * is in general not only the optimal slope for F , but also for many different setsF of cost functions that differ only slightly from F (e.g., they occur in a different order). As a consequence, a good predictionŝ of s * will still yield a good online solution whenever the realization of the data corresponds to a cost function set in F .
To ensure that this approach does not fail to compute a solution and that the resulting online solution is feasible, i.e., does not violate the charging requirement constraint, two adjustments have to be made to the characterization in (3). First, observe that this characterization does not account for the case where, for a given time interval t ∈ T ,ŝ is exactly equal to one of the slopes s 1 t , . . . , s Mt t (this would happen, for example, whenŝ = s * and t = t * ). To formally account for the corner case thatŝ equals one of the slopes, this corner case is included into the characterization rule as follows: This means that for the case thatŝ = s j t for some 0 ≤ j ≤ M t , the online solutionx t is chosen to be z j t . However, the probability thatŝ is exactly equal to one of the slopes s j t is negligible in practice. Thus, it is expected thatŝ will always be in between two slopes and that, as a consequence, this modification of (3) has no significant effect on the quality of the resulting online solutions.
Second, compared to the offline approach and Algorithm 2, the characterization in (3) does not guarantee that the resulting online solution sums up to the charging requirement C . To account for this, after determining an initial candidate value X for the online decisionx t using (3), it must be checked if a feasible solution can still be realized ifx t is actually set to this value. Hereby, three situations can occur: This means that the EV charges at a rate such that the charging requirement is fully met at the end of time interval t.
< C , then the charging requirement cannot be reached when settingx t = X , even when the EV charges at the maximum rates in all future intervals t + 1, . . . , T . Thus, to ensure that an online charging profile that satisfies the requirement constraint can be computed, in this casex t is chosen asx t : . This means that the EV charges at the maximum rate z Mt t to ensure that the charging requirement can still be reached, unless the amount that still needs to be charged is less than z Mt t , in which case a charging rate is chosen such that the charging requirement is fully met at the end of time interval t.
• In all other cases, i.e., if C − ensures that there exists values for the future online decisionsx t+1 , . . . ,x T such that the overall online solutionx does not violate the charging requirement constraint. Thus, in these cases,x t is chosen asx t = X . Algorithm 3 captures the presented online approach. For improved clarity, a block diagram of this algorithm is depicted in Fig. 5. In Algorithm 3, C represents the charging requirement for the remaining time intervals, i.e., for intervals t to T , and is reduced over the course of the algorithm. In Lines 1 and 2, the desired charging rate is determined according to the characterization in (4). Moreover, Algorithm 3 contains two procedures to ensure that the charging requirement constraint is not violated. First, Line 3 ensures that no more than the remaining charging requirement C is being charged. Second, Lines 4-6 enforce that the EV is charging at the maximum charging rate when this is needed to still meet the charging requirement.
In the next section, the robustness of Algorithm 3 against prediction errors in s * is evaluated by means of simulations.

Evaluation
In this section, the performance of the online approach presented in the previous section is evaluated by means of a simulation study. In Section 4.1, the used problem instances and parameter choices are described. The evaluation consists of two parts. First, in Section 4.2, the robustness of the approach against Algorithm 3 Computing the online solution for time interval t given the predictionŝ.  prediction errors in the characterizing value s * is studied. Second, in Section 4.3, it is investigated how well s * can be predicted using historical data.

Problem instances and parameter choices
The online approach is applied to schedule the charging of an EV belonging to a household in southern Germany. It is assumed that the EV is charged between 18:00 h and 7:00 h and that this charging window is divided into 15-minute time intervals, meaning that T = 52 and ∆ t = 1 4 . Usually, residential charging is done at either ''Level 1'' (1.9 kW) or ''Level 2'' (4 kW) [7]. It is assumed that the EV can switch between these charging rates and no charging at all. This means that the charging rate sets Z t are chosen as Z t = {0, 1900, 4000} for each time interval t ∈ T .
To study the effect of the charging requirement on the approach, values of C are considered that represent charging requirements of 5, 10, . . . , 45, 50 kWh. These values of C are denoted by the set C := {5, 10, . . . , 45, 50}. Finally, the considered objective is to flatten the combined power demand of the EV and the household. In future smart grids, this will be an important objective as it allows both a higher penetration of local renewable energy generation (e.g., by solar panels) and upcoming larger energy demands resulting from, e.g., EV charging and heating systems such as heat pumps. To model this objective, the cost functions are chosen as f t (x t ) = (p t + x t ) 2 , where p t denotes the base load of the household during interval t ∈ T . As input for this base load, we use real measurements of this base load that have been obtained within the SmartOperator project [28].
An overview of the used values for the input parameters is given in Table 2.

Robustness of Algorithm 3
To study the robustness of Algorithm 3, the approach is applied to a single charging session for different input predictionŝ s for s * . Fig. 6 shows the used base load profile for the corresponding charging window. The quality of each online solution x is compared to that of the optimal solution x * . As a measure for p Household measurement data obtained in the SmartOperator project [28] this, the ratio R(x) between their objective values is used, i.e., .
An online solutionx can be considered a good approximation of x * if R(x) is close to 1 (if R(x) = 1, thenx is optimal), and an algorithm is considered robust if a large change in the input predictionŝ leads to only a small change in the ratio R(x). To compute these ratios, Algorithm 1 is used to compute the offline optimal solutions and Algorithm 3 is used to compute the online solutions. Fig. 7 shows the results of the simulations. More precisely, Fig. 7 shows for each of the charging requirements in the set C the ratio R(x) for different input predictionsŝ (lines) and the corresponding optimal s * (dots). For C ∈ {5, 10, 15}, R(x) increases significantly whenŝ is slightly smaller than s * , whereas it barely increases whenŝ is slightly larger than s * . On the other hand, for C ∈ {20, . . . , 50}, this effect is reversed: whenŝ is slightly smaller than s * , R(x) barely increases, whereas it increases greatly whenŝ is slightly larger than s * . A possible explanation for this is that s * is relatively high for charging requirements of 20 kWh and higher. More precisely, s * is close to the slope values of the intervals before 21:00 h, i.e., the intervals with a relatively high base load. As a consequence, whenŝ is slightly larger than s * , more of these ''expensive'' intervals will be used for charging in the online solution. On the other hand, for charging requirements of 15 kWh and lower, s * is relatively low and close to the slopes of the intervals after 21:00 h, i.e., the intervals with a relatively low base load. Thus, whenŝ is slightly larger than s * , only these ''cheap'' intervals will be used for charging in the online solution.
Nevertheless, in almost all cases, Fig. 7 shows that there is a wide range of values ofŝ for which R(x) is very small. This suggests that, although s * lies at the boundary of this range, a larger deviation ofŝ from s * can still yield a good online solution. The main explanation for this behavior lies in the piecewise nature of the decision rule in the online Algorithm 3. More precisely, in Line 1 of Algorithm 3, for a given t ∈ T , any value of the predictionŝ that lies in between s j t and s j+1 t yields the same online decisionx t . This behavior originates from the stepwise relation between the optimal slope s * and the optimal decision x * t as depicted in Fig. 3, which in turn is a consequence of the fact that the piecewise linear function F t is not continuously differentiable. It is remarkable that the latter fact seems to improve the robustness of the online algorithm, since dropping the assumption of continuously differentiability often increases the difficulty of solving optimization problems (see, e.g., [29]).

Predictability of s *
Earlier work [30] shows that characterizing values for EV schedules with continuous charging rates tend to be similar over consecutive days when the uncertainty of the cost functions is due to unknown future base loads. In this subsection, it is investigated whether this is also the case for s * , i.e., whether it is possible to predict s * based on historical values of s * for (fictional) past charging sessions. For this, 100 charging sessions on consecutive days are simulated for each charging requirement in C. For each session the corresponding s * is computed using Algorithm 1. As input for these simulations, actual base load data of the household for 100 consecutive days is used. Fig. 8 shows that for most of the charging requirements, the values of s * corresponding to the same charging requirement are very close together, which implies that these historical values of s * accurately represent the behavior of s * for future days.
However, for C ∈ {20, 45, 50}, the difference between these values is significantly larger. For C = 20, this is because the share of charging on ''expensive'' intervals, i.e., the intervals corresponding to the evening demand peak, varies more over the course of the days since almost all intervals after this peak are used for charging. For C ∈ {45, 50}, the reason for the large variance is that the share of expensive intervals is relatively large since the load of these intervals varies more than the base load during the cheap intervals, i.e., the base load during the night. does not lead to an online solution that differs much from the optimal offline solution. However, whenever the optimal slope s * is already close to one of the boundary slopes s j t * or s j+1 t * , it is likely that the predictionŝ falls outside of the interval [s j t * , s j+1 t * ] and thus yields an online solution that is significantly different from the optimal solution. This is also illustrated by Fig. 3. Overall, these simulation results indicate that the predictability of s * depends partly on the charging requirement C and on the underlying uncertain data, in this case the base load profile p. However, for most of the studied values of C the predictability is relatively large: the observed historical values lie within a relatively small range. Together with the observed ratios from the robustness study in Section 4.2, these are promising results and indicate that the online approach has a good potential for computing good online solutions in practice e.g., within an existing EV charging infrastructure.

Conclusion
This paper presented an online approach for electric vehicle (EV) scheduling with discrete charging rates that does not require predictions of uncertain power consumption and production. Instead, this approach requires only the prediction of a single value that characterizes the optimal solution to a relaxation of the original EV scheduling problem at the start of the planning. Simulation results indicated that this approach is robust against prediction errors in this characterizing value and that this value can be predicted accurately using historical data. Thereby, the findings of this paper suggest that incorporating important practical limitations of EV charging can be done with high accuracy and is relatively easy.
To conclude this paper, two limitations of this study and resulting interesting directions for future research are discussed. First, this paper focused on the scheduling of a single EV. When considering an energy system that includes multiple EVs such as a neighborhood or a parking lot, the approach of this paper could be applied to each EV individually. However, in these situations, often it is also desired that the aggregated charging of the EVs is optimized, i.e., not only that of each EV individually. The approach developed in this paper cannot be applied directly to this situation and thus one interesting direction for future research is to extend the developed approach to this setting. Second, this paper focused on EVs and not on other common devices within residential distribution grids, such as storage systems and heat pumps. These devices also play an important role to maintain a proper operation of the residential distribution grid and therefore it is desirable that also their energy consumption is optimized. Thus, a second interesting direction for future research is to extend the developed online approach to such devices.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.