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
|
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2 1998/01/23 09:30:36 peterg
## Fixed a sign error - the coeficients of a(s) appear with - signs in
## the A_c matrix!
##
## Revision 1.1 1998/01/22 13:16:16 peterg
## Initial revision
##
###############################################################
# Inform user
echo Creating $1_ssk.r -- NOTE this is for SISO systems only.
# Remove the old log file
rm -f smc2ssk_r.log
# Use reduce to accomplish the transformation
reduce >smc2ssk_r.log << EOF
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
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
46
47
48
49
50
51
52
53
54
|
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3 1998/02/09 14:16:52 peterg
## Writes end statement to the o/p file
##
## Revision 1.2 1998/01/23 09:30:36 peterg
## Fixed a sign error - the coeficients of a(s) appear with - signs in
## the A_c matrix!
##
## Revision 1.1 1998/01/22 13:16:16 peterg
## Initial revision
##
###############################################################
Nu=`mtt_getsize $1 u`
Ny=`mtt_getsize $1 y`
if [ "$Nu" = "1" ]; then
if [ "$Ny" = "1" ]; then
blurb=' for this siso system'
else
blurb=" using first output of $Ny"
fi
else
if [ "$Ny" = "1" ]; then
blurb=" using first input of $Nu"
else
blurb=" using first input of $Nu and using first output of $Ny"
fi
fi
# Inform user
echo Creating $1_ssk.r $blurb
# Remove the old log file
rm -f smc2ssk_r.log
# Use reduce to accomplish the transformation
reduce >smc2ssk_r.log << EOF
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
OUT "$1_ssk.r";
%Write out the matrices.
write "% - Gain matrix - controller form";
MTT_Matrix := MTTK_c$
MTT_Matrix_name := "MTTK_c"$
MTT_Matrix_n := MTTNu$
MTT_Matrix_m := MTTNx$
Reduce_Matrix()$
write "% - Gain matrix - physical form";
MTT_Matrix := MTTK$
MTT_Matrix_name := "MTTK"$
MTT_Matrix_n := MTTNu$
MTT_Matrix_m := MTTNx$
Reduce_Matrix()$
write "END;";
SHUT "$1_ssk.r";
quit;
EOF
# Now invoke the standard error handling.
mtt_error_r smc2ssk_r.log
|
|
|
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
OUT "$1_ssk.r";
%Write out the matrices.
write "% - Gain matrix - controller form";
MTT_Matrix := MTTK_c$
MTT_Matrix_name := "MTTK_c"$
MTT_Matrix_n := 1$
MTT_Matrix_m := MTTNx$
Reduce_Matrix()$
write "% - Gain matrix - physical form";
MTT_Matrix := MTTK$
MTT_Matrix_name := "MTTK"$
MTT_Matrix_n := 1$
MTT_Matrix_m := MTTNx$
Reduce_Matrix()$
write "END;";
SHUT "$1_ssk.r";
quit;
EOF
# Now invoke the standard error handling.
mtt_error_r smc2ssk_r.log
|