I have a program that calculate CPU time in original system and CPU time in minimun.It suppose that CPU_minimum < CPU_original but in my case occurs the reverse .Here is the code
clear
load('C.mat');
load('G.mat');
% start of simulation time for the original state-space model
tic;
t1 = cputime;
A = -C\ G;
BB=sparse(280,4);
BB(4,1) = 1;
BB(6,2)= 1;
BB(43,3)=1;
BB(72,4) = 1;
%disp(BB);
B = C\BB;
C=B';
D =zeros(4,4);
sys1 = ss(A,B,C,D)
totalCPUTime1 = cputime-t1
fprintf ( 1, 'Creation of the original state-space model needs %1.3f
seconds the CPU.\n', totalCPUTime1 )
% end of simulation time for original state-space model
first = toc
% start of simulation time for the minimum state-space model
tic;
t2 = cputime;
syss1 = minreal(sys1)
totalCPUTime2 = cputime-t2
fprintf ( 1, 'Creation of the minimum state-space model needs %1.3f
seconds the CPU.\n', totalCPUTime2 )
% end of simulation time for minimum original state-space model
second = toc
And I get the following CPU time:
totalCPUTime1= 3.744
totalCPUTime2= 9.641
Do you know where is the problem?