Index: mttroot/mtt/bin/trans/m/sm2sr.m ================================================================== --- mttroot/mtt/bin/trans/m/sm2sr.m +++ mttroot/mtt/bin/trans/m/sm2sr.m @@ -8,10 +8,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 1996/09/10 16:48:21 peter +% %% Changed ar counts in default settings. +% %% % %% Revision 1.1 1996/08/19 15:34:29 peter % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -38,16 +41,21 @@ one = eye(Nx); Y = zeros(N,Ny); X = zeros(N,Nx); + +dt = T(2)-T(1);% Assumes fixed interval +expAdt = expm(A*dt); % Compute matrix exponential i = 0; +expAt = one; + for t = T' i=i+1; if Nx>0 - expAt = expm(A*t); x = ( A\(expAt-one) )*B*u0 + expAt*x0; + expAt = expAt+expAdt; X(i,:) = x'; if Ny>0 y = C*x + D*u0; Y(i,:) = y'; end;