Home > m > timetools > statespacefunctions > utp_ltpda_simulate_discrete.m

utp_ltpda_simulate_discrete

PURPOSE ^

tests ltpda_simulate_discrete which simulates a discrete state space system

SYNOPSIS ^

function result = utp_ltpda_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_simulate_discrete.html,v 1.1 2008/03/01 12:29:32 hewitson 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_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_simulate_discrete.html,v 1.1 2008/03/01 12:29:32 hewitson 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_simulate_discrete.html,v 1.1 2008/03/01 12:29:32 hewitson Exp $';
0025 result = 1;
0026 display(['starting ' mfilename]);
0027  
0028 %% create subsystem
0029 %% test numerique
0030 A=expm([0 1; -2 -1]);
0031 B1=[0;1];
0032 C=[2 -1];
0033 D1=1;
0034 B2=[0;0];
0035 D2=1;
0036 sigma = 0.5;
0037 mean = 10;
0038 syst = plist('TYPE', 'SUBSYSTEM' ,'NAME', 'SS1' ,'TIMESTEP', 1 , ...
0039     'XISOUTPUT',0,'YISOUTPUT',1,'XINI', [0 0]' , ...
0040     'PARAMNAMES', {} ,'PARAMVALUES', [] ,'PARAMSIGMAS', [] ,...
0041     'NBINPUTS', 2 ,'INPUTNAMES', {'U' 'N'} ,'INPUTSIZES', [1 1] , 'INPUTISUSED', [1 1] ,...
0042     'AMAT', {A} ,'BMATS', {B1 B2} ,'CMAT', {C} ,'DMATS', {D1 D2} );
0043 ao1 = ao(sin((1:100)/3));
0044 ao_in_list = plist('U',ao1, 'N', plist('SIGMA', sigma, 'MEAN',mean));
0045 ao_out = ltpda_simulate_discrete(ao_in_list, syst);
0046 %
0047 data_plist = plist('Qs',{0},'Rs',{sigma^2+mean^2},'Noise_Names',{'N'} );
0048 
0049 ao_in_list2 = plist('U',ao1);
0050 ao_id = ltpda_ss_kalman_filter(ao_out, ao_in_list2, data_plist, syst);
0051 
0052 figure(1)
0053 plot(ao_out)
0054 figure(2)
0055 plot(ao_id)
0056 end

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