Algorithm EKF
Algorithm EKF
Algorithm EKF
R0
U_OC
i
Y
=
=
=
=
System
0.0224;
12.7;
-3.8;
Load (mydata);
parameters:
(considered as constant)
(could be variable)
(Charge current)
(output measurement data)
Initialization:
X0= [0.10 0.2 59 1000 0.005 10 0.0001]'
(1)
P0= [10 0 0 0 0 0 0
0 10 0 0 0 0 0
0 0 10 0 0 0 0
0 0 0 10 0 0 0
0 0 0 0 10 0 0
0 0 0 0 0 10 0
0 0 0 0 0 0 10]
P_Predected = P0 ;
P_estimated = P0 ;
The systems
A = [a11 0
0
0
a22 0
a31 0
a33
0
0
0
0
0
0
0
0
0
0
0
0
Matrices:
a14 a15 0
0
0
a26
a34 a35 a36
0
0
0
0
0
0
0
0
0
0
0
0
0
a27
a37
0
0
0
0]; (2)
C = [0
0];
(
(
)
)
j = 2
j = j + 1
False
2 j 600
True
=
=
=
=
Prediction
A* P_estimated *A';
(P_Predected*C')/(C*P_Predected *C');
A*X_estimated(:,j-1);
C* X_Predected(:,j)
Update
X_estimated(:,j)=X_Predected(:,j)+K(:,j)*(Y(j)-Y_predected);
(
(
)
)
Plote results
END
With:
(1)
x= [Upa Upc UL 1/Rpa 1/Cpa 1/Rpc 1/Cpa]T
(2)
a11=-X0(4)*X0(5);
a14=-X0(1)*X0(5);
a15=-X0(1)*X0(4)+i;
a22=-X0(6)*X0(7);
a26=-X0(2)*X0(7);
a27=-X0(2)*X0(6)+i;
a31=X0(4)*X0(5)-X0(6)*X0(7);
a33=-X0(6)*X0(7);
a34=X0(5)*X0(1);
a35=X0(4)*X0(1)-i;
a36=-X0(3)*X0(7)-X0(1)*X0(7)-R0*X0(7)*i+U_OC*X0(7);
a37=-X0(6)*X0(3)-X0(6)*X0(1)-R0*X0(6)*i-i+U_OC*X0(6);
(3)
a11= -X_Predected(4,j-1)* X_Predected(5,j-1);
a14= -X_Predected(1,j-1)* X_Predected(5,j-1);
a15= -X_Predected(1,j-1)* X_Predected(4,j-1)+i;
a22= -X_Predected(6,j-1)* X_Predected(7,j-1);
a26= -X_Predected(2,j-1)* X_Predected(7,j-1);
a27= -X_Predected(2,j-1)* X_Predected(6,j-1)+i;
a31= X_Predected (4,j-1)* X_Predected(5,j-1)X_Predected(6,j-1)*X_Predected(7,j-1);
a33=-X_Predected(6,j-1)* X_Predected(7,j-1);
a34= X_Predected(5,j-1)* X_Predected(1,j-1);
a35= X_Predected(4,j-1)* X_Predected(1,j-1)-i;
a36= -X_Predected(3,j-1)*X_Predected(7,j-1)X_Predected(1,j-1)*X_Predected(7,j-1)-R0*
X_Predected(7,j-1)*i+U_OC*X_Predected(7,j-1);
a37=- X_Predected(6)* X_Predected(3)- X_Predected(6)*
X_Predected(1)-R0*(6)*i-i+U_OC* X_Predected(6);
Identification by EKF :
Assume that:
)
(
The C matrix :