Differences From Artifact [1ec895e0c4]:

To Artifact [acbac27d53]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1998

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



## Revision 1.16  1998/08/19 08:46:00  peterg
## Now translates ; % to #
##
## Revision 1.15  1998/08/15 13:46:01  peterg
## Included new sparse update routines
##
## Revision 1.14  1998/08/12 15:21:12  peterg







>
>
>







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.17  1998/08/27 07:38:40  peterg
## About to change to new integration (Euler/Implicit only)
##
## Revision 1.16  1998/08/19 08:46:00  peterg
## Now translates ; % to #
##
## Revision 1.15  1998/08/15 13:46:01  peterg
## Included new sparse update routines
##
## Revision 1.14  1998/08/12 15:21:12  peterg
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
    odeo)
	echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;"
	echo "                       mttx : StateVector;"
	echo "                       mttu : InputVector;"
	echo "                       mttt : REAL);"
	;;
    smx)
	echo "PROCEDURE $Sys_rep(VAR mtta : StateMatrix;"
	echo "                   VAR mttx : StateVector;"
	echo "                   VAR mttu : InputVector;"
	echo "                       mttdt : REAL);"
	;;
    smxx|smxtx)
	echo "PROCEDURE $Sys_rep(VAR mttax : StateVector;"
	echo "                       mttx  : StateVector;"
	echo "                       mttu  : InputVector;"
	echo "                       mttxx : StateVector;"
	echo "                       mttdt : REAL);"
	;;
    ode2odes)
	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;"







|
|
|
<
<
<
<
|
<
<
<







107
108
109
110
111
112
113
114
115
116




117



118
119
120
121
122
123
124
    odeo)
	echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;"
	echo "                       mttx : StateVector;"
	echo "                       mttu : InputVector;"
	echo "                       mttt : REAL);"
	;;
    smx)
	echo "PROCEDURE $Sys_rep(VAR mtta       : StateMatrix;"
	echo "                   VAR mttax,mttx : StateVector;"
	echo "                   VAR mttu       : InputVector;"




	echo "                       mttdt      : REAL);"



	;;
    ode2odes)
	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;"
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252

253
254
255
256
257
258
259
        doing_header = 1
      }
    }
    else 
    {
      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])
          printvar("x",Nx);
          printvar("u",Nu);
          printvar("y",Ny);
          printvar("_t",Nt);

          printf("\n{%s %s_smx.p}\n",inc,sys)
          printf("{%s %s_smxx.p}\n",inc,sys)
          printf("{%s %s_smxtx.p}\n\n",inc,sys)

          printf("\nPROCEDURE mtt_asub(VAR x,y : StateVector; n : INTEGER);\n");
          printf("{Sparse update routine -- y = Ax}\n");
          printf("BEGIN {asub}\n");
          printf("  %s_smxx(y,mttx,mttu,x,mttdt);\n", Sys);
          printf("END {asub};\n");
          printf("\nPROCEDURE mtt_atsub(VAR x,y : StateVector; n : INTEGER);\n");
          printf("{Sparse update routine -- y = ATx}\n");
          printf("BEGIN {atsub}\n");
          printf("  %s_smxtx(y,mttx,mttu,x,mttdt);\n", Sys);
          printf("END {atsub};\n\n");

          printf("\n{%s sign.p}\n",inc,sys)
          printf("{%s mtt_update.p}\n",inc)

          printf("{%s mtt_write.p}\n",inc)
          printf("{%s zero_matrix.p}\n",inc)
          printf("{%s zero_vector.p}\n",inc)
          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)







|
|







<
<
<
<
<
<
<
<
<
<
<
<
<
<

|
>







217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232














233
234
235
236
237
238
239
240
241
242
        doing_header = 1
      }
    }
    else 
    {
      if (doing_header==1){
        if (rep=="ode2odes"){
          printf("VAR \n");
          for (k=1;k<i;k++) printf("  %s,\n",global[k])
          printf("%s : REAL;\n", global[i])
          printvar("x",Nx);
          printvar("u",Nu);
          printvar("y",Ny);
          printvar("_t",Nt);

          printf("\n{%s %s_smx.p}\n",inc,sys)














          printf("\n{%s sign.p}\n",inc,sys)
          printf("{%s mtt_euler.p}\n",inc)
          printf("{%s mtt_implicit.p}\n",inc)
          printf("{%s mtt_write.p}\n",inc)
          printf("{%s zero_matrix.p}\n",inc)
          printf("{%s zero_vector.p}\n",inc)
          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)

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