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

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

?? particleex4.m

?? UPF算法和層次分析法!!!!!!!!!!!!!!希望大家有用
?? 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一区二区三区免费野_久草精品视频
日韩码欧中文字| 国产美女久久久久| 国产曰批免费观看久久久| voyeur盗摄精品| 精品日韩99亚洲| 一区二区三区久久| 国产91丝袜在线18| 精品美女一区二区| 日本亚洲免费观看| 欧美视频一区二区三区在线观看| 久久蜜桃一区二区| 久久99精品久久只有精品| 欧美日韩一级二级| 夜夜精品浪潮av一区二区三区| 国产精品一区二区在线观看不卡 | 91精品中文字幕一区二区三区| 欧美精彩视频一区二区三区| 久草中文综合在线| 91精品国产91久久综合桃花| 亚洲成年人影院| 欧美日韩国产片| 亚洲午夜av在线| 欧美日韩视频在线观看一区二区三区| 一区在线播放视频| 91亚洲男人天堂| 亚洲毛片av在线| 欧美性大战久久久久久久蜜臀| 亚洲欧美日韩国产中文在线| 色悠悠久久综合| 亚洲黄色性网站| 欧美视频一区二区在线观看| 亚洲国产精品嫩草影院| 777午夜精品视频在线播放| 天堂久久一区二区三区| 6080日韩午夜伦伦午夜伦| 午夜免费久久看| 欧美变态口味重另类| 国产精品一级在线| 国产精品国产三级国产有无不卡 | 91精品久久久久久蜜臀| 亚洲一区二区三区视频在线| 欧美一a一片一级一片| 亚洲国产综合91精品麻豆| 欧美日韩黄色一区二区| 日本少妇一区二区| 日韩欧美国产一区二区在线播放| 久久精品国产一区二区三区免费看 | 亚洲另类中文字| 欧美少妇bbb| 美女mm1313爽爽久久久蜜臀| 国产人伦精品一区二区| 99久精品国产| 日韩国产成人精品| 国产午夜精品一区二区| 99re这里都是精品| 性久久久久久久久久久久| 欧美电视剧免费观看| 成人在线综合网| 午夜精品视频一区| 久久综合久久鬼色中文字| 成人污污视频在线观看| 首页国产欧美久久| 国产亚洲一区二区在线观看| 色综合久久久久综合体| 免费成人av在线播放| 国产精品午夜免费| 欧美欧美欧美欧美首页| 国产高清精品在线| 天堂久久久久va久久久久| 国产午夜精品福利| 欧美二区三区91| 国产91精品免费| 亚洲18色成人| 国产精品久久久一本精品| 日韩一区二区三区视频在线 | 亚洲一区二区三区爽爽爽爽爽| 精品久久久久久无| 欧美性色综合网| 国产 日韩 欧美大片| 亚洲超碰精品一区二区| 日韩一区中文字幕| 久久日韩粉嫩一区二区三区| 欧美午夜理伦三级在线观看| 粉嫩蜜臀av国产精品网站| 五月激情综合婷婷| 一区二区三区在线看| 精品国产免费久久| 欧美丰满少妇xxxbbb| 91一区二区在线| 粉嫩绯色av一区二区在线观看| 奇米888四色在线精品| 一级做a爱片久久| 亚洲视频中文字幕| 国产精品天干天干在线综合| 26uuu国产日韩综合| 91精品国产色综合久久久蜜香臀| 91丝袜国产在线播放| 从欧美一区二区三区| 精品午夜一区二区三区在线观看 | 91精品婷婷国产综合久久竹菊| 99久久精品国产观看| eeuss鲁片一区二区三区| 国产一区二区福利视频| 老司机精品视频导航| 日本美女一区二区| 日韩激情av在线| 日韩国产欧美在线播放| 丝袜a∨在线一区二区三区不卡| 一区二区三区小说| 亚洲人123区| 亚洲精品菠萝久久久久久久| 综合色天天鬼久久鬼色| 亚洲欧洲性图库| 亚洲丝袜另类动漫二区| 亚洲精品自拍动漫在线| 亚洲精品日韩专区silk| 亚洲电影视频在线| 日韩不卡手机在线v区| 久久av资源网| 国产成人在线网站| 99久久婷婷国产精品综合| 91国偷自产一区二区开放时间| 日本久久电影网| 欧美精品xxxxbbbb| 欧美刺激午夜性久久久久久久| www日韩大片| 国产精品福利一区| 亚洲国产精品自拍| 久久精品噜噜噜成人88aⅴ| 国产美女精品在线| 99久久伊人久久99| 欧美日韩一级二级| 精品国产免费久久| 日韩理论片网站| 奇米影视在线99精品| 国产一区二区三区免费看 | 亚洲人成网站色在线观看| 亚洲午夜日本在线观看| 久久狠狠亚洲综合| 成人av免费网站| 欧美精品在线观看播放| 久久综合狠狠综合久久综合88| 自拍av一区二区三区| 日日夜夜免费精品| 成人午夜大片免费观看| 欧美日韩亚洲综合在线| 久久色成人在线| 亚洲最新视频在线播放| 麻豆国产精品视频| 95精品视频在线| 欧美成人一区二区| 综合电影一区二区三区| 久久爱另类一区二区小说| 在线免费观看一区| 久久久99精品免费观看| 亚洲观看高清完整版在线观看| 国产很黄免费观看久久| 欧美日韩国产一级| 日韩毛片视频在线看| 韩国v欧美v日本v亚洲v| 欧美亚洲图片小说| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲一区二区影院| 成人黄页毛片网站| 欧美成人艳星乳罩| 亚洲与欧洲av电影| 99视频精品免费视频| 久久综合99re88久久爱| 视频一区视频二区中文字幕| 91在线小视频| 久久久精品国产免费观看同学| 日韩精品午夜视频| 日本高清成人免费播放| 国产精品三级视频| 国产一区二区三区最好精华液| 在线电影国产精品| 一区二区三区免费看视频| 99在线精品视频| 欧美国产视频在线| 国产精品综合在线视频| 亚洲精品一线二线三线无人区| 日韩精品电影在线| 在线播放欧美女士性生活| 亚洲成人在线观看视频| 欧美色图天堂网| 亚洲激情图片qvod| 色欧美片视频在线观看在线视频| 国产女主播一区| 粉嫩蜜臀av国产精品网站| 中文一区二区在线观看| 国产成人精品三级麻豆| 国产女同性恋一区二区| 国产精品456露脸| 国产欧美一区二区三区网站 | 久久精品国产精品亚洲精品| 欧美一区午夜精品| 免费在线看一区| 精品国产欧美一区二区| 国产一区91精品张津瑜| 国产欧美日韩中文久久|