资源简介
一份基于simulink很实用的EKF估计soc程序,
代码片段和文件信息
% THIS PROGRAM IS FOR IMPLEMENTATION OF DISCRETE TIME PROCESS EXTENDED KALMAN FILTER
% FOR GAUSSIAN AND LINEAR STOCHASTIC DIFFERENCE EQUATION.
% By (R.C.R.C.R)SPLABSMPL.
% (17 JULY 2005).
% Help by Aarthi Nadarajan is acknowledged.
% (drawback of EKF is when nonlinearity is high we can extend the
% approximation taking additional terms in Taylor‘s series).
clc; close all; clear all;
Xint_v = [1; 0; 0; 0; 0];
wk = [1 0 0 0 0];
vk = [1 0 0 0 0];
for ii = 1:1:length(Xint_v)
Ap(ii) = Xint_v(ii)*2;
W(ii) = 0;
H(ii) = -sin(Xint_v(ii));
V(ii) = 0;
Wk(ii) = 0;
end
Uk = randn(1200);
Qu = cov(Uk);
Vk = randn(1200);
Qv = cov(Vk);
C = [1 0 0 0 0];
n = 100;
[YY XX] = EKLMNFTR1(ApXint_vUkQuVkQvCnWkWV);
for it = 1:1:length(XX)
MSE(it) = YY(it) - XX(it);
end
tt = 1:1:length(XX);
figure(1); subplot(211); plot(XX); title(‘ORIGINAL SIGNAL‘);
subplot(212); plot(YY); title(‘ESTIMATED SIGNAL‘);
figure(2); plot(ttXXttYY); title(‘Combined plot‘); legend(‘original‘‘estimated‘);
figure(3); plot(MSE.^2); title(‘Mean square error‘);
web -browser http://www.ilovematlab.cn/thread-3268-1-1.html
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-11-21 21:08 EKF\
文件 1207 2008-02-21 17:09 EKF\EKF1.m
文件 2088 2008-02-21 17:12 EKF\EKLMNFTR1.m
- 上一篇:卷积码的matlab仿真
- 下一篇:窄带高斯过程的matlab仿真源程序
评论
共有 条评论