1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: sm_r2m
# Reduce constained state-space A,B,C,D and E matrices to Matlab
# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94.
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5 1996/09/12 18:34:44 peter
## Back under rcs.
##
# Revision 1.4 1996/08/24 14:12:26 peter
# Global parameter passing.
#
## Revision 1.3 1996/08/19 18:38:43 peter
|
|
>
>
>
|
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
|
#!/bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: sm_r2m
# Reduce constained state-space A,B,C,D and E matrices to Matlab
# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94.
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.6 1997/02/24 14:43:21 peterg
# Now ignores parameters that are numerical.
#
## Revision 1.5 1996/09/12 18:34:44 peter
## Back under rcs.
##
# Revision 1.4 1996/08/24 14:12:26 peter
# Global parameter passing.
#
## Revision 1.3 1996/08/19 18:38:43 peter
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
IN "$1_sympar.r";
OUT "$1_sm.m";
%Headings - Matlab style
%(Note. The ;; are deleted by for2mat)
write "function [MTTA,MTTB,MTTC,MTTD] = $1_sm;;";
write "%function [MTTA,MTTB,MTTC,MTTD] = $1_sm;;";
write "%Linearised state matrices for system $1";
write "%File $1_sm.m";
write "%Generated by MTT";
IF MTTNvar>0 THEN
BEGIN
|
|
|
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
IN "$1_sympar.r";
OUT "$1_sm.m";
%Headings - Matlab style
%(Note. The ;; are deleted by for2mat)
write "function [A,B,C,D] = $1_sm(x);;";
write "%function [A,B,C,D] = $1_sm(x);;";
write "%Linearised state matrices for system $1";
write "%File $1_sm.m";
write "%Generated by MTT";
IF MTTNvar>0 THEN
BEGIN
|
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
ELSE
BEGIN
write MTTVar(i,1), " ...";
END;
END;
write " ";
END;
%Fortran switches - one line expressions
OFF echo;
ON fort$
cardno!* := 1$
fortwidth!* := 100$
|
>
>
>
>
>
>
>
>
>
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
ELSE
BEGIN
write MTTVar(i,1), " ...";
END;
END;
write " ";
END;
write "% Set the state (if given as an argument)";
write "if nargin>0";
FOR i := 1:MTTNx DO
write " mttx
", i, " = x(", i, ");";
write "end;";
write "";
%Fortran switches - one line expressions
OFF echo;
ON fort$
cardno!* := 1$
fortwidth!* := 100$
|