Overview
Comment:Put in version control history.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 532092897fc262dec3af9acc35301a8dd98704032fa0c6f0b140fdc1dd14c748
User & Date: gawthrop@users.sourceforge.net on 1996-12-05 10:17:34
Other Links: branch diff | manifest | tags
Context
1996-12-05
10:18:52
Saved (quite old) version which integrates IR to give SR check-in: e67a236326 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:17:34
Put in version control history. check-in: 532092897f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:05:28
Removed the Octave switch: empty_list_elements_ok = 1;
This is now in .octaverc
check-in: e4caa98b3c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/sm2ir.m from [3071e22744] to [cdcd279f9b].

1







2
3
4
5
6









7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9

10
11

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

+
+
+
+
+
+
+

-


-
+
+
+
+
+
+
+
+
+







function [Y,X] = sm2ir(A,B,C,D,T,u0,x0);
% sm2ir - Constrained-state matrix to impulse response.
%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  sm2ir
% [Y,X] = sm2ir(A,B,C,D,T,u0,x0);
% Constrained-state matrix to impulse response.
% A,B,C,D,E - (constrained) state matrices
% T vector of time points
% u0 input gain vector: u = u0*unit step.
% u0 input gain vector: u = u0*unit impulse.


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


[Ny,Nu] = size(D);
[Ny,Nx] = size(C);

if max(max(abs(D)))~=0
  mtt_info('D matrix non-zero - ignoring');
30
31
32
33
34
35
36




37

38
39
40
41
42


43
44
45
46
47
48
49
50
51
52
53
54
55
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74







+
+
+
+

+



-
-
+
+
















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
expAt = one;
i = 0;
x = (B*u0+x0);
for t = T'
  i=i+1;
  if Nx>0
    expAt = expm(A*t);
    x = expAt*(B*u0+x0);
    % expAt = expm(A*t);
    x = expAdt*x;
    X(i,:) = x';
    if Ny>0
      y = C*x;
      Y(i,:) = y';
    end;
  end;
end;







MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]