Overview
Comment:Replaced t0..t9 by mtt_temp0..
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 808aca4c0e56036b071a9dd4cfc116310bad2bd4ca3de205a291ad64067875a7
User & Date: gawthrop@users.sourceforge.net on 1998-07-26 19:38:17
Other Links: branch diff | manifest | tags
Context
1998-07-27
06:47:32
Initial revision check-in: 58d92c923d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1998-07-26
19:38:17
Replaced t0..t9 by mtt_temp0.. check-in: 808aca4c0e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:51:15
Initial revision check-in: 2a27bcb9cc user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_m2p from [8a735f8e01] to [be6098f632].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+







# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.7  1998/07/25 20:06:23  peterg
## Does the mtt_update function
##
## Revision 1.6  1998/07/25 16:59:40  peterg
## Give other procedures local i,j vars.
##
## Revision 1.5  1998/07/25 15:06:17  peterg
## Added DDT VAR
##
## Revision 1.4  1998/07/25 15:05:54  peterg
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
106
107
108
109
110
84
85
86
87
88
89
90






91
92
93
94
95
96
97
98
99
100
101

102
103
104
105

106
107
108
109
110
111
112
113







-
-
-
-
-
-
+
+
+
+
+
+





-
+



-
+







	echo "PROGRAM $Sys_rep;"
	echo "TYPE"
	echo "    StateVector  =ARRAY[1..$Nx] OF REAL;"
	echo "    InputVector  =ARRAY[1..$Nu] OF REAL;"
	echo "    OutputVector =ARRAY[1..$Ny] OF REAL;"
	echo "    IntegrationMethod = (Euler,ImplicitL,Implicit);"
	echo "VAR"
        echo "    t,LAST,DT,DDT   : REAL;"
	echo "    mttx,mttdx      : StateVector;"
	echo "    mttu            : InputVector;"
	echo "    mtty            : OutputVector;"
	echo "    i,j,it,iLast,STEPFACTOR : INTEGER;"
	echo "    METHOD : STRING;"
        echo "    MTTt,mttLAST,mttDT,mttDDT   : REAL;"
	echo "    mttx,mttdx                  : StateVector;"
	echo "    mttu                        : InputVector;"
	echo "    mtty                        : OutputVector;"
	echo "    MTTi,MTTj,MTTit,MTTiLast,mttSTEPFACTOR : INTEGER;"
	echo "    mttMETHOD : STRING;"
        ;;
    switch)
	echo "PROCEDURE $Sys_rep(VAR mttxs : StateVector;"
	echo "                       mttx  : StateVector);"
	echo "VAR"
	echo "    i,j :  INTEGER;"
	echo "    MTTi,MTTj :  INTEGER;"
	;;
    *)	echo "PROCEDURE $Sys_rep;"
	echo "VAR"
	echo "    i,j :  INTEGER;"
	echo "    MTTi,MTTj :  INTEGER;"
        ;;
esac) > $Filename

cat<<EOF >> $Filename

{*** System $Sys, rep $rep, language Pascal, file $Filename ***}
{*** Translated by MTT from $Sys_rep.m on `date` ***}
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
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







-
+

+
+
+







-
-







      if (doing_header==1){
        if (rep=="ode2odes"){
          printf("VAR ");
          for (k=1;k<i;k++) printf("%s,",global[k])
          printf("%s : REAL;\n", global[i])
          printf("VAR "); for (k=1;k<=Nx;k++) printf("mttx%i,", k)
          for (k=1;k<=Nu;k++) printf("mttu%i,", k)
          for (k=0;k<Nt;k++) printf("t%i,", k)
          for (k=0;k<Nt;k++) printf("mtt_temp%i,", k)
          printf("t%i : REAL;\n",Nt) 
          printf("{%s sign.p}\n",inc,sys)
          printf("{%s mtt_update.p}\n",inc,sys)
          printf("{%s mtt_write.p}\n",inc,sys)
          printf("{%s %s_simpar.p}\n",inc,sys) 
          printf("{%s %s_numpar.p}\n",inc,sys)
          printf("{%s %s_state.p}\n",inc,sys)
          printf("{%s %s_input.p}\n",inc,sys)
          printf("{%s %s_ode.p}\n",inc,sys)
          printf("{%s %s_odeo.p}\n",inc,sys)
          printf("{%s %s_switch.p}\n",inc,sys)
          printf("{%s mtt_update.p}\n",inc,sys)
          printf("{%s mtt_write.p}\n",inc,sys)
        }
        for (k=1;k<=j;k++) printf("%s\n", comment[k])
        printf("\n")
        printf("\nBEGIN\n")
        doing_header = 0;
      }
      if (match($1,comment_regexp)>0){
193
194
195
196
197
198
199


200
201
202
203
204
205
206
207
208
209
210
211

212
213
214
215
216
217
218
219


220
221
222
223
224
225
226
227
228
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216

217
218
219
220
221
222
223
224

225
226
227
228
229
230
231
232
233
234
235







+
+











-
+







-
+
+









          sub(/:/," TO ",$0)
          sub(/=/,":=",$0)
          printf("%s DO BEGIN\n", $0) 
          }
          else {
            sub(/=/,":=",$0)
            gsub(/\^/,"**",$0)
            gsub(/&&/," AND ",$0)
            gsub(/\|\|/," OR ",$0)
            printf("%s\n",$0)
          }
        }
      }
    }
  }
}
END{
  if (rep=="def"){
    printf("EULER = 1,\n")
    printf("IMPLICITL = 2;\n")
    printf("IMPLICIT3 = 3;\n")
    printf("IMPLICIT = 3;\n")
    }
    else
      if (rep=="ode2odes")
        print "END."
      else
        print "END;"
}' sys=$sys rep=$rep Nx=$Nx Nu=$Nu |\
sed 's/(\([ijk0-9]*\))/\[\1\]/g' \
sed 's/(\([ijk0-9]*\))/\[\1\]/g'  |\
sed 's/(\(MTT[ijk0-9]*\))/\[\1\]/g' \
>> $Filename

# p2c doesn't like mixed case filenames!
if [ "$Filename" != "$filename" ]; then
  echo Creating $filename
  cp -f $Filename $filename
fi



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