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

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

?? pf4.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一区二区三区免费野_久草精品视频
日韩成人精品在线| 色婷婷亚洲综合| www.日韩大片| 精品奇米国产一区二区三区| 国产欧美一区二区精品秋霞影院| 亚洲与欧洲av电影| 成人性视频网站| 制服丝袜一区二区三区| 亚洲欧美偷拍卡通变态| 粉嫩13p一区二区三区| 日韩一级视频免费观看在线| 亚洲精品中文在线影院| 成人美女在线观看| 久久精品一区二区三区不卡牛牛| 三级欧美韩日大片在线看| 色婷婷综合久色| 国产欧美日韩综合精品一区二区| 强制捆绑调教一区二区| 欧美日韩一区二区三区免费看| 亚洲视频精选在线| 国产白丝网站精品污在线入口| 欧美一级日韩一级| 日韩va亚洲va欧美va久久| 一本一本久久a久久精品综合麻豆| 久久久久久久网| 精品一区二区三区视频在线观看| 欧美一区二区在线观看| 日韩av电影免费观看高清完整版 | 国产精品色在线观看| 久久国内精品自在自线400部| 91精品国产丝袜白色高跟鞋| 日韩成人午夜精品| 精品入口麻豆88视频| 国产一区二区视频在线| 久久一夜天堂av一区二区三区| 韩国成人精品a∨在线观看| 日韩免费福利电影在线观看| 国产在线精品一区二区夜色| 久久综合九色综合欧美就去吻| 国产乱子伦一区二区三区国色天香| 欧美mv日韩mv国产网站| 国产凹凸在线观看一区二区| 国产女主播视频一区二区| 成人网在线免费视频| 国产精品日日摸夜夜摸av| 97成人超碰视| 亚洲成人精品一区二区| 91精品国产综合久久久久久久久久 | 国产精品一区二区果冻传媒| 国产亚洲午夜高清国产拍精品| 国产成人免费xxxxxxxx| 亚洲美女淫视频| 欧美日韩不卡在线| 狠狠色丁香久久婷婷综合丁香| 国产日韩视频一区二区三区| 91色porny在线视频| 亚洲18色成人| 久久久久久久精| 91看片淫黄大片一级在线观看| 亚洲影视在线观看| 欧美成人一区二区| www.久久久久久久久| 图片区日韩欧美亚洲| 久久久亚洲精华液精华液精华液| 91污在线观看| 捆绑变态av一区二区三区| 国产精品久久久久三级| 88在线观看91蜜桃国自产| 国产精品一级在线| 亚洲一区二区精品视频| 国产亚洲精品中文字幕| 欧美日韩成人激情| 91尤物视频在线观看| 免费看精品久久片| 自拍偷拍国产精品| 日韩一区二区三区免费看| 不卡的电影网站| 捆绑紧缚一区二区三区视频| 亚洲精选一二三| 久久综合给合久久狠狠狠97色69| 色欧美片视频在线观看| 国产精品综合av一区二区国产馆| 亚洲一区二区四区蜜桃| 国产精品美女久久久久久2018 | 久久天天做天天爱综合色| 在线观看中文字幕不卡| 国产精品123区| 欧美a一区二区| 一区二区三区精品久久久| 国产欧美一区视频| 久久影院视频免费| 欧美一区二区二区| 欧美日韩一区二区三区不卡| 成人福利视频在线看| 九九视频精品免费| 首页欧美精品中文字幕| 亚洲午夜在线电影| 亚洲精品日韩专区silk| 综合久久久久久| 国产精品视频看| 国产日产精品1区| 久久精品人人做人人爽97| 精品嫩草影院久久| 欧美一区二区三区在线观看视频| 欧美性大战xxxxx久久久| 91美女在线视频| 色综合久久久久网| 色综合天天综合网国产成人综合天| 国产黄色91视频| 丁香网亚洲国际| 国产成人亚洲综合a∨婷婷图片| 国内精品写真在线观看| 精品亚洲欧美一区| 国产激情91久久精品导航| 国产精品99精品久久免费| 国产成人综合亚洲网站| 成人激情av网| 99久久精品国产网站| 日本黄色一区二区| 欧美日韩在线精品一区二区三区激情| 欧美视频完全免费看| 欧美丝袜自拍制服另类| 欧美精品一二三四| 欧美一级一级性生活免费录像| 日韩欧美久久久| 精品欧美乱码久久久久久1区2区| 精品国精品国产尤物美女| 久久亚洲综合色| 国产精品家庭影院| 一区二区三区免费在线观看| 亚洲高清免费一级二级三级| 天堂久久久久va久久久久| 美女在线观看视频一区二区| 久久精品99国产国产精| 国产成人在线色| 色视频一区二区| 日韩三级在线免费观看| 久久综合色婷婷| 亚洲品质自拍视频网站| 日本午夜一本久久久综合| 国产高清精品久久久久| 色综合欧美在线| 日韩午夜激情免费电影| 欧美高清一级片在线观看| 亚洲精品成a人| 九色porny丨国产精品| 91蜜桃免费观看视频| 欧美久久一区二区| 国产视频一区在线观看| 亚洲综合在线视频| 国产在线播精品第三| 色94色欧美sute亚洲线路一久| 欧美一级欧美一级在线播放| 国产嫩草影院久久久久| 亚洲电影一区二区三区| 国产美女视频91| 欧美日韩免费在线视频| 中文字幕免费不卡在线| 日韩电影一区二区三区四区| av影院午夜一区| 欧美r级电影在线观看| 亚洲综合区在线| 成人做爰69片免费看网站| 欧美一区二区观看视频| 亚洲免费看黄网站| 国产黄色成人av| 日韩女同互慰一区二区| 亚洲一区二区偷拍精品| 成人av网站在线观看免费| 欧美不卡视频一区| 亚洲一二三四在线| 成人av免费网站| 久久久91精品国产一区二区精品 | 国产成人激情av| 欧美一区二区国产| 亚洲第一成人在线| 91丨九色丨蝌蚪丨老版| 国产色产综合色产在线视频 | 亚洲一卡二卡三卡四卡无卡久久| 高清在线成人网| 精品国产精品一区二区夜夜嗨| 亚洲精品欧美在线| 97aⅴ精品视频一二三区| 久久久国产综合精品女国产盗摄| 美女视频一区二区| 欧美女孩性生活视频| 亚洲综合色在线| 在线看国产一区二区| 国产精品成人免费精品自在线观看 | 国产精品国产三级国产有无不卡| 亚洲第一二三四区| 色天天综合色天天久久| 亚洲欧美日韩综合aⅴ视频| jiyouzz国产精品久久| 日本一区二区三区高清不卡| 国内精品国产成人| 久久亚区不卡日本| 韩国欧美国产一区| 久久久无码精品亚洲日韩按摩| 美女网站一区二区|