Readme file for the SoC estimation of Li-S batteries 

Each estimator is located in a separate folder. To start the simulations run the startupEKF.m/ startupUKF.m/ startupPF.m file. 
Within each simulation the user has four current profiles with the corresponding measurements:

Pulse discharge test: [t20,I20]
NEDC  low currents: [T_nedc_BOP_3',I_nedc_BOP_3']
NEDC  middle currents: [T_nedc_BOP_15',I_nedc_BOP_15']
NEDC  high currents: [T_nedc_BOP_20',I_nedc_BOP_20']

To change between the different measurements the user has to do the following steps:
1.	Choose the right current profile (measurement).
2.	Change the signals for the voltage AND current input.
3.	Set the right capacity value in the reference Li-S cell model.
4.	Set the right simulation time according to the measurements (Since the sample time is 1 s, the length of the measurement vector can be taken directly.)
5.	Run the simulation. 

For the tests with a partially discharged battery start the simulation not at 0s. 
Choose a starting time according to the initial SoC you want to test.


The code that implements the estimators with simplified OCV curves "lives" in the MATLAB Function
blocks in the Simulink models.  For the estimation with the simplified OCV curve the code of the 
EKF, UKF or PF has to be changed.  Just uncomment the code for the simplified values:

EKF
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%test for one OCV polynomial 
%OCVall_dot = polyval(OCV_POLY_test_dot, xPre(2,:));

%%%%%%%%%%%%%%%%%%%%%%%%%%
% The one polynomial solution 
% OCVall = polyval(OCV_POLY_test, xPre(2,:));


UKF
%%%%%%%%%%%%%%%%%%%%%%%%%%
% OCVall = [0 0 0 0 0]
% for i = 1:5
% OCVall(:,i) = polyval(OCV_POLY_test, xPre(2, i))
% end

PF
%%%%%%%%%%%%%%%%%%%%%%%%%%
% %for just one polynomial
% OCVall = zeros(1,N)
% for i = 1:N
% OCVall(:,i) = polyval(OCV_POLY_test, xpartinew(2, i))
% end
