Overview
Comment:SMX now generates both A and Ax
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: d53ca510c5689467ccc2c670023bc5300c80c456b3ed85dec284cd511cdb1e42
User & Date: gawthrop@users.sourceforge.net on 1998-08-26 18:25:45
Other Links: branch diff | manifest | tags
Context
1998-08-26
19:07:17
Euler or Implicit only check-in: 1933fb3af7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:25:45
SMX now generates both A and Ax check-in: d53ca510c5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:45:38
Just prefix ports (comps can't start with numeral)
Prefix with mttp
check-in: fac295bf99 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/ode2smx_lang from [ee8dd49db0] to [f9b42e6633].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1998

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



## Revision 1.4  1998/08/13 09:03:35  peterg
## *** empty log message ***
##
## Revision 1.3  1998/07/30 10:49:55  peterg
## Removed zeroing.
##
## Revision 1.2  1998/07/30 10:49:02  peterg







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5  1998/08/15 13:51:56  peterg
## smx is now I-Adt NOT A
##
## Revision 1.4  1998/08/13 09:03:35  peterg
## *** empty log message ***
##
## Revision 1.3  1998/07/30 10:49:55  peterg
## Removed zeroing.
##
## Revision 1.2  1998/07/30 10:49:02  peterg
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
else
    lang="r"
fi


# Inform user
echo Creating $1_smx.$lang
echo Creating $1_smxx.$lang
echo Creating $1_smxtx.$lang

# Remove the old log file
rm -f ode2smx_r.log

rm -f $1_smx.$lang
rm -f $1_smxx.$lang
rm -f $1_smxtx.$lang







|
|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
else
    lang="r"
fi


# Inform user
echo Creating $1_smx.$lang
#echo Creating $1_smxx.$lang
#echo Creating $1_smxtx.$lang

# Remove the old log file
rm -f ode2smx_r.log

rm -f $1_smx.$lang
rm -f $1_smxx.$lang
rm -f $1_smxtx.$lang
94
95
96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


126
127
128
129
130
131
132
      write "matrix mtta(", mttnx, ",", mttnx, ");";    
      write "matrix mttb(", mttnx, ",", mttnu, ");";    
      write "matrix mttc(", mttny, ",", mttnx, ");";    
      write "matrix mttd(", mttny, ",", mttnu, ");";    
    END;

% find MTTA : the A matrix
  matrix mttAAx(MTTNx,1);
  matrix mttAAtx(MTTNx,1);
  FOR i := 1:MTTNx DO
  BEGIN

    xi := MTTX(i,1);
    FOR j := 1:MTTNx DO
    BEGIN
      xj := MTTX(j,1);
      a_ij := df(MTTdx(i,1), xj, 1);
      a_ji := df(MTTdx(j,1), xi, 1);
      IF i=j THEN
      BEGIN
        aa_ij := 1 - mttdt*a_ij;
        aa_ji := aa_ij;
      END
      ELSE
      BEGIN
        aa_ij := -mttdt*a_ij;
        aa_ji := -mttdt*a_ji;
      END;
      IF (aa_ij NEQ 0) THEN
        GENTRAN mtta(i,j) ::=: aa_ij;
      mttAAx(i,1) := mttAAx(i,1) + aa_ij*mkid(mttxx,j);
      mttAAtx(i,1) := mttAAtx(i,1) + aa_ji*mkid(mttxx,j);
    END;


  END;



%% Find MTTB : the B matrix
%  FOR j := 1:MTTNu DO
%    BEGIN







<
<


>


















|
|

>
>







97
98
99
100
101
102
103


104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
      write "matrix mtta(", mttnx, ",", mttnx, ");";    
      write "matrix mttb(", mttnx, ",", mttnu, ");";    
      write "matrix mttc(", mttny, ",", mttnx, ");";    
      write "matrix mttd(", mttny, ",", mttnu, ");";    
    END;

% find MTTA : the A matrix


  FOR i := 1:MTTNx DO
  BEGIN
    mttAAx_i := 0;
    xi := MTTX(i,1);
    FOR j := 1:MTTNx DO
    BEGIN
      xj := MTTX(j,1);
      a_ij := df(MTTdx(i,1), xj, 1);
      a_ji := df(MTTdx(j,1), xi, 1);
      IF i=j THEN
      BEGIN
        aa_ij := 1 - mttdt*a_ij;
        aa_ji := aa_ij;
      END
      ELSE
      BEGIN
        aa_ij := -mttdt*a_ij;
        aa_ji := -mttdt*a_ji;
      END;
      IF (aa_ij NEQ 0) THEN
        GENTRAN mtta(i,j) ::=: aa_ij;
      mttAAx_i := mttAAx_i + aa_ij*mkid(mttxx,j);
      %%%mttAAtx(i,1) := mttAAtx(i,1) + aa_ji*mkid(mttxx,j);
    END;
    IF (mttAAx_i NEQ 0) THEN
      GENTRAN mttax(i) ::=: mttAAx_i;
  END;



%% Find MTTB : the B matrix
%  FOR j := 1:MTTNu DO
%    BEGIN
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
%      WriteElement("mttd",i,j,df(MTTY(i,1), xj, 1));
%    END;

%Shut the  output according to the language.
 GENTRANSHUT "$1_smx.$lang";


% The AAx matrix;
GENTRANOUT "$1_smxx.$lang";
FOR i := 1:MTTNx DO
BEGIN
  ax_i := mttAAx(i,1);
  IF (ax_i NEQ 0) THEN
    GENTRAN mttax(i) ::=: ax_i;
END
GENTRANSHUT "$1_smxx.$lang";

% The AAtx matrix;
GENTRANOUT "$1_smxtx.$lang";
FOR i := 1:MTTNx DO
BEGIN
  atx_i := mttAAtx(i,1);
  IF (atx_i NEQ 0) THEN
    GENTRAN mttax(i) ::=: atx_i;
END
GENTRANSHUT "$1_smxtx.$lang";

EOF

if [ "$lang" = "m" ]; then
  mv $1_smx.$lang  mtt_junk
  lang_header $1 smx m 'mttx,mttu,mttdt' '[mtta]' > $1_smx.m
  cat mtt_junk | mtt_p2m >> $1_smx.m
  rm -f mtt_junk

  mv $1_smxx.$lang  mtt_junk
  lang_header $1 smxx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxx.m
  cat mtt_junk | mtt_p2m >> $1_smxx.m
  rm -f mtt_junk

  mv $1_smxtx.$lang  mtt_junk
  lang_header $1 smxtx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxtx.m
  cat mtt_junk | mtt_p2m >> $1_smxtx.m
  rm -f mtt_junk


fi

# Now invoke the standard error handling.
mtt_error_r ode2smx_lang.log











|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|





|



|
|
|
|
|
|
|
|
|
|
|








155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
%      WriteElement("mttd",i,j,df(MTTY(i,1), xj, 1));
%    END;

%Shut the  output according to the language.
 GENTRANSHUT "$1_smx.$lang";


%% The AAx matrix;
%GENTRANOUT "$1_smxx.$lang";
%FOR i := 1:MTTNx DO
%BEGIN
%  ax_i := mttAAx(i,1);
%  IF (ax_i NEQ 0) THEN
%    GENTRAN mttax(i) ::=: ax_i;
%END
%GENTRANSHUT "$1_smxx.$lang";
%
%% The AAtx matrix;
%GENTRANOUT "$1_smxtx.$lang";
%FOR i := 1:MTTNx DO
%BEGIN
%  atx_i := mttAAtx(i,1);
%  IF (atx_i NEQ 0) THEN
%    GENTRAN mttax(i) ::=: atx_i;
%END
%GENTRANSHUT "$1_smxtx.$lang";

EOF

if [ "$lang" = "m" ]; then
  mv $1_smx.$lang  mtt_junk
  lang_header $1 smx m 'mttx,mttu,mttdt,mttxx' '[mtta,mttax]' > $1_smx.m
  cat mtt_junk | mtt_p2m >> $1_smx.m
  rm -f mtt_junk

#  mv $1_smxx.$lang  mtt_junk
#  lang_header $1 smxx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxx.m
#  cat mtt_junk | mtt_p2m >> $1_smxx.m
#  rm -f mtt_junk
#
#  mv $1_smxtx.$lang  mtt_junk
#  lang_header $1 smxtx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxtx.m
#  cat mtt_junk | mtt_p2m >> $1_smxtx.m
#  rm -f mtt_junk
#
#
fi

# Now invoke the standard error handling.
mtt_error_r ode2smx_lang.log





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