Overview
Comment:Now uses W in place of w for consistancy with time responses.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 08362f64e8a64343c5c90feb6c80e2d9122dd70b0618dcc905d1358895253d27
User & Date: gawthrop@users.sourceforge.net on 1996-08-15 16:23:02.000
Other Links: branch diff | manifest | tags
Context
1996-08-15
16:24:43
Uses T in place of t to avoid name clash within function. check-in: 6df02114e5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:23:02
Now uses W in place of w for consistancy with time responses. check-in: 08362f64e8 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:50:51
Put in a conj to undo effect of transpose. check-in: 22c8905b17 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
︙︙
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
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
75
76
# Copyright (c) P.J.Gawthrop, 1996.

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








## Revision 1.3  1996/08/11 19:08:08  peter
## Parameter passing now enabled.
##
## Revision 1.2  1996/08/11 09:32:12  peter
## Now takes the numpar parameters correctly
##
## Revision 1.1  1996/08/10 14:11:11  peter
## Initial revision
##
###############################################################

echo Creating $1_fr.m
echo Creating $1_lmfr.m
echo Creating $1_lpfr.m
echo Creating $1_nyfr.m
echo Creating $1_nifr.m

if [ "$2" = "" ]; 
then
  PARAMS='w=logspace(-1,2,100); u0=ones(nu,1);'
  echo Using default parameter $PARAMS
else
  PARAMS=$2;
fi

$MATRIX << EOF > dm2fr_m.log

  [nx,ny,nu,nz,nyz] = $1_def;
  $PARAMS

  %Defaults
  if exist('w')==0
    w = logspace(-1,2,100);
  end;

  if exist('u0')==0
    u0 = ones(nu,1);
  end;

  [n,m]=size(w);
  if m>n
    w=w';
  end;

  [A,B,C,D,E] = $1_dm($1_numpar);
  fr = dm2fr(A,B,C,D,E,w,u0);
  lw = log10(w);
  lmfr = log10(abs(fr));
  pfr = angle(fr)*180/pi;

% Complex frequency response
  write_matrix([w fr], '$1_fr');

% Log magnitude v log frequency
  write_matrix([lw lmfr], '$1_lmfr');

% Angle v log frequency
  write_matrix([lw pfr], '$1_lpfr');








>
>
>
>
>
>
>
>



















|











|
|






|

|



|
|




|







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
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
75
76
77
78
79
80
81
82
83
84
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4  1996/08/15 11:52:42  peter
## Now creats a number of versions:
## fr 	complex frequency response
## lmfr 	log  magnitude of fr
## lpfr  	phase of fr
## nyfr  	real and imag parts - Nyquist style
## nifr 	Nichols style.
##
## Revision 1.3  1996/08/11 19:08:08  peter
## Parameter passing now enabled.
##
## Revision 1.2  1996/08/11 09:32:12  peter
## Now takes the numpar parameters correctly
##
## Revision 1.1  1996/08/10 14:11:11  peter
## Initial revision
##
###############################################################

echo Creating $1_fr.m
echo Creating $1_lmfr.m
echo Creating $1_lpfr.m
echo Creating $1_nyfr.m
echo Creating $1_nifr.m

if [ "$2" = "" ]; 
then
  PARAMS='W=logspace(-1,2,100); u0=ones(nu,1);'
  echo Using default parameter $PARAMS
else
  PARAMS=$2;
fi

$MATRIX << EOF > dm2fr_m.log

  [nx,ny,nu,nz,nyz] = $1_def;
  $PARAMS

  %Defaults
  if exist('W')==0
    W = logspace(-1,2,100);
  end;

  if exist('u0')==0
    u0 = ones(nu,1);
  end;

  [n,m]=size(W);
  if m>n
    W=W';
  end;

  [A,B,C,D,E] = $1_dm($1_numpar);
  fr = dm2fr(A,B,C,D,E,W,u0);
  lw = log10(W);
  lmfr = log10(abs(fr));
  pfr = angle(fr)*180/pi;

% Complex frequency response
  write_matrix([W fr], '$1_fr');

% Log magnitude v log frequency
  write_matrix([lw lmfr], '$1_lmfr');

% Angle v log frequency
  write_matrix([lw pfr], '$1_lpfr');

︙︙

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