Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: cb07c753502798eae0a8c1a16bab2bd0692334dd1557849f2743d543a190f4c5
User & Date: gawthrop@users.sourceforge.net on 1996-08-11 09:45:46
Other Links: branch diff | manifest | tags
Context
1996-08-11
10:06:50
Now allows e format and NaN numbers. check-in: fa5c69c7a5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:45:46
Initial revision check-in: cb07c75350 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:32:12
Now takes the numpar parameters correctly check-in: 687a53f59f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/m/dm2sr.m version [dcd7ecbaa1].





































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
28
29
30
31
32
33
34
function sr = dm2sr(A,B,C,D,E,T);
% sr = dm2sr(A,B,C,D,E,T);
% Descriptor matrix to impulse response.
% NB At the moment - this assumes that E is unity .....
% A,B,C,D,E - descriptor matrices
% T vector of time points

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


[N,M] = size(T);
if M>N
  T = T';
  N = M;
end;

[Ny,Nu] = size(D);
NN=Ny*Nu;

[N_y,N_x] = size(C);
one = eye(N_x);

sr = zeros(N,NN);
i = 0;
for t = T'
  i=i+1;
  sr(i,:) = reshape(C*(1-exp(A*t))*B + D*ones(size(t)), 1,NN);
end;

Added mttroot/mtt/bin/trans/sm2sr_m version [255ad8ea1b].

















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: dm2sr

# Transforms descriptor matrix rep to step response


# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################

echo Creating $1_sr.dat

$MATRIX << EOF | awk '$1 !~ /[A-Za-z]/ && NF>0 {print} '  >$1_sr.dat

  tmax=2; tstep=tmax/100;
  T = [0:tstep:tmax]';
  [A,B,C,D,E] = $1_dm($1_numpar);
  y = dm2sr(A,B,C,D,E,T);

  [Ny,Nu]=size(D);
  NN = Ny*Nu;

  xy = [T y(:,1)];
  for i=2:NN
    xy = [xy T y(:,i)];
  end;
xy

EOF


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