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

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

?? particleex4.m

?? 《卡曼濾波基礎-------實用方法》
?? M
字號:
function [StdRMSErr, AuxRMSErr] = ParticleEx4

% Particle filter example.
% Track a body falling through the atmosphere.
% This system is taken from [Jul00], which was based on [Ath68].
% Compare the particle filter with the auxiliary particle filter.

global rho0 g k dt

rho0 = 2; % lb-sec^2/ft^4
g = 32.2; % ft/sec^2
k = 2e4; % ft
R = 10^4; % measurement noise variance (ft^2)
Q = diag([0 0 0]); % process noise covariance
M = 10^5; % horizontal range of position sensor
a = 10^5; % altitude of position sensor
P = diag([1e6 4e6 10]); % initial estimation error covariance

x = [3e5; -2e4; 1e-3]; % initial state
xhat = [3e5; -2e4; 1e-3]; % initial state estimate

N = 200; % number of particles  

% Initialize the particle filter.
for i = 1 : N
    xhatplus(:,i) = x + sqrt(P) * [randn; randn; randn]; % standard particle filter
    xhatplusAux(:,i) = xhatplus(:,i); % auxiliary particle filter
end

T = 0.5; % measurement time step
randn('state',sum(100*clock)); % random number generator seed

tf = 30; % simulation length (seconds)
dt = 0.5; % time step for integration (seconds)
xArray = x;
xhatArray = xhat;
xhatAuxArray = xhat;

