亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dd1.m

?? 卡爾曼濾波
?? M
字號:
function [xhat_data,Smat]=dd1(kalmfilex,kalmfiley,xbar,P0,q,r,u,y,timeidx,optpar)
% DD1
%   This function performs a DD1-filtering; a state estimation for nonlinear 
%   systems that is based on first-order polynomial approximations of the 
%   nonlinear mappings. The approximations are derived by using a 
%   multidimensional extension of Stirling's interpolation formula. 
%   The model of the nonlinear system must be specified in the form:
%               x(k+1) = f[x(k),u(k),v(k)]
%               y(k)   = g[x(k),w(k)]
%   where 'x' is the state vector, 'u' is a possible input, and 'v' and 'w'
%   are (white) noise sources.
%
% Call
%   [xhat,Smat]=dd1(xfile,yfile,x0,P0,q,r,u,y,timeidx,optpar) 
%
% Input
%   xfile   - File containing the state equations.
%   yfile   - File containing the output equations.
%   x0      - Initial state vector.
%   P0      - Initial covariance matrix (symmetric, nonnegative definite).
%   q,r     - Covariance matrices for v and w, respectively.
%   u       - Input signal. Dimension is [samples x inputs].
%             Use [] if there are no inputs.
%   y       - Output signal. Dimension is [observations x outputs].
%   timeidx - Vector containing time stamps (in samples) for the 
%             observations in y.
%   optpar  - Data structure containing optional parameters:
%             .A:     State transition matrix.
%             .C:     Output sensitivity matrix.
%             .F:     Process noise coupling matrix.
%             .G:     Measurement noise coupling matrix.
%             .init : Initial parameters for 'xfile', 'yfile'
%                     (use an arbitrary format).
%
% Output
%   xhat    - State estimates. Dimension is [samples+1 x states].
%   Smat    - Matrix where each row contains elements of (the upper triangular
%             part of) the Cholesky factor of the covariance matrix. The 
%             dimension is [samples+1 x 0.5*states*(states+1)]. The individual
%             covariance matrices can later be extracted with SMAT2COV.
%
%  The user must provide the two m-functions 'xfile' and 'yfile' containing
%  the state update and the output equation. The function containing the
%  state update should take three arguments:
%       function x=my_xfile(x,u,v)
%
%  while the function containing the output equation should take two
%  arguments:
%       function y=my_yfile(x,w)
%
%  In both cases, an initialization of constant parameters can be 
%  made using the parameter 'optpar.init'. This parameter is passed through
%  x if the functions are called with only one parameter.
%
%  Literature:
%     M. Norgaard, N.K. Poulsen, O. Ravn: "New Developments in State
%     Estimation for Nonlinear Systems", Automatica, (36:11), Nov. 2000,
%     pp. 1627-1638.
%
% Written by: Magnus Norgaard
% LastEditDate: Nov. 6, 2001 

% >>>>>>>>>>>>>>>>>>>>>>>>>>> INITIALIZATIONS <<<<<<<<<<<<<<<<<<<<<<<<<<
h2    = 3;                 % Squared divided difference step
h     = sqrt(h2);          % Divided difference step
scal1 = 0.5/h;             % Scaling factor
if isempty(u),             % No inputs
  nu = 0; samples = timeidx(end); uk1 = [];
else
  [samples,nu] = size(u);  % # of samples and inputs
end
nx           = size(P0,1); % # of states
if isempty(xbar),          % Set to x0=0 if not specified 
  xbar = zeros(nx,1);
elseif length(xbar)~=nx,
  error('Dimension mismatch between x0 and P0');
