Overview
Context
Changes
Added mttroot/mtt/bin/trans/ssk2ctf_r version [d3b74537bb].
|
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: ssk2ctf_r
# Controller gain k and observer gain l to controller TF
# P.J.Gawthrop Feb 1998
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################
# Inform user
echo Creating $1_ctf.r
# Remove the old log file
rm -f ssk2ctf_r.log
# Use reduce to accomplish the transformation
reduce >ssk2ctf_r.log << EOF
in "$1_def.r";
in "$1_ssk.r";
in "$1_ssl.r";
in "$1_sm.r";
%Read the formatting function
in "$MTTPATH/trans/reduce_matrix.r";
OFF Echo;
OFF Nat;
%State matrices of the compensator
A_d := MTTA - MTTL*MTTC - MTTB*MTTK;
B_d := -MTTL;
C_d := -MTTK;
D_d := 0;
%Transfer function
MTTGc := C_d*((s*MTTI - A_d)^(-1))*B_d;
%Create the output file
OUT "$1_ctf.r";
%Write out the matrices.
write "% - Compensator TF";
MTT_Matrix := MTTGc$
MTT_Matrix_name := "MTTGc"$
MTT_Matrix_n := MTTNu$
MTT_Matrix_m := MTTNy$
Reduce_Matrix()$
SHUT "$1_ctf.r";
quit;
EOF
# Now invoke the standard error handling.
mtt_error_r ssk2ctf_r.log
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |