Home > src > demos > reentry_demo > reentry_demo_loop.m

reentry_demo_loop

PURPOSE ^

% Run the reentry demo ns times to obtain some reliable results

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Run the reentry demo ns times to obtain some reliable results

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 %% Run the reentry demo ns times to obtain some reliable results
0003 
0004   % Number of loops
0005   ns = 100;
0006   
0007   % Allocate space for results
0008   rmse_results = zeros(11,ns);
0009   
0010   % Show waitbar
0011   handle = waitbar(0,'Please wait...');  
0012   loopstart = tic;
0013   
0014   for loop = 1:ns
0015 
0016       figure(1)
0017       
0018       % Run the demos (with silen=1, keep_trajectory=1 - not in first)
0019       reentry_demo;
0020       
0021       rmse_results(:,loop) = [ekf_rmse;      % EKF
0022                               eks_rmse1;     % ERTS
0023                               eks_rmse2;     % ETF
0024                               ukf_rmse;      % UKF
0025                               uks_rmse1;     % URTS 1
0026                               uks_rmse1b;    % URTS 2
0027                               uks_rmse2;     % UTF
0028                               ghkf_rmse;     % GHKF
0029                               ghrts_rmse1;   % GHRTS
0030                               ckf_rmse;      % CHKF
0031                               crts_rmse1;]; % CRTS
0032                           
0033       % Update waitbar and show time remaining
0034       if rem(k,20)==0 
0035           secondsleft = min(toc(loopstart),Inf)/loop*(ns-loop);
0036           waitbar(loop/ns,handle,sprintf('Monte Carlo runs\nTime left: %.0f min %.0f s.', ...
0037           floor(secondsleft/60),rem(secondsleft,60)))
0038       end
0039   end
0040 
0041   % Get rid of the waitbar
0042   close(handle)
0043   
0044   clc
0045   
0046   % Calculate means
0047   means = mean(rmse_results,2);
0048   
0049   ekf_rmse   = means(1);   % EKF
0050   eks_rmse1  = means(2);   % ERTS
0051   eks_rmse2  = means(3);   % ETF
0052   ukf_rmse   = means(4);   % UKF
0053   uks_rmse1  = means(5);   % URTS 1
0054   uks_rmse1b = means(6);   % URTS 2
0055   uks_rmse2  = means(7);   % UTF
0056   ghkf_rmse  = means(8);   % GHKF
0057   ghrts_rmse = means(9);   % GHRTS
0058   ckf_rmse   = means(10);   % CKF
0059   crts_rmse  = means(11);   % CRTS
0060   
0061 
0062       
0063   % Show average results
0064   fprintf('Average RMSE results over %i Monte Carlo runs\n',ns);
0065   fprintf('EKF-RMSE   = %.6f\n',ekf_rmse);
0066   fprintf('ERTS-RMSE  = %.6f\n',eks_rmse1);
0067   fprintf('ETF-RMSE   = %.6f\n',eks_rmse2);
0068   fprintf('UKF-RMSE   = %.6f\n',ukf_rmse);
0069   fprintf('URTS1-RMSE = %.6f\n',uks_rmse1);
0070   fprintf('URTS2-RMSE = %.6f\n',uks_rmse1b);
0071   fprintf('UTF-RMSE   = %.6f\n',uks_rmse2);
0072   fprintf('GHKF-RMSE  = %.6f\n',ghkf_rmse);
0073   fprintf('GHRTS-RMSE = %.6f\n',ghrts_rmse1);
0074   fprintf('CKF-RMSE   = %.6f\n',ckf_rmse);
0075   fprintf('CRTS-RMSE  = %.6f\n',crts_rmse1);
0076   
0077

Generated on Fri 12-Aug-2011 15:15:16 by m2html © 2005