end
ny    = size(y,2);         % # of outputs
nv    = size(q,1);         % # of process noise sources
nw    = size(r,1);         % # of measurement noise sources
[v,d] = eig(P0);           % Square root of initial state covariance
Sxbar = triag(real(v*sqrt(d)));
[v,d] = eig(q);            % Square root of process noise covariance
Sv    = real(v*sqrt(d));
hSv   = h*Sv;
[v,d] = eig(r);            % Square root of measurement noise cov.
Sw    = real(v*sqrt(d));
hSw   = h*Sw;
SxxSxv = zeros(nx,nx+nv);  % Allocate compund matrix consisting of Sxx and Syv 
SyxSyw = zeros(ny,nx+nw);  % Allocate compund matrix consisting of Syx and Syw
xhat_data = zeros(samples+1,nx); % Matrix for storing state estimates
Smat      = zeros(samples+1,0.5*nx*(nx+1)); % Matrix for storing cov. matrices
[I,J]     = find(triu(reshape(1:nx*nx,nx,nx))'); % Index to elem. in Sx
sidx      = sub2ind([nx nx],J,I); 
yidx  = 1;                 % Index into y-vector 
vmean = zeros(nv,1);       % Mean of process noise
wmean = zeros(nw,1);       % Mean of measurement noise

% ----- Initialize state+output equations and linearization -----
if nargin<10,              % No optional parameters passed
   optpar = [];
end
if isfield(optpar,'init')  % Parameters for m-functions
   initpar = optpar.init;
else
   initpar = [];
end

Aflag = 0; Cflag = 0; Fflag = 0; Gflag = 0;
if isfield(optpar,'A'),    % Deterministic dynamic model is linear
   A = optpar.A;
   if(size(A,1)~=nx | size(A,2)~=nx)
      error('"optpar.A" has the wrong dimension');
   end
   Aflag = 1;
end
if isfield(optpar,'F'),    % Linear process noise model in state equation
   F = optpar.F;
   if(size(F,1)~=nx | size(F,2)~=nv)
      error('"optpar.F" has the wrong dimension');
   end
   SxxSxv(:,nx+1:nx+nv) = F*Sv;
   Fflag = 1;
end
if isfield(optpar,'C'),    % Deterministic observation model linear
   C = optpar.C;
   if(size(C,1)~=ny | size(C,2)~=nx)
      error('"optpar.C" has the wrong dimension');
   end
   Cflag = 1;
end
if isfield(optpar,'G'),    % Linear observation noise model
   G = optpar.G;
   if(size(G,1)~=ny | size(G,2)~=nw)
      error('"optpar.G" has the wrong dimension');
   end
   Gflag = 1;
   SyxSyw(:,nx+1:nx+nw) = G*Sw;
end
feval(kalmfilex,initpar);  % Initialize state equation
feval(kalmfiley,initpar);  % Initialize output equation
counter = 0;               % Counts the progress of the filtering
waithandle=waitbar(0,'Filtering in progress');  % Initialize waitbar


% >>>>>>>>>>>>>>>>>>>>>>>>>>>> FILTERING <<<<<<<<<<<<<<<<<<<<<<<<<<<
for k=0:samples,

  % --- Measurement update (a posteriori update) ---
  ybar = feval(kalmfiley,xbar,wmean);
  if (k<=timeidx(end) & timeidx(yidx)==k),
     if Cflag,
        SyxSyw(:,1:nx) = C*Sxbar;
     else
        for kx=1:nx,
           syp = feval(kalmfiley,xbar+h*Sxbar(:,kx),wmean);
           sym = feval(kalmfiley,xbar-h*Sxbar(:,kx),wmean);
           SyxSyw(:,kx) = scal1*(syp-sym);
        end
     end
     if ~Gflag
        kw2=nx;
        for kw=1:nw,
           swp = feval(kalmfiley,xbar,hSw(:,kw));
           swm = feval(kalmfiley,xbar,-hSw(:,kw));
           SyxSyw(:,kw2+kw) = scal1*(swp-swm);
        end
     end
    
    % Cholesky factor of a'posteriori output estimation error covariance
    Sy   = triag(SyxSyw);
    K    = (Sxbar*SyxSyw(:,1:nx)')/(Sy*Sy');       % Kalman gain
    xhat = xbar + K*(y(yidx,:)'-ybar);  % State estimate

    % Cholesky factor of a'posteriori estimation error covariance
    Sx   = triag([Sxbar-K*SyxSyw(:,1:nx) K*SyxSyw(:,nx+1:end)]);
    yidx = yidx + 1; 
  
  % no observations available at this sampling time
  else
    xhat = xbar;                       % Copy a priori state estimate
    Sx   = Sxbar;                      % Copy a priori covariance factor
  end

  % --- Time update (a'priori update) of state and covariance ---
  if k<samples,
    if nu>0 uk1 = u(k+1,:)'; end
    xbar=feval(kalmfilex,xhat,uk1,vmean);
    if Aflag,
        SxxSxv(:,1:nx) = A*Sx;
    else
       for kx=1:nx,
          sxp = feval(kalmfilex,xhat+h*Sx(:,kx),uk1,vmean);
          sxm = feval(kalmfilex,xhat-h*Sx(:,kx),uk1,vmean);
          SxxSxv(:,kx) = scal1*(sxp-sxm);
       end
    end
    if ~Fflag, 
       kv2=nx;
       for kv=1:nv,
          svp = feval(kalmfilex,xhat,uk1,hSv(:,kv));
          svm = feval(kalmfilex,xhat,uk1,-hSv(:,kv));
          SxxSxv(:,kv+kv2) = scal1*(svp-svm);
       end
    end

    % Cholesky factor of a'priori estimation error covariance
    Sxbar = triag(SxxSxv);
  end
  
  % --- Store results ---
  xhat_data(k+1,:) = xhat';
  Smat(k+1,:)      = Sx(sidx)';
  
    
  % --- How much longer? ---
  if (counter+0.01<= k/samples),
     counter = k/samples;
     waitbar(k/samples,waithandle);
  end
end
close(waithandle);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看一区日韩| 国产高清视频一区| 7777精品伊人久久久大香线蕉| 亚洲国产一区二区视频| 欧美日韩久久一区| 久久精品国产精品亚洲精品| 国产亚洲综合av| 成人av在线一区二区三区| 中文字幕中文字幕中文字幕亚洲无线 | 青青草国产精品97视觉盛宴| 日韩视频免费观看高清完整版 | 国产精品一区2区| 久久久午夜精品理论片中文字幕| 成人免费不卡视频| 亚洲已满18点击进入久久| 欧美一区午夜视频在线观看| 国产在线视频一区二区三区| 亚洲欧美一区二区三区极速播放| 欧美日韩夫妻久久| 国产大陆精品国产| 亚洲老妇xxxxxx| 日韩欧美一区二区免费| 91原创在线视频| 久久黄色级2电影| 亚洲欧美怡红院| 91精品免费在线| 99久久综合国产精品| 蜜臀av亚洲一区中文字幕| 欧美国产日韩一二三区| 欧美日韩一区在线| 成人毛片视频在线观看| 日本怡春院一区二区| 国产精品美女久久久久aⅴ| 欧美性生活大片视频| 国产成人一区二区精品非洲| 亚洲一区二区综合| 国产精品女同互慰在线看| 欧美精品 国产精品| 99vv1com这只有精品| 精品在线亚洲视频| 亚洲一区二区精品视频| 国产欧美日韩视频在线观看| 欧美精品黑人性xxxx| 91猫先生在线| 国产精品888| 美女网站色91| 亚洲国产一二三| 亚洲日本中文字幕区| 国产亚洲午夜高清国产拍精品| 欧美一区二区视频在线观看2022 | 国产黄人亚洲片| 日本欧美久久久久免费播放网| 国产精品电影一区二区| 久久久久久9999| 日韩欧美一二三| 欧美顶级少妇做爰| 欧美性生活久久| 色婷婷综合久久| 99久久精品国产观看| 国产精品99久久久久久有的能看| 久久精工是国产品牌吗| 亚洲成人你懂的| 一区二区三区在线影院| 综合久久综合久久| 国产欧美日本一区二区三区| 精品成人免费观看| 精品免费99久久| 欧美va亚洲va在线观看蝴蝶网| 欧美一卡2卡三卡4卡5免费| 欧美日韩国产一二三| 欧美无人高清视频在线观看| 色94色欧美sute亚洲13| 色婷婷综合久久久| 99久精品国产| 日本精品免费观看高清观看| 99久久精品国产网站| 91麻豆.com| 在线亚洲+欧美+日本专区| 色婷婷综合久久久久中文| 在线观看日韩一区| 欧美日韩卡一卡二| 欧美一区二区三区婷婷月色| 精品日韩欧美在线| 26uuu亚洲婷婷狠狠天堂| 久久丝袜美腿综合| 国产区在线观看成人精品| 国产精品久久久久影院亚瑟 | 欧美亚洲禁片免费| 欧美精品丝袜久久久中文字幕| 91麻豆精品国产| 欧美xxxxxxxxx| 国产欧美日韩精品在线| 最新中文字幕一区二区三区| 亚洲自拍偷拍图区| 日本亚洲天堂网| 国产一区日韩二区欧美三区| 国产成人精品三级| 日本高清免费不卡视频| 在线播放中文一区| 久久综合狠狠综合| 最新日韩av在线| 日韩电影在线免费观看| 国产一区二区三区免费观看| 成人18精品视频| 欧美在线观看一二区| 日韩视频一区二区三区| 国产精品嫩草99a| 天天综合日日夜夜精品| 国产黄色91视频| 欧美日韩在线综合| 久久久久久久电影| 亚洲一二三四在线观看| 久久99精品久久久久久| 成人性生交大片免费看中文| 欧美日韩一区成人| 久久久天堂av| 亚洲第一成人在线| 国产激情一区二区三区四区 | 在线观看网站黄不卡| 欧美变态口味重另类| 亚洲免费av观看| 久久99精品国产91久久来源| 91在线观看高清| 久久免费看少妇高潮| 午夜精品久久久久久久久久久| 国产一区二区三区香蕉| 欧美日韩一级视频| 中文字幕一区二区5566日韩| 免费成人av在线播放| 在线观看国产精品网站| 亚洲国产成人午夜在线一区| 亚洲一区二区三区不卡国产欧美| 成人动漫av在线| 2欧美一区二区三区在线观看视频| 亚洲综合自拍偷拍| 成人免费av网站| 精品国产91乱码一区二区三区| 亚洲国产成人av| 成人av在线电影| 久久这里只有精品首页| 免费成人小视频| 欧美日韩国产一级二级| 一区二区三区四区乱视频| 成人一区二区三区视频在线观看| 日韩一级在线观看| 日本少妇一区二区| 欧美视频精品在线观看| 亚洲色大成网站www久久九九| 粉嫩欧美一区二区三区高清影视| 欧美α欧美αv大片| 免费三级欧美电影| 制服丝袜成人动漫| 亚洲一区视频在线| 欧美在线视频全部完| 亚洲免费视频中文字幕| 成人av电影免费在线播放| 国产欧美日本一区二区三区| 国产成人精品免费看| 久久精品免视看| 国产精品88888| 国产精品无码永久免费888| 国产精品资源站在线| 久久久国产精品不卡| 国产一区91精品张津瑜| 日韩西西人体444www| 精品一二三四在线| 久久综合色天天久久综合图片| 久久66热偷产精品| www国产精品av| 国产不卡视频在线播放| 中文字幕欧美三区| 92精品国产成人观看免费| 亚洲桃色在线一区| 欧美在线三级电影| 婷婷综合另类小说色区| 日韩一区二区在线观看视频| 精品一区二区三区免费观看| 久久久久久久久99精品| yourporn久久国产精品| 夜夜嗨av一区二区三区| 日韩一区二区三区在线| 国产乱码字幕精品高清av| 国产精品久久毛片a| 欧美性做爰猛烈叫床潮| 免费看黄色91| 国产精品女上位| 欧美视频日韩视频在线观看| 久久精品久久久精品美女| 欧美激情在线免费观看| 91网站在线观看视频| 亚洲第一成年网| 久久久99精品免费观看| 色天天综合久久久久综合片| 日韩精品成人一区二区三区| 久久精品免费在线观看| 欧美午夜不卡在线观看免费| 国内精品自线一区二区三区视频| 国产精品初高中害羞小美女文| 欧洲生活片亚洲生活在线观看| 老司机精品视频线观看86|