In the previous lesson, I shared with you code that can be used to execute different simulation scenarios to gain intuition regarding how well the different total capacity estimation algorithms work. We look at the output of this code for a set of assumptions that I titled HEV scenario 1. And in this lesson, we're going to look at two more scenarios that I call HEV scenario 2 and 3. The second scenario was identical to the first in most respects. So you might want to review all of the parameter values that we used for that first simulation. The single difference is that this scenario initializes the recursive parameters using a known value for nominal capacity, whereas the first scenario instead initialized recursive parameters to zero. To be a little bit more realistic in this case though, I choose a nominal capacity that is different from the actual capacity of the battery cells. So that we can still see how well the algorithms adjust, if the nominal capacity is chosen to be a little different. So the true capacity is 10 Amp hour, but we choose the nominal capacity as 9.9 Amp hour in this simulation. Here's the code for setting up and running the simulation. The only difference between this code and what you saw in the previous lesson is that we defined the nominal capacity in the fifth line to be 9.9 ampere hours instead of zero. And of course, we also change the plot title that's used. All of the details of the run scenario.mscript are identical in every respect to the run scenario.m script that I shared with you in the previous lesson. And the xls algos.m function is identical as well. So I don't need to share those with you again. Here are the results that I found, when I'm simulating this second scenario. In this case, the total least squares and the approximate weighted total least squares methods give identical results for both their estimates and their error bounds. This is expected because the math for these methods turns out to be identical for the assumptions that we've made under this scenario. The WTLS method cannot be calculated recursively and so we cannot initialize its estimates and the results for the WTLS method are therefore exactly the same as they were for scenario one, no difference at all. But notice that the results for the TLS and AWTLS methods are somewhat better than they were for the first scenario because of this initialization that we could do. The results are especially better for early iterations right after initialization. And also notice that because of this initialization the error bounds are more narrow. Which means that there's more confidence in the estimates that these algorithms are producing. Once again, we see that the WLS method is inferior to all of the other methods. Initialization maybe helped improve some of its early estimates, but it still converges to a biased answer. And error bounds are once again unrealistically narrow. The true capacity is never inside of the WLS error bounds in this simulation. Again, you can use the code on the website to simulate some of this things. And zoom in yourself to notice that the error bounds of the WLS solution are so tight that you can't even see them at this scale, unless you zoom in. Of all of these results, I would judge that the TLS and the AWTLS methods are the best to use. Because they converge eventually to the same answer as the weighted TLS method. But their error bounds are tighter and their estimates are good for early iterations as well. Next, we look at the third and final HEV scenario that we consider. This scenario is identical to the one that we just looked at, but explores the ability of the algorithms to track a total capacity that is actually fading. And this example the true total capacity will be simulated to change by -0.001 ampere hours per measurement update. In order to better or track a moving total capacity. We change the forgetting factor gamma from 1 to a value of 0.99 for all of the methods that we look at here. Here is code to implement this scenario. The only change that I have made from the previous code segment is that the slope variable has been changed from 0 to -0.001. And of course, the plot title has also been changed. And here are some results from this simulation. Once again, the true total capacity is ploted as a black dashed line. In this case, it appears that the WLS method is giving us good results. But on closer examination, we can find that the error bounds are still unrealistically narrow, really too tight. And they almost never surround the true value of total capacity. All of the total least squares methods are able to track the moving value of total capacity quite well, and they all have realistic error bounds, in addition to that. In my judgment, I would say that the TLS and the AWTLS methods give us the best results. Because of their ability to be initialized with a reasonable initial value, and because that gives them narrower initial error bounds. In summary, you have now seen results for the three different HEV scenarios that we're going to look at. And every single one of these cases, the WLS method fails, primarily because it's error bounds are too tight. But also because often its final result is also biased away from the true value of total capacity. The weighted total least squares method always gets good results, but it cannot be initialized with the nominal capacity value which is the disadvantage. For all of the HEV scenario that I've shared with you, the TLS method and the AWTLS method results are exactly the same. Maybe they're numerically different because of round off error, but at least theoretically and visually, they are the same. For any of these scenarios, I would judge that the TLS or the AWTLS methods are the best to use. And that you should choose one of them for one of these HEV type scenarios. Since the TLS method is simpler to implement, that would be my choice for any of these cases here. However there are cases where the different assumptions made when deriving the TLS and the AWTLS methods lead to different results. And we're going to look at some of those when we look at the battery electric vehicle scenarios coming up next.