A computer-implemented method of diagnosing one or more SoXs, such as State-of-Charge (SoC), State-of-Health (SoH), State-of-Energy (SoE), State-of-Power (SoP), State-of-Function (SoF) and State-of-Safety (SoS), of at least one battery, comprises a SoX diagnostics loop, which includes a given battery model, and a model update loop, which is configured to update the battery model, the method comprising: