Last week, we looked at the basic HPPC method to compute future power limits. Remember, that this method seeks to compute power so that future terminal voltage stays within some design limits. And we also enhanced this basic method to allow us to place limits on future state of charge, and on load power, design limits, and electronics current design limits. But even this enhanced method has some really serious limitations. The first is that it uses a very primitive model of the battery cell in order to enforce the future voltage limits. So it's not able to give precise results when predicting the future voltage. It's either going to produce overly optimistic results or overly pessimistic results, and this could lead to a safety or battery health issue if the computer power limits are overly optimistic. In other words, the algorithm predicts that more power is available than truly is. And if I under predict how much power is available, then, it would lead to under utilizing the capabilities of the battery pack, and that's also not desirable. The second main problem with even the enhanced HPPC method is that it assumes that the cell always begins in an equilibrium condition, which is not true in the general case. Remember how we performed the HPPC test in the laboratory. We started with a cell that was resting at some initial state of charge, and then, it found pulse resistances in the charge and discharge directions. Well, if the cell had not been resting initially, those resistances would have different values, and that would cause us to compute different values of available power in order to meet future design voltage constraints. So the assumption that we begin every test in a rest condition is really not realistic, because actual cells in a dynamic load situation are not resting. So because of these two problems, the fact that we're using overly simplified sub model, and because our test assumption is that we are always in equilibrium before computing a power limit. People who use the HPPC method to produce power limits, usually take its result and don't trust it completely. They multiply the estimate by a factor between zero and one that de-rates, or reduces the amount of power that it predicts. So we're multiplying by some kind of a trust factor. So what this practitioners do is to compute the power limit estimate and the way that we talked about last week, and then, they multiply that by some factor less than one, maybe 0.9, or something like that. And this factor has to be found by extensive testing to see really how realistic the power limits are in reality. And it tends to make the worse case results okay if you compute the factor correctly, but the general case results tends to be conservative, and that leads to underutilizing the battery pack capabilities. This week, we're going to look at a different method. Instead of de-rating an HPPC estimate with some trust factor, we instead make a better power limit calculation to begin with. We're going to use better cell model, and we're also going to assume that the initial state, or the present state of the battery cell could be anything when we're computing the future power limits. And this is going to give us a better prediction. This week, we're first going to discard the simple cell model. We're going to allow using a very general cell model. So in general, we can assume some kind of a non-linear state space model that describes the dynamics of every cell in the battery pack. So in this equation, the variable, x, is the state of the cell, and the subscripts, n, indicates the particular number of an individual cell in the battery pack, and so if the battery pack contains 100 cells, then n can take on value between one and 100. The function, f, is the state equation of the battery model, and it describes how the state of every cell evolves over time due to the input, and the function, h, is the output equation, which describes how the voltage of a cell is a function of state and the input. So this is a pretty general form of a non-linear state-space model. And remember the enhanced self correcting battery model that you learned in the second course fits into this type of state space description, and it can be used with a method for competing power limits that you will learn about this week. But the method that I teach you this week is actually even more general than that. So if you had some other kind of a battery model, that could be used as well. When we are predicting over a future time horizon of delta t seconds, to simplify the problem, we assume that delta t seconds is an integer number of sample periods, and we call that integer number of sample periods k-delta-t. And then, we can use the model to predict the voltage delta t seconds in the future by replacing the present time in the model, k, with the time, k plus delta t. And this says that the future voltage is equal to the output equation evaluated using the future state and the future input. We're going to find the future state by simulating the state equation for k delta t samples, and the future input is going to be something that we are looking for in this level of input current. To simplify a lot of things, we will assume that this cell input current remains constant from the present time until the end of this future time horizon, and we simply call this input current new subscript, n. The method to compute a maximum absolute power that you will learn about is going to use a non linear surge to discover the value of input current that makes the future sa voltage exactly equal to either the minimal voltage on discharge, or the maximum limiting value on charge. So on discharge, we're looking for the value of input current that causes the voltage equation in the future to be equal to Vmin, and we can rearrange the voltage equation, instead, to look for a value of zero, if we say that zero is equal to the future voltage minus vmin. There are different kinds of nonlinear search that could be used to find a value of u that solves this nonlinear equation, and in fact, any of these nonlinear search algorithms could be used. The actual type of nonlinear search that I will share with you this week is called a bisection search algorithm, and you will learn about that in the next lesson. But the basic idea is simply that we will use the full cell model with the full output equation, and then, we will search for the value of input current that causes future voltage minus it's limiting value to be equal to 0. We do the same thing when we're looking for the maximum absolute charging current. We look for the value of input current that causes the future voltage predicted by the voltage equation to be equal to Vmax, or equivalently, we look for the value of input current that causes the future voltage minus Vmax to be equal to zero. We can also apply state of charge based limits, and maximum power based limits, and maximum current based limits, just like you learned how to do last week. So that aspect of the power limit calculation actually doesn't change this week. The only thing that we are changing this week is how we compute the limits based on future terminal voltages. So we're going to need to simulate a non linear state space model over some future time horizon to be able to compute, and a future value of the state to use that future value of state on the output equation to compute a future voltage. So we could do this using something like the octave code that you learned about in the second course, sim cell dot m, and you've seen this before, and this allows this to simulate really a very general input current over some time interval. But here, we can actually simplify that code quite a bit, because the state equation that we will use is going to be linear with constant A and B matrices. Now, we have to be careful. The enhanced self-correcting cell model does not generally have constant and B matrices. They depend on the level of input current. So as the input current changes, the A and B matrices change as well. But if I'm saying what is the constant current that I could use over the next time horizon, we're holding that current constant for that time horizon and that allows us to compute A and B matrices with that hypothesized level of input current. And so they will be constant A and B matrices under this condition. So when we're using such a cell model that has constant A and B matrices under some input condition, that allows us to simplify the cell simulation operation. It's a special case that I will share with you now. For this special case, we can come up with a close form equation for the future state. And this equation says that the future state is equal to the A matrix to the power of K delta T all multiplying the present state, plus A vector that multiplies the constant input. And the vector that multiplies the constant current input is computed by the term in the parenthesis in this equation. So it's equal to a summation of the A matrix raised to certain powers, all multiplying the B matrix from the steady equation. Most of this terms can actually be precomputed without knowledge of the input current in order to speed up the calculation of the future state for use in this bisectional algorithm that you will learn about. Once we use the bisection algorithm to compute a limiting value of electrical current, we can compute the overall pack power by summing up the individual cell powers. The power of any particular cell is equal to its current multiplied by its future voltage. So if there are Np cells in parallel, we multiply the cell power by Np, and then, we sum over the individual cells in series in the battery pack to get the overall pack power. In order to calculate the future voltage of this cell, we simply use the cell model, the voltage equation evaluated at the future state, and we compute that using the value of limiting input current. We perform the same kind of calculation when computing discharge power. We compute the power for a specified cell by multiplying the limiting current by the future voltage, and we multiply that by the number of cells in parallel, and then, we sum over all of the cells in series in the battery pack. And once again, the future voltage is computed using the voltage equation of the cell model, evaluated at the future state and using the computed value of cell current. To summarize this lesson, we've introduced this idea of improving the HPPC method using a full cell model that is initialized with the full present state estimate of this cell at the present point in time. You've learned that the principal idea for how we are going to do this. We're going to use a non linear search method to discover the value of charge current, or discharge current that causes the future model state, or the future model voltage to reach some pre-specified design limits. So really, all that remains to do is to learn how to perform a non linear search to find the value of input current that causes the cell to encounter any of these design limits. So in the next lesson, you will learn how to do this using a non linear search method that's called a bi section search.