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.54 2000/09/30 14:10:06 peterg
## Zap lines containing "Remove in mtt_m2p"
##
## Revision 1.53 2000/08/24 17:10:59 peterg
## New dummy variables mtt_o (for optimisation), mtt_s (for segmentation)
##
## Revision 1.52 2000/08/24 08:30:45 peterg
## *** empty log message ***
##
## Revision 1.51 2000/08/01 12:25:24 peterg
|
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
+
-
-
+
+
-
+
+
|
echo " glmpbynp = StateMatrix;"
## echo " IntegrationMethod = 1..4;"
echo ""
echo "VAR"
echo " simpar : SimulationParameters;"
echo " t,ddt : REAL;"
echo " x,dx,AAx : StateVector;"
echo " mttx,mttdx,mttAAx,mttedx : StateVector;"
echo " u : InputVector;"
echo " y : OutputVector;"
echo " u,mttu : InputVector;"
echo " y,mtty : OutputVector;"
echo " par : ParameterVector;"
echo " mttpar : ParameterVector;"
echo " mttnpar : INTEGER;"
echo " AA : StateMatrix;"
echo " AA,mtte : StateMatrix;"
echo " MTTi,MTTj,it,iLast: INTEGER;"
##echo " mttSTEPFACTOR,mttWSTEPS,mttSTEPS,mttINPUT : INTEGER;"
## echo " mttMETHOD : IntegrationMethod;"
echo " open_switches : StateVector;"
echo " numparfile, statefile, simparfile : TEXT;"
echo ""
sympar_txt2declare $Sys p
;;
switchopen)
echo "PROCEDURE $Sys_rep(VAR open : StateVector; mttx : StateVector);"
echo "VAR"
echo " MTTi,MTTj : INTEGER;"
;;
*) echo "PROCEDURE $Sys_rep;"
|
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
-
+
-
-
-
+
+
+
|
printf("{%s %s_input.p}\n",inc,Sys)
if (Method=="euler") {
printf("{%s %s_ode.p}\n",inc,Sys)
printf("{%s %s_odeo.p}\n",inc,Sys)
}
if (Method=="implicit") {
printf("{%s %s_cse.p}\n",inc,Sys)
printf("{%s %s_csex.p}\n",inc,Sys)
printf("{%s %s_cseo.p}\n",inc,Sys)
printf("\n{%s %s_smxa.p}\n",inc,Sys);
printf("\n{%s %s_smxax.p}\n",inc,Sys);
}
printf("{%s %s_switchopen.p}\n\n",inc,Sys)
for (k=1;k<=j;k++) printf("%s\n", comment[k])
printf("\n")
printf("\nBEGIN{%s}\n", Sys_rep)
printf(" open(statefile,\"%s_state.dat\");\n", Sys)
printf(" open(simparfile,\"%s_simpar.dat\");\n", Sys)
printf(" open(numparfile,\"%s_numpar.dat\");\n", Sys)
}
else{
for (k=1;k<=j;k++) printf("%s\n", comment[k])
printf("\n")
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("x",Nx);
printvar("u",Nu);
printvar("y",Ny);
printvar("_s",Ns);
printvar("_o",No);
printf("VAR mtt_i, mtt_j : INTEGER;\n");
#if ( (rep=="smxa")||(rep=="smxax") ) {
# printvar("_t",Nt);
#}
|