0001 function output = utp_ltpda_ss_modify_time_setup
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 ALGONAME = mfilename;
0021 VERSION = '$Id: utp_ltpda_ss_modify_time_setup.m,v 1.2 2008/02/20 09:20:07 adrien Exp $';
0022 display(['starting ' mfilename]);
0023 output =1;
0024
0025 for i=1:100
0026 nSysTot = 1;
0027 pSys = 1;
0028 nUTot = floor(rand()*4);
0029 OutputSizes = floor(rand()*4);
0030 InputSizes = floor(rand(nUTot)*4);
0031 try
0032 j = 1;
0033 syst0 = utp_ltpda_ss_random_generate(nSysTot, pSys, nUTot, OutputSizes, InputSizes);
0034 AMAT = find(syst0, 'AMAT');
0035 V = max(0.5 , max(abs(imag(eig(AMAT{1})))));
0036 if size(V,1)==0
0037 V = 1;
0038 end
0039 Tmax = 3.1415/V/2;
0040
0041
0042 NewTimeStep = plist('TIMESTEP',Tmax*0.05);
0043 j = j+1;
0044 syst2 = ltpda_ss_modify_time_setup(syst0,NewTimeStep);
0045
0046 NewTimeStep = plist('TIMESTEP',0.5*Tmax);
0047 j = j+1;
0048 syst3 = ltpda_ss_modify_time_setup(syst2,NewTimeStep);
0049
0050 NewTimeStep = plist('TIMESTEP',0.05*Tmax);
0051 j = j+1;
0052 syst4 = ltpda_ss_modify_time_setup(syst3,NewTimeStep);
0053
0054 NewTimeStep = plist('TIMESTEP',0);
0055 j = j+1;
0056 syst5 = ltpda_ss_modify_time_setup(syst4,NewTimeStep);
0057 display('ok')
0058 catch
0059 display(['error at step ' num2str(j)])
0060 output = 0;
0061 display('pb')
0062 end
0063
0064
0065 AMAT2 = find(syst2,'AMAT');
0066 AMAT4 = find(syst4,'AMAT');
0067 AMAT0 = find(syst0,'AMAT');
0068 AMAT5 = find(syst5,'AMAT');
0069
0070
0071
0072
0073
0074
0075
0076
0077 if not( norm(AMAT2{1}-AMAT4{1})<5e-7)
0078 display('error possible when changing time between discrete and discrete')
0079 output = 0;
0080 end
0081 if not(norm(AMAT0{1}-AMAT5{1})<5e-7)
0082 display('error possible when changing time between continuous and discrete')
0083 output = 0;
0084 end
0085 if not(norm(AMAT2{1}-AMAT4{1})<1e-13)
0086 display(['small error when changing time between discrete and discrete :' num2str(norm(AMAT2{1}-AMAT4{1}))])
0087 end
0088 if not(norm(AMAT0{1}-AMAT5{1})<1e-13)
0089 display(['small error when changing time between continuous and discrete : ' num2str(norm(AMAT0{1}-AMAT5{1}))])
0090 end
0091 end
0092 end