资源简介

粒子滤波用于剩余寿命预测的实例代码 MATLAB语言编写 附有详细代码说明

资源截图

代码片段和文件信息

%===== PROBLEM DEFINITION 1 (Required Parameters) =========================
WorkName=‘Battery‘;                    % work results are saved by WorkName
TimeUnit=‘weeks‘;                                          % time unit name
dt=5;                                          % time interval (five weeks)
measuData=[1.0000  0.9351  0.8512  0.9028  0.7754  0.7114  0.6830  ...
0.6147  0.5628  0.7090]‘;  % measured data at every time intervals (k1 x 1)
thres=0.3;                                     % threshold - critical value
ParamName=[‘x‘; ‘b‘; ‘s‘];         % model parameters‘ name to be estimated
initDisPar=[0.9 1.1; 0 0.05; 0.01 0.1];               
                    % probability parameters of initial distribution p x q
                 % (p: num. of unknown param q: num. of probability param)
n=5e3;                                                % number of particles
signiLevel=5;                        % significance level for C.I. and P.I.
%==========================================================================
% % % PROGNOSTICS using PARTICLE FILTER
p=size(ParamName1);
for j=1:p;                                          %% Initial Distribution
param(j:)=unifrnd(initDisPar(j1)initDisPar(j2)1n); 
ParamResul(j:)=[ParamName(j:) ‘Resul‘]; 
eval([ParamResul(j:) ‘=param(j:);‘]); 
end;                                                                       
k1=length(measuData); k=1;                   %% Update Process or Prognosis
if measuData(end)-measuData(1)<0; cofec=-1; else cofec =1; end
while min(eval([ParamResul(1:) ‘(k:)‘])*cofec)        % step1. prediction (prior)                                        
        paramPredi=param;                                                  
        for j=1:p

评论

共有 条评论