Home > m > timetools > statespacefunctions > utp_ltpda_ss_kalman_filter.m

utp_ltpda_ss_kalman_filter

PURPOSE ^

tests ltpda_simulate_discrete which simulates a discrete state space system

SYNOPSIS ^

function result = utp_ltpda_ss_kalman_filter

DESCRIPTION ^

tests ltpda_simulate_discrete which simulates a discrete state space system
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: tests ltpda_simulate_discrete whichsimulates a discrete
 state space system

 CALL: utp_ltpda_simulate_discrete

 INPUTS: 
 
 OUTPUTS: result - 1/0

 ***** THERE ARE NO DEFAULT PARAMETERS *****

 &&VERSION: $Id: utp_ltpda_ss_kalman_filter.m,v 1.1 2008/02/20 09:20:07 adrien Exp $

 HISTORY: 17-02-2008 A Grynagier

 TO DO: Numerical and syntaxic tests
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function result = utp_ltpda_ss_kalman_filter
0002 %tests ltpda_simulate_discrete which simulates a discrete state space system
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 % DESCRIPTION: tests ltpda_simulate_discrete whichsimulates a discrete
0006 % state space system
0007 %
0008 % CALL: utp_ltpda_simulate_discrete
0009 %
0010 % INPUTS:
0011 %
0012 % OUTPUTS: result - 1/0
0013 %
0014 % ***** THERE ARE NO DEFAULT PARAMETERS *****
0015 %
0016 % &&VERSION: $Id: utp_ltpda_ss_kalman_filter.m,v 1.1 2008/02/20 09:20:07 adrien Exp $
0017 %
0018 % HISTORY: 17-02-2008 A Grynagier
0019 %
0020 % TO DO: Numerical and syntaxic tests
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 ALGONAME = mfilename;
0024 VERSION = '$Id: utp_ltpda_ss_kalman_filter.m,v 1.1 2008/02/20 09:20:07 adrien Exp $';
0025 result = 1;
0026 display(['starting ' mfilename]);
0027  
0028 %% create subsystem
0029 %% test numerique
0030 A=expm([0 1; -2 -1]*0.2);
0031 B1=[0;1];
0032 C=[2 -1];
0033 D1=1;
0034 B2=[0;0];
0035 D2=1;
0036 B3 = [0; 1];
0037 D3 = 0;
0038 sigma2 = 0.5;
0039 mean2 = 3;
0040 sigma3 = 1;
0041 mean3 = 0;
0042 syst = plist('TYPE', 'SUBSYSTEM' ,'NAME', 'SS1' ,'TIMESTEP', 1 , ...
0043     'XISOUTPUT',0,'YISOUTPUT',1,'XINI', [0 0]' , ...
0044     'PARAMNAMES', {} ,'PARAMVALUES', [] ,'PARAMSIGMAS', [] ,...
0045     'NBINPUTS', 3 ,'INPUTNAMES', {'U' 'V' 'W'} ,'INPUTSIZES', [1 1 1] , 'INPUTISUSED', [1 1 1] ,...
0046     'AMAT', {A} ,'BMATS', {B1 B2 B3} ,'CMAT', {C} ,'DMATS', {D1 D2 D3} );
0047 ao1 = ao(sin((1:100)'/3));
0048 ao_in_list = plist('U',ao1, 'V', plist('SIGMA', sigma2, 'MEAN',mean2),'W',plist('SIGMA', sigma3, 'MEAN',mean3));
0049 ao_out = ltpda_simulate_discrete(ao_in_list, syst);
0050 %
0051 data_plist = plist('Qs',{0 sigma3^2+mean3^2},'Rs',{sigma2^2+mean2^2 0},'Noise_Names',{'V' 'W'} );
0052 
0053 ao_in_list2 = plist('U',ao1);
0054 ao_id = ltpda_ss_kalman_filter(ao_out, ao_in_list2, data_plist, syst);
0055 
0056 figure(1)
0057 plot(ao_out)
0058 figure(2)
0059 plot(ao_id)
0060 
0061 
0062 
0063 end

Generated on Tue 26-Feb-2008 10:52:52 by m2html © 2003