• No results found

Markov Chain Modelling of Duty Cycle

4.4 Probability Matrix Generation

4.4.1 Discretizing the Data

There are a number of potential methods for discretizing data for generation of the Markov chain probability matrix. The simplest method is to round the input data to the nearest state. This is the quickest method and generates satisfactory results; however, it does in-volve the loss of some information. An alternative method is to interpolate the input data between each state and applying a weighting to the states either side of the input data. For example, whereas 2.5ms−1would round to 3ms−1, the interpolation method would apply a

weighting of 0.5 to both 2ms−1and 3ms−1. As a result, more information contained within the input data is retained and the resulting probability matrix should be more accurate.

This method is more computationally intensive however. A third alternative is to assume a probability distribution function for the subsequent acceleration. This gives a continu-ous function allowing for the generation of more states given a limited dataset and may be more accurate in some cases. However, this method requires the accurate prediction of the correct probability distribution for the problem, and still requires sufficient data in order to fit this distribution accurately. A comparison of the methods is shown in Figures 4.10 and 4.11.

Figure 4.10: Discretization at Initial Speed = 5ms−1 and Initial Acceleration = 0ms−2 In the mail room data, there are a large number of sample points available at an initial speed of 5ms−1and initial acceleration of 0ms−2and therefore all methods should perform well. It can be seen in Figure 4.10, that the data show a symmetrical distribution of accelera-tions around a modal value of approximately 0ms−2. The result of the rounding method has the greatest standard deviation, with only 60% of the subsequent accelerations being equal to 0ms−2. It also shows a higher number of accelerations at -2ms−2 and 2ms−2 compared

to the other two methods. The accuracy of the interpolation method should in theory be higher. This is because no information is lost due to the rounding of the data. The fitted Gaussian distribution for this dataset has a mean of -0.02 and a standard deviation of 0.42.

This gives a distribution of subsequent accelerations where almost 80% are equal to 0ms−2. Because of the quantity of data available, the difference to the interpolated method suggests that the Gaussian distribution is not ideal for the fit because otherwise there would be a close correlation between the two.

Considering real-world driving scenarios, this is likely to be true. Under most circum-stances, there are a number of discrete decisions that the driver could make. For example, consider a vehicle travelling at a constant speed. The driver may make one of three pos-sible actions; accelerate up to a higher speed, maintain the same speed, or decelerate to a lower speed. Each of these decisions would result in different discrete value of subsequent acceleration, and may each have their own distribution due to continuous variables such as the gradient of the road and the weight of the vehicle. There may even be more than three actions; acceleration due to an increase in speed limit may be quite gentle, but an acceleration due to an overtaking manoeuvre could be much more aggressive.

An alternative dataset is shown in Figure 4.11. In this situation the vehicle is deceler-ating from a relatively high initial speed. It can be seen that the rounding method shows a very different distribution in this situation compared to the interpolation method and Gaussian methods. This is because many of the values round to either 0ms−2 or -2ms−2, even though the weighted values give a much higher probability of a continuation of the -1ms−2deceleration. This shows that the loss of information inherent in rounding the data can have a significant effect on the outcome of the algorithm. It can also be seen that there is a much better correlation between the interpolation method and the Gaussian prediction.

This correlates with the previous suggestion because when the vehicle is decelerating, the discrete set of control actions is reduced. In this situation, it is unlikely for the driver to accelerate, leaving only the continuation of the deceleration, or cessation to maintain con-stant speed. The fact that the rounded values show a lower chance of a -1ms−2deceleration may also confirm this theory.

A final consideration for the Gaussian distribution method is that the distribution prob-ability reduces exponentially at the extremes, but does not reach zero, unlike the rounding and interpolation methods. This is of importance due to how the SDP optimisation accounts for constraints. The SDP cost function applies a very large penalty at the limits of the bat-tery voltage in order to ensure that the optimised result does not exceed them. If there is even a very small probability that these limits will be reached, then this could significantly affect the optimised results.

-3 -2 -1 0 1 2 3

Figure 4.11: Discretization at Initial Speed = 12ms−1and Initial Acceleration = -1ms−2

4.4.2 Results

Once the data has been discretized, the algorithm loops through each possible state and cal-culates the probability of each subsequent acceleration using one of the algorithms above.

A sample of the transitional probability matrix is shown in Figure 4.12. Each column of the grid shown should always sum to 100%. It can be seen that, in general, at 5ms−1the vehicle is most likely to continue on its previous trajectory. If the previous acceleration was 0ms−2, it is most likely to continue to be 0ms−2. Gentle acceleration and all deceleration follow this trend, however high acceleration shows a tendency to begin to reduce. If the previous acceleration was 2ms−2, it is most likely to continue at 1ms−2 for example.

-3

Markov Chain Probabilities @ 5ms-1

0

Figure 4.12: State Transition Probability Matrix - Loughborough Mail Room Cycle (5ms−1) There are states where there was no data available. This is because the vehicle did not enter the state at any point in the logged data. This does not pose a problem for the rounding method because if the state was not entered in the data, then the transitional probability of transitioning to it will be zero. As a result, it will not affect the optimisation in any way.

For the interpolation and Gaussian discretization methods, however, this can cause issues.

It may be possible for the transitional probability of entering a state that was not reached in the data to be greater than zero, although it will most likely be a very small probability. For the Gaussian distribution model, this is due to the fact that the probability reduces away from the mean value, but never reaches 0. For the interpolation method, this could occur under certain circumstances, such as a previous speed of 2.4ms−1 and an acceleration of 1.3ms−2. In this situation, there is a potential initial speed of either 2ms−1 or 3ms−1, and a potential acceleration of either 1ms−2or 2ms−2. Therefore, for an initial speed of 3ms−1, there will be a small probability of acceleration of 2ms−2(up to 5ms−1) even if 5ms−1was never reached in the data. Modifying the algorithm to be based around the subsequent speed rather than acceleration is possible; however, this results in a similar issue with the subsequent acceleration.

This situation can pose a significant problem for EMS optimisation when using the interpolation or Gaussian methods. If there is a probability of transitioning into a state where no data is available, then the probability of transitioning out of this subsequent state will be undefined. This means that it is not possible to continue the stochastic model after this point and the optimisation will fail. Therefore, it is necessary to estimate what will happen in this situation.

Markov Chain Probabilities @ 12ms-1

0

Speed (m/s): 12 Reset View

Figure 4.13: State Transition Probability Matrix - Loughborough Mail Room Cycle (12ms−1) In order to alleviate this problem, the transitional probabilities for states which were not reached can be extrapolated from the data available. It has been found that the most effective method is to interpolate the data where possible and use result of the nearest available previous acceleration when extrapolation is required. This results in an overall transitional probability as seen in Figure 4.13. In this case, there was no data available for an initial speed of 12ms−1 and an initial acceleration of 3ms−2. Therefore, the transitional probabilities for an acceleration of 2ms−2 have been used. It can be seen that the tendency is for the subsequent acceleration to reduce to 1ms−2, effectively moving the state of the vehicle away from its limits and therefore reducing the effect of the problem.

Estimating the likely response of the vehicle in undefined states also helps to improve the robustness of the controller. In an ideal situation, the logged data used to generate the Markov model will perfectly define the likely response of the vehicle from every possible initial state. However, in reality, this is very difficult to achieve and would require several hundreds, if not thousands of hours of logged data. As more data are obtained, the likeli-hood of this occurring becomes smaller; however, there is always a small possibility that the vehicle could enter a state which was not encountered during testing. Given a reasonable estimation the likely response of the vehicle, the resultant strategy should make a sensible decision.