Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 6b56dc0fe97a6233ac5159dc824deeb1fc4f9ef9eae3cfc812090ea3993a8a6e
User & Date: gawthrop@users.sourceforge.net on 1998-03-23 10:12:22
Other Links: branch diff | manifest | tags
Context
1998-03-23
12:55:01
Now writes out all the YY elements. check-in: beac6065ff user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:12:22
Initial revision check-in: 6b56dc0fe9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1998-03-22
21:14:03
Added obspar.r representation
Help now case insensitive
check-in: 25fba06bc7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/obs_r2m version [bb829d1948].



















































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
70
71
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
99
100
101
102
103
104
105
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: obs_r2m
# Reduce GPC obs function to matlab
# P.J.Gawthrop 18 May 1991, 12 Jan 1994, April 1994, Dec 1994, July 1995
# Copyright (c) P.J.Gawthrop 1991, 1994.

# Inform user
echo Creating $1_obs.m

# Remove the old log file
rm -f obs_r2m.log
rm -f $1_obs.m?

# Use reduce to accomplish the transformation
$SYMBOLIC >obs_r2m.log << EOF

%Read the reduce definitions file
in "$1_def.r";

%Set up the number of argument variables to zero in case the user has forgotten
MTTNVar := 0;

%Set default values - reset by obspar file.
MTTGPCNy := 2;
MTTGPCNu := 0;

%Read the parameters file
in "$1_obspar.r";

%Read the simplification file
in "$1_simp.r";

%Read the reduce state-space equations   file
in "$1_obs.r";


ON BigFloat, NumVal;
PRECISION 16; %Compatible with Matlab
OFF Nat;

ON NERO;        % Suppress zero elements

mtt_matrix := MTTYY;
mtt_matrix_n := MTTNY*MTTGPCNy;
mtt_matrix_m := 1;
mtt_matrix_name := Y;
in"$MTTPATH/trans/matlab_matrix.r";

OUT "$1_obs.m1";

write "function Y = $1_obs(x,u)";
write "%GPC O function in matlab form for system $1;;";
write "%File $1_obs.m;;";
write "%Generated by MTT;;";

write "%"; 
write "% Set up the State variables";
FOR i := 1:MTTNx DO
BEGIN
  write "mttx", i, " = x(", i, ");";
END;

write "%"; 
write "% Set up the inputs and input derivatives";
FOR i := 1:MTTNu DO
  BEGIN
    write "mttu", i, " = u(", i, ",1);";
    FOR j := 1:MTTGPCNu DO
    BEGIN
      write "mttu", i,j, " = u(", i, ",", j+1, ");";
    END;
  END;

write "%"; 
write "% Set up the Y matrix";
write "Y = zeros(", mtt_matrix_n, ",1);";


SHUT "$1_obs.m1";

GENTRANOUT "$1_obs.m3";
write "%"; 
write "% Translate the expression for Y";
matlab_matrix(); 
GENTRANSHUT "$1_obs.m3";

EOF

# Create the globals
sympar2global_txt2m $1> $1_obs.m2

# Change name
echo 'Y = mtt_matrix;' > $1_obs.m4
# Put together the pieces
cat   $1_obs.m? >$1_obs.m

rm -f $1_obs.m?




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