Index: mttroot/mtt/bin/trans/m/sm2ir.m ================================================================== --- mttroot/mtt/bin/trans/m/sm2ir.m +++ mttroot/mtt/bin/trans/m/sm2ir.m @@ -1,7 +1,7 @@ function [Y,X] = sm2ir(A,B,C,D,T,u0,x0); -% sm2ir - Constrained-state matrix to impulse response. +% sm2ir - state matrix to impulse response. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%% Model Transformation Tools %%%%% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -15,10 +15,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.3 1996/12/05 10:17:34 peterg +% %% Put in version control history. +% %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [Ny,Nu] = size(D); [Ny,Nx] = size(C); @@ -48,19 +51,20 @@ Y = zeros(N,Ny); X = zeros(N,Nx); dt = T(2)-T(1);% Assumes fixed interval -expAdt = expm(A*dt); % Compute matrix exponential -expAt = one; +##expAdt = expm(A*dt); % Compute matrix exponential +##expAt = one; i = 0; x = (B*u0+x0); for t = T' i=i+1; if Nx>0 - % expAt = expm(A*t); - x = expAdt*x; + ##expAt = expm(A*t); + ##x = expAdt*x; + x = expm(A*t)*(B*u0+x0); X(i,:) = x'; if Ny>0 y = C*x; Y(i,:) = y'; end;