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

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

?? particleex5.m

?? UPF算法和層次分析法!!!!!!!!!!!!!!希望大家有用
?? M
字號:
function [StdErr, EKFErr] = ParticleEx5

% EKF 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 EKF 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
    xhatplusEKF(:,i) = xhatplus(:,i); % EKF particle filter
    Pplus(:,:,i) = P; % initial EKF particle filter estimation error covariance
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;
xhatEKFArray = 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 filters (time update).
    xhatminus = xhatplus;
    xhatminusEKF = xhatplusEKF;
    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
            % EKF particle filter
            [dx1, dx2, dx3, dx4] = RungeKutta(xhatminusEKF(:,i));
            xhatminusEKF(:,i) = xhatminusEKF(:,i) + (dx1 + 2 * dx2 + 2 * dx3 + dx4) / 6;
            xhatminusEKF(:,i) = xhatminusEKF(:,i) + sqrt(dt * Q) * [randn; randn; randn] * dt;
            xhatminusEKF(3,i) = max(0, xhatminusEKF(3,i)); % the ballistic coefficient cannot be negative
        end
        % standard particle filter
        zhat = sqrt(M^2 + (xhatminus(1,i)-a)^2);
        vhat(i) = z - zhat;
        % EKF particle filter
        zhatEKF = sqrt(M^2 + (xhatminusEKF(1,i)-a)^2);
        F = [0 1 0; -rho0 * exp(-xhatminusEKF(1,i)/k) * xhatminusEKF(2,i)^2 / 2 / k * xhatminusEKF(3,i) ...
            rho0 * exp(-xhatminusEKF(1,i)/k) * xhatminusEKF(2,i) * xhatminusEKF(3,i) ...
            rho0 * exp(-xhatminusEKF(1,i)/k) * xhatminusEKF(2,i)^2 / 2; ...
            0 0 0];
        H = [(xhatminusEKF(1,i) - a) / sqrt(M^2 + (xhatminusEKF(1,i)-a)^2) 0 0];
        Pminus(:,:,i) = F * Pplus(:,:,i) * F' + Q;
        K = Pminus(:,:,i) * H' * inv(H * Pminus(:,:,i) * H' + R);
        xhatminusEKF(:,i) = xhatminusEKF(:,i) + K * (z - zhatEKF);
        zhatEKF = sqrt(M^2 + (xhatminusEKF(1,i)-a)^2);
        vhatEKF(i) = z - zhatEKF;
    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
    % EKF particle filter
    vhatscaleEKF = max(abs(vhatEKF)) / 4;
    qsumEKF = 0;
    for i = 1 : N
        qEKF(i) = exp(-(vhatEKF(i)/vhatscaleEKF)^2);
        qsumEKF = qsumEKF + qEKF(i);
    end
    % Normalize the likelihood of each a priori estimate.
    for i = 1 : N
        qEKF(i) = qEKF(i) / qsumEKF;
    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 EKF particle filter
    Ptemp = Pplus;
    for i = 1 : N
        u = rand; % uniform random number between 0 and 1
        qtempsum = 0;
        for j = 1 : N
            qtempsum = qtempsum + qEKF(j);
            if qtempsum >= u
                xhatplusEKF(:,i) = xhatminusEKF(:,j);
                xhatplusEKF(3,i) = max(0,xhatplusEKF(3,i)); % the ballistic coefficient cannot be negative
                Pplus(:,:,i) = Ptemp(:,:,j);
                break;
            end
        end
    end
    % The EKF particle filter estimate is the mean of the particles.
    xhatEKF = mean(xhatplusEKF')';
    % Save data for plotting.
    xArray = [xArray x];
    xhatArray = [xhatArray xhat];
    xhatEKFArray = [xhatEKFArray xhatEKF];
end

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

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

figure; 
semilogy(t, abs(xArray(3,:) - xhatArray(3,:)), 'b-'); hold;
semilogy(t, abs(xArray(3,:) - xhatEKFArray(3,:)), 'r:'); 
set(gca,'FontSize',12); set(gcf,'Color','White');
xlabel('Seconds');
ylabel('Ballistic Coefficient Estimation Error');
legend('Standard particle filter', 'EKF 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
    StdErr(i) = sqrt((norm(xArray(i,:) - xhatArray(i,:)))^2 / tf / dt);
    EKFErr(i) = sqrt((norm(xArray(i,:) - xhatEKFArray(i,:)))^2 / tf / dt);
end
disp(['Standard particle filter RMS error = ', num2str(StdErr)]);
disp(['EKF particle filter RMS error = ', num2str(EKFErr)]);

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一区二区三区免费野_久草精品视频
亚洲国产你懂的| 国产精品国产三级国产普通话三级| 亚洲综合在线第一页| 色婷婷亚洲精品| 一区二区三区不卡视频| 欧美日韩激情一区二区三区| 五月天欧美精品| 欧美一区午夜精品| 韩国欧美一区二区| 亚洲国产成人午夜在线一区| 波多野洁衣一区| 亚洲一二三级电影| 欧美一级二级在线观看| 国产麻豆欧美日韩一区| 亚洲国产精品t66y| 色综合中文字幕国产 | 国产又黄又大久久| 欧美国产1区2区| 欧美精品一区二区在线观看| 国产在线看一区| 国产精品久久久久久久久免费丝袜 | 亚洲v日本v欧美v久久精品| 欧美老肥妇做.爰bbww| 九九视频精品免费| 中文字幕在线不卡| 777精品伊人久久久久大香线蕉| 精品一区二区免费| 亚洲人成网站精品片在线观看| 欧美久久久一区| 成人小视频免费观看| 五月天一区二区| 亚洲欧美怡红院| 日韩欧美激情在线| 色菇凉天天综合网| 精彩视频一区二区三区| 亚洲欧美一区二区三区孕妇| 欧美一级搡bbbb搡bbbb| 91尤物视频在线观看| 久久精品99国产国产精| 亚洲欧美视频一区| 久久日韩精品一区二区五区| 在线免费观看成人短视频| 国产一区二区三区在线观看免费视频 | 91色九色蝌蚪| 国产美女视频91| 午夜久久久久久久久| 国产亚洲欧美色| 欧美精品在线观看一区二区| 成人精品免费网站| 老司机精品视频在线| 一区二区三区久久| 国产精品三级av| 精品国产亚洲一区二区三区在线观看 | 久久综合狠狠综合久久激情| 日本精品一区二区三区高清| 国产91精品露脸国语对白| 欧美性欧美巨大黑白大战| 丁香婷婷综合色啪| 久久国产婷婷国产香蕉| 亚洲国产日韩一级| 日韩理论片中文av| 国产欧美精品一区二区三区四区| 日韩无一区二区| 欧美日本一道本在线视频| 一本到不卡精品视频在线观看| 国产一区视频网站| 理论片日本一区| 日韩不卡一二三区| 午夜视频在线观看一区| 亚洲蜜臀av乱码久久精品| 国产精品乱码久久久久久| 欧美v日韩v国产v| 91麻豆精品91久久久久同性| 色综合色狠狠天天综合色| 成人免费毛片片v| 国产99久久久精品| 国产成人在线观看| 国产白丝网站精品污在线入口| 国产在线精品一区二区夜色| 国内精品嫩模私拍在线| 麻豆精品一区二区| 久久99精品国产91久久来源| 久久电影网站中文字幕| 黄色日韩网站视频| 国产一区二区三区四区五区入口| 国产一区中文字幕| 东方欧美亚洲色图在线| 国产不卡一区视频| 成人高清伦理免费影院在线观看| 国产精品系列在线播放| 成人av午夜影院| 一本色道综合亚洲| 欧美图区在线视频| 欧美日韩国产区一| 日韩女优制服丝袜电影| 精品少妇一区二区三区免费观看| 精品成a人在线观看| 国产农村妇女毛片精品久久麻豆| 欧美激情在线看| 亚洲欧美视频一区| 首页国产欧美日韩丝袜| 免费久久精品视频| 粉嫩高潮美女一区二区三区 | 91丨porny丨中文| 91福利国产成人精品照片| 制服丝袜日韩国产| 久久久久国产成人精品亚洲午夜| 专区另类欧美日韩| 日韩精品一级二级 | 一区在线中文字幕| 亚洲一区二区在线播放相泽| 日韩高清欧美激情| 国产乱人伦偷精品视频不卡| 91麻豆精品秘密| 91精品国产乱| 国产精品丝袜久久久久久app| 悠悠色在线精品| 久久精品国产**网站演员| 99久久久国产精品| 日韩欧美高清一区| 亚洲精品中文在线| 美腿丝袜亚洲一区| a亚洲天堂av| 精品国产免费久久| 亚洲精品成人天堂一二三| 国产在线视频精品一区| 91久久精品网| 国产日韩欧美一区二区三区乱码| 亚洲一区二区三区中文字幕在线| 国产综合久久久久久久久久久久| 一本一道久久a久久精品综合蜜臀| 日韩美女主播在线视频一区二区三区| 亚洲欧洲在线观看av| 激情综合色丁香一区二区| 欧美私人免费视频| 中文字幕一区二区三区蜜月| 精品亚洲成a人| 3d成人动漫网站| 亚洲精品你懂的| 成人免费毛片高清视频| 日韩精品综合一本久道在线视频| 亚洲欧美一区二区视频| 国产精品一区二区无线| 日韩视频免费观看高清完整版在线观看 | 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩一区二区三区免费看| 国产精品视频yy9299一区| 国产一区二区美女诱惑| 日韩精品资源二区在线| 日韩在线播放一区二区| 欧美色区777第一页| 亚洲精品中文字幕乱码三区| 不卡一区中文字幕| 国产欧美精品一区二区色综合朱莉| 另类小说视频一区二区| 欧美一区二区人人喊爽| 亚洲国产精品一区二区www在线| 99久久久精品免费观看国产蜜| 国产亚洲精品资源在线26u| 狂野欧美性猛交blacked| 日韩一区二区三区观看| 五月天丁香久久| 欧美色偷偷大香| 性久久久久久久久| 在线综合视频播放| 日韩国产一二三区| 欧美一区二区精美| 看片的网站亚洲| 欧美大片免费久久精品三p| 麻豆精品视频在线观看视频| 欧美va在线播放| 激情久久五月天| 国产视频一区在线播放| 成熟亚洲日本毛茸茸凸凹| 国产精品入口麻豆九色| www.欧美日韩国产在线| 亚洲精品日韩综合观看成人91| 99久久精品国产一区二区三区| 中文字幕一区二区三区在线播放| av成人免费在线| 亚洲一区日韩精品中文字幕| 在线播放日韩导航| 日本三级韩国三级欧美三级| 精品三级在线观看| 成人久久久精品乱码一区二区三区| 中文字幕一区二区三区蜜月 | 日日骚欧美日韩| 日韩精品一区二区三区视频在线观看 | 欧美一区二区在线观看| 久久99最新地址| 国产精品美女久久久久久2018| 色av一区二区| 欧美a级理论片| 中文字幕第一区综合| 91免费精品国自产拍在线不卡| 午夜精品久久久久影视| 精品处破学生在线二十三| 99久久综合精品| 日韩二区在线观看| 国产精品美女久久久久aⅴ国产馆|