## 2 Literature Review and Methodology
### Modern Estimation Methods  
The Kalman filter (KF) is an estimation algorithm that observes state variables that are not directly measurable. It uses a state transition model and measurement data to estimate the system state (\(x_{k}\)) and its uncertainty (\(P_{k}\)). By combining past observations with current sensor data, the KF produces a more accurate state estimate, filtering out noise. As a recursive filter, the KF repeatedly refines its estimates using previous states and input-output data, making it effective for systems with linear dynamics [7]. Figure 2 illustrates how the extension KF (EKF) estimates the system state (\(x_{k}\)) in four stages: initialisation, prediction, measurement, and update. In the initialisation stage, the previous state (\(x_{k-1|k-1}\)) and uncertainty (\(P_{k-1|k-1}\)) are established. The system's dynamics are defined using state-space equations, incorporating parameters like SOC and internal resistance (R0). As the EKF progresses, it updates the system state and increments the time step (k) for tracking the current estimate [17]. Figure 2: EKF Method Block Diagram. The EKF operates in two main stages: prediction and update. In the prediction stage, the initial battery state and system input-output are used to predict the system state (\(x_{k|k-1}\)) and uncertainty (\(P_{k-1|k-1}\)). Since the models are non-linear, the Jacobian matrix (F) is computed for linearisation. The process also accounts for process noise (Q) and observed noise covariance (R) to enhance accuracy [18]. To minimise power consumption, the Kalman filters are configured to run intermittently based on predefined triggers, such as significant changes in battery parameters, rather than continuously. Additionally, the algorithms have been computationally optimised using efficient operations to reduce the processing burden on the BMS hardware. In addition, to address concerns about potential delays in real-time performance, the Kalman filters are implemented with computational optimisations to ensure minimal latency (in the range of milliseconds). Buffer mechanisms and threshold-based triggers are incorporated to prioritise critical actions, ensuring immediate responses when necessary. In the update stage, the predicted state and covariance are adjusted using Kalman gain and sensor measurements (\(z_{k}\)) to improve accuracy. Kalman gain determines the balance between the model prediction and measurement data, with a higher gain favouring measurements. The final step extracts key elements, like SOC and R0, from the updated state (\(x_{k|k-1}\)), which are then used to calculate the SOH [8]. The EKF method Simulink model consists of using input battery parameters, like cell voltage, current, temperature, initial SOC, and initial R0. It uses a Jacobian matrix for linearisation, which is a matrix of all the first-order partial derivatives of a multivariate function or vector-valued function, to demonstrate the transformation of coordinates. It represents the linear transformation of a non-linear function by zooming into a specific point of the non-linear function and by looking at the linear relationship of the non-linear function. The Jacobian matrix (F) defines the state transition model matrix, and the Jacobian matrix (H) defines the observation transition model matrix of the EKF method which are linearised using Jacobians. After linearisation, it predicts the system state and error covariance, then it updates and corrects the estimated system state and it outputs the estimated system state from which the SOC and R0 levels are extracted as the estimated output battery parameters. The Simulink model of the UKF method is an alternative to EKF that can also be used to calculate the SOC. The UKF has the same objectives and system model as the EKF method, such as a prediction step and an update step, but the only difference is the method used for approaching the non-linear system which, for linearisation, uses sigma points.