Overview
Comment:Tidied up and reverted to \ version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 0b05b630e58ffd60803ff00158d40258d22e7f74df9b7d1d40404adbc463eb1d
User & Date: gawthrop@users.sourceforge.net on 2000-03-29 09:46:22
Other Links: branch diff | manifest | tags
Context
2000-03-29
11:52:56
Initial revision check-in: 00739ea236 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:46:22
Tidied up and reverted to \ version check-in: 0b05b630e5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2000-03-28
08:43:34
Zapped $1 etc -- just in case folks are using the old argument stuff. check-in: 7960a46cb6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/dm2fr.m from [e3aede7152] to [55c366535d].

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
41
function  fr = dm2fr(A,B,C,D,E,W,u0)
% fr = dm2fr(A,B,C,D,E,W,u0)
% Descriptor matrix to frequency response.
% A,B,C,D,E - descriptor matrices
% W vector of frequency points
% u0 input gain vector: u = u0*unit phasor

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




% %% Revision 1.7  1996/11/06  16:40:38  peterg
% %% Explicit definition of j
% %%
% %% Revision 1.6  1996/08/24  14:22:23  peter
% %% Put in a ; to avoid excessive log output.
% %%
% %% Revision 1.5  1996/08/16 14:26:37  peter
% %% Check and fix size of u0.
% %%
% %% Revision 1.4  1996/08/15 12:50:51  peter
% %% Put in a conj to undo effect of transpose.
% %%
% %% Revision 1.3  1996/08/15 11:53:44  peter
% %% Now has u0 input vector
% %%
% %% Revision 1.2  1996/08/15 10:24:28  peter
% %% Includes u0 argument.
% %%
% %% Revision 1.1  1996/08/10 14:11:28  peter
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


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

if nargin<7
  U0 = zeros(Nu,1);

|
|
|
|
|

|
|
|
|
|
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>







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
41
42
43
44
45
function  fr = dm2fr(A,B,C,D,E,W,u0)
# fr = dm2fr(A,B,C,D,E,W,u0)
# Descriptor matrix to frequency response.
# A,B,C,D,E - descriptor matrices
# W vector of frequency points
# u0 input gain vector: u = u0*unit phasor

# ###############################################################
# ## Version control history
# ###############################################################
# ## $Id$
# ## $Log$
# ## Revision 1.8  1997/06/13 13:05:38  peterg
# ## Replaced 'C*( (E*j*w - A) \ B*u0 ' by  C*( inv(E*j*w - A)*B*u0 ). \
# ## seems to have a bug for complex nos (??)
# ##
# ## Revision 1.7  1996/11/06  16:40:38  peterg
# ## Explicit definition of j
# ##
# ## Revision 1.6  1996/08/24  14:22:23  peter
# ## Put in a ; to avoid excessive log output.
# ##
# ## Revision 1.5  1996/08/16 14:26:37  peter
# ## Check and fix size of u0.
# ##
# ## Revision 1.4  1996/08/15 12:50:51  peter
# ## Put in a conj to undo effect of transpose.
# ##
# ## Revision 1.3  1996/08/15 11:53:44  peter
# ## Now has u0 input vector
# ##
# ## Revision 1.2  1996/08/15 10:24:28  peter
# ## Includes u0 argument.
# ##
# ## Revision 1.1  1996/08/10 14:11:28  peter
# ## Initial revision
# ##

# ###############################################################

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

if nargin<7
  U0 = zeros(Nu,1);
59
60
61
62
63
64
65



66
67
68
69
70
71
72
73
74
end;

j = sqrt(-1);
fr = zeros(N,Ny);
i = 0;
for w = W'
  i = i+1;



%%  FR = C*( (E*j*w - A) \ B*u0 ) + D*u0;
  FR = C*( inv(E*j*w - A)*B*u0 ) + D*u0;
  fr(i,:) = conj(FR');
end;












>
>
>
|
|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
end;

j = sqrt(-1);
fr = zeros(N,Ny);
i = 0;
for w = W'
  i = i+1;
  ##   EjA = E*j*w - A;
  ##   iEjA = conj(EjA)*inv(conj(EjA)*EjA);
  ##   FR = C*iEjA*B*u0 + D*u0;
  FR = C*( (E*j*w - A) \ B*u0 ) + D*u0;
  ## FR = C*( inv(E*j*w - A)*B*u0 ) + D*u0;
  fr(i,:) = conj(FR');
end;






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