for t = T : T : tf
    fprintf('.');
    % Simulate the system.
    for tau = dt : dt : T
        % Fourth order Runge Kutta ingegration
        [dx1, dx2, dx3, dx4] = RungeKutta(x);
        x = x + (dx1 + 2 * dx2 + 2 * dx3 + dx4) / 6;
        x = x + sqrt(dt * Q) * [randn; randn; randn] * dt;
    end
    % Simulate the noisy measurement.
    z = sqrt(M^2 + (x(1)-a)^2) + sqrt(R) * randn;
    % Simulate the continuous-time part of the particle filter (time update).
    xhatminus = xhatplus;
    xhatminusAux = xhatplusAux;
    for i = 1 : N
        for tau = dt : dt : T
            % Fourth order Runge Kutta ingegration
            % standard particle filter
            [dx1, dx2, dx3, dx4] = RungeKutta(xhatminus(:,i));
            xhatminus(:,i) = xhatminus(:,i) + (dx1 + 2 * dx2 + 2 * dx3 + dx4) / 6;
            xhatminus(:,i) = xhatminus(:,i) + sqrt(dt * Q) * [randn; randn; randn] * dt;
            xhatminus(3,i) = max(0, xhatminus(3,i)); % the ballistic coefficient cannot be negative
            % auxiliary particle filter
            [dx1, dx2, dx3, dx4] = RungeKutta(xhatminusAux(:,i));
            xhatminusAux(:,i) = xhatminusAux(:,i) + (dx1 + 2 * dx2 + 2 * dx3 + dx4) / 6;
            xhatminusAux(:,i) = xhatminusAux(:,i) + sqrt(dt * Q) * [randn; randn; randn] * dt;
            xhatminusAux(3,i) = max(0, xhatminusAux(3,i)); % the ballistic coefficient cannot be negative
        end
        zhat = sqrt(M^2 + (xhatminus(1,i)-a)^2);
        vhat(i) = z - zhat;
        zhatAux = sqrt(M^2 + (xhatminusAux(1,i)-a)^2);
        vhatAux(i) = z - zhatAux;
    end
    % Note that we need to scale all of the q(i) probabilities in a way
    % that does not change their relative magnitudes.
    % Otherwise all of the q(i) elements will be zero because of the
    % large value of the exponential.
    % standard particle filter
    vhatscale = max(abs(vhat)) / 4;
    qsum = 0;
    for i = 1 : N
        q(i) = exp(-(vhat(i)/vhatscale)^2);
        qsum = qsum + q(i);
    end
    % Normalize the likelihood of each a priori estimate.
    for i = 1 : N
        q(i) = q(i) / qsum;
    end
    % auxiliary particle filter
    vhatscaleAux = max(abs(vhatAux)) / 4;
    qsumAux = 0;
    for i = 1 : N
        qAux(i) = exp(-(vhatAux(i)/vhatscaleAux)^2);
        qsumAux = qsumAux + qAux(i);
    end
    % Regularize the probabilities - this is conceptually identical to the
    % auxiliary particle filter - increase low probabilities and decrease
    % high probabilities.
    % Large k means low regularization (k = infinity is identical to the
    % standard particle filter). Small k means high regularization (k = 1
    % means that all probabilities are equal). 
    kAux = 1.1; 
    qAux = ((kAux - 1) * qAux + mean(qAux)) / kAux;
    % Normalize the likelihood of each a priori estimate.
    for i = 1 : N
        qAux(i) = qAux(i) / qsumAux;
    end
    % Resample the standard particle filter
    for i = 1 : N
        u = rand; % uniform random number between 0 and 1
        qtempsum = 0;
        for j = 1 : N
            qtempsum = qtempsum + q(j);
            if qtempsum >= u
                xhatplus(:,i) = xhatminus(:,j);
                xhatplus(3,i) = max(0,xhatplus(3,i)); % the ballistic coefficient cannot be negative
                break;
            end
        end
    end
    % The standard particle filter estimate is the mean of the particles.
    xhat = mean(xhatplus')';
    % Resample the auxiliary particle filter
    for i = 1 : N
        u = rand; % uniform random number between 0 and 1
        qtempsum = 0;
        for j = 1 : N
            qtempsum = qtempsum + qAux(j);
            if qtempsum >= u
                xhatplusAux(:,i) = xhatminusAux(:,j);
                xhatplusAux(3,i) = max(0,xhatplusAux(3,i)); % the ballistic coefficient cannot be negative
                break;
            end
        end
    end
    % The auxiliary particle filter estimate is the mean of the particles.
    xhatAux = mean(xhatplusAux')';
    % Save data for plotting.
    xArray = [xArray x];
    xhatArray = [xhatArray xhat];
    xhatAuxArray = [xhatAuxArray xhatAux];
end

close all;
t = 0 : T : tf;
figure; 
semilogy(t, abs(xArray(1,:) - xhatArray(1,:)), 'b-'); hold;
semilogy(t, abs(xArray(1,:) - xhatAuxArray(1,:)), 'r:'); 
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('Altitude Estimation Error');
legend('Standard particle filter', 'Auxiliary particle filter');

figure; 
semilogy(t, abs(xArray(2,:) - xhatArray(2,:)), 'b-'); hold;
semilogy(t, abs(xArray(2,:) - xhatAuxArray(2,:)), 'r:');
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('Velocity Estimation Error');
legend('Standard particle filter', 'Auxiliary particle filter');

figure; 
semilogy(t, abs(xArray(3,:) - xhatArray(3,:)), 'b-'); hold;
semilogy(t, abs(xArray(3,:) - xhatAuxArray(3,:)), 'r:'); 
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('Ballistic Coefficient Estimation Error');
legend('Standard particle filter', 'Auxiliary particle filter');

figure;
plot(t, xArray(1,:));
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('True Position');

figure;
plot(t, xArray(2,:));
title('Falling Body Simulation', 'FontSize', 12);
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('True Velocity');

for i = 1 : 3
    StdRMSErr(i) = sqrt((norm(xArray(i,:) - xhatArray(i,:)))^2 / tf / dt);
    AuxRMSErr(i) = sqrt((norm(xArray(i,:) - xhatAuxArray(i,:)))^2 / tf / dt);
end
disp(['Standard particle filter RMS error = ', num2str(StdRMSErr)]);
disp(['Auxiliary particle filter RMS error = ', num2str(AuxRMSErr)]);

function [dx1, dx2, dx3, dx4] = RungeKutta(x)
% Fourth order Runge Kutta integration for the falling body system.
global rho0 g k dt
dx1(1,1) = x(2);
dx1(2,1) = rho0 * exp(-x(1)/k) * x(2)^2 / 2 * x(3) - g;
dx1(3,1) = 0;
dx1 = dx1 * dt;
xtemp = x + dx1 / 2;
dx2(1,1) = xtemp(2);
dx2(2,1) = rho0 * exp(-xtemp(1)/k) * xtemp(2)^2 / 2 * xtemp(3) - g;
dx2(3,1) = 0;
dx2 = dx2 * dt;
xtemp = x + dx2 / 2;
dx3(1,1) = xtemp(2);
dx3(2,1) = rho0 * exp(-xtemp(1)/k) * xtemp(2)^2 / 2 * xtemp(3) - g;
dx3(3,1) = 0;
dx3 = dx3 * dt;
xtemp = x + dx3;
dx4(1,1) = xtemp(2);
dx4(2,1) = rho0 * exp(-xtemp(1)/k) * xtemp(2)^2 / 2 * xtemp(3) - g;
dx4(3,1) = 0;
dx4 = dx4 * dt;
return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av电影免费观看高清完整版 | 国产成人免费高清| 一区二区久久久| 一区二区免费在线播放| 一区二区三区在线观看视频| 亚洲免费观看高清完整| 1000精品久久久久久久久| 中日韩av电影| 亚洲日本护士毛茸茸| 亚洲品质自拍视频| 亚洲成av人片一区二区| 午夜久久久久久久久 | 欧美变态tickling挠脚心| 欧美一区二区三区婷婷月色| 日韩欧美中文字幕公布| 精品国产乱码久久久久久闺蜜 | 91日韩一区二区三区| 一本色道久久综合狠狠躁的推荐 | 丁香五精品蜜臀久久久久99网站| 国产一区二区三区综合| 成人午夜伦理影院| 欧美午夜电影网| 欧美大度的电影原声| 欧美激情一区在线| 亚洲一区二区四区蜜桃| 麻豆精品一区二区av白丝在线| 国产中文字幕精品| 99久久久久免费精品国产| 欧美日韩一区 二区 三区 久久精品| 日韩一区二区三区视频在线| 久久综合九色欧美综合狠狠| 中文字幕一区二区三区在线播放 | 中文字幕一区二区不卡| 五月激情丁香一区二区三区| 美女免费视频一区二区| 91在线观看地址| 欧美一区二区精品久久911| 亚洲国产经典视频| 视频一区二区国产| 成人a免费在线看| 日韩欧美一区中文| 一区二区在线电影| 国产成人8x视频一区二区 | 激情综合网天天干| 在线免费观看成人短视频| 欧美电影免费观看高清完整版| 亚洲欧洲日韩av| 精品一区二区精品| 欧美夫妻性生活| 中文字幕在线观看不卡视频| 精一区二区三区| 欧美日韩激情一区二区三区| 中文字幕在线观看一区二区| 久久99国产精品久久| 欧美男男青年gay1069videost| 国产精品色一区二区三区| 美国精品在线观看| 777午夜精品免费视频| 亚洲精品视频在线观看免费| 成人一区在线观看| 精品国产制服丝袜高跟| 石原莉奈在线亚洲三区| 欧美亚洲国产bt| 中文字幕第一区综合| 乱一区二区av| 91精品在线观看入口| 亚洲成人动漫精品| 欧美无砖砖区免费| 亚洲最新视频在线播放| 91视频国产资源| 成人欧美一区二区三区视频网页| 黄色精品一二区| 日韩欧美成人一区二区| 麻豆国产精品一区二区三区| 91精品国产麻豆国产自产在线| 亚洲超碰97人人做人人爱| 欧美在线观看视频一区二区三区| 亚洲日本一区二区| av午夜一区麻豆| 国产精品成人网| 91丨九色丨蝌蚪丨老版| 综合欧美一区二区三区| 91麻豆国产在线观看| 亚洲乱码日产精品bd| 色综合久久久久久久久| 亚洲综合视频在线观看| 欧美日韩亚洲国产综合| 日本不卡一区二区三区高清视频| 欧美美女网站色| 久久精品国产一区二区| 久久精品亚洲精品国产欧美kt∨| 国产精品亚洲视频| 自拍偷拍亚洲综合| 欧美日韩国产成人在线免费| 免费成人性网站| 国产亚洲综合性久久久影院| 北条麻妃国产九九精品视频| 亚洲综合在线电影| 91精品在线观看入口| 国产精品一区二区三区乱码 | 亚洲精品videosex极品| 欧美精品第一页| 国产一区二区三区| 亚洲黄色免费电影| 91精品国产全国免费观看| 国产成人午夜精品5599| 亚洲精品欧美在线| 日韩三级在线免费观看| 9i看片成人免费高清| 日日夜夜精品视频天天综合网| 久久久久久久久久久99999| 91亚洲大成网污www| 麻豆精品精品国产自在97香蕉 | eeuss国产一区二区三区| 亚洲国产日韩一区二区| 精品国产一区二区国模嫣然| 99久久精品国产毛片| 美女网站色91| 亚洲视频 欧洲视频| 精品国产三级电影在线观看| 91免费国产在线观看| 精品一区在线看| 亚洲愉拍自拍另类高清精品| 国产日韩综合av| 欧美日韩国产一级| 成人国产精品免费| 蜜桃视频在线观看一区二区| 1区2区3区国产精品| 日韩欧美高清一区| 欧美色图免费看| 96av麻豆蜜桃一区二区| 精一区二区三区| 日日夜夜免费精品| 亚洲国产毛片aaaaa无费看| 久久久久久夜精品精品免费| 777欧美精品| 欧美在线你懂的| 色婷婷精品大在线视频 | 亚洲精品成人天堂一二三| 日本一区二区三区免费乱视频| 欧美一区二区三区日韩| 欧美伊人久久久久久午夜久久久久| 成人综合婷婷国产精品久久免费| 另类综合日韩欧美亚洲| 日韩电影在线观看电影| 亚洲成a人v欧美综合天堂下载| 中文字幕在线观看不卡| 国产精品狼人久久影院观看方式| 久久综合狠狠综合久久综合88| 69堂成人精品免费视频| 欧美色爱综合网| 欧美影院午夜播放| 欧美三日本三级三级在线播放| 91污片在线观看| 色婷婷综合中文久久一本| 91免费视频网址| 91美女在线看| 91国产福利在线| 欧美综合色免费| 色婷婷激情一区二区三区| 色噜噜狠狠成人网p站| 色综合一个色综合亚洲| 色婷婷精品久久二区二区蜜臂av| 91美女蜜桃在线| 欧美日韩国产欧美日美国产精品| 欧美日韩免费一区二区三区| 欧美高清激情brazzers| 欧美成人在线直播| 久久婷婷成人综合色| 中文一区二区完整视频在线观看| 国产精品久久久久久久浪潮网站| 1区2区3区精品视频| 亚洲一区二区综合| 老司机精品视频一区二区三区| 精品一区二区久久| 成人avav影音| 欧美日韩免费一区二区三区| 精品日韩99亚洲| 国产精品欧美综合在线| 亚洲一区二区三区四区不卡| 日本不卡视频在线观看| 国产九色sp调教91| 91网站最新网址| 91精品国产一区二区三区 | 一本一道综合狠狠老| 91精品国产综合久久福利软件| 国产肉丝袜一区二区| 亚洲一区二区在线免费看| 国内精品伊人久久久久av影院| 99久久精品国产麻豆演员表| 欧美一区二区三区四区视频| 亚洲国产精品二十页| 日韩和欧美一区二区| 成人免费va视频| 91精品国产乱| 亚洲男同1069视频| 国产在线精品视频| 欧美高清dvd| 亚洲人成精品久久久久| 国产一区二区三区在线看麻豆|