Differences From Artifact [2f584317f5]:

To Artifact [75e9fca884]:


11
12
13
14
15
16
17














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

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














## Revision 1.14.2.1  2001/03/19 00:29:08  geraint
## Parse switches (-A) before calling def2write_r.
## Update $1_def.* instead of removing.
##
## Revision 1.14  2000/12/28 12:24:35  peterg
## *** empty log message ***
##







>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.15.2.3  2001/05/09 00:19:22  geraint
## Fixed EOF error when MTTNYZ=0.
##
## Revision 1.15.2.2  2001/05/05 20:50:16  geraint
## Fixed errors when MTTNx=0.
##
## Revision 1.15.2.1  2001/05/04 04:07:24  geraint
## Numerical solution of algebraic equations.
## sys_ae.cc written for unsolved inputs.
## Solution of equations using hybrd from MINPACK (as used by Octave fsolve).
##
## Revision 1.15  2001/03/19 02:28:52  geraint
## Branch merge: merging-ode2odes-exe back to MAIN.
##
## Revision 1.14.2.1  2001/03/19 00:29:08  geraint
## Parse switches (-A) before calling def2write_r.
## Update $1_def.* instead of removing.
##
## Revision 1.14  2000/12/28 12:24:35  peterg
## *** empty log message ***
##
279
280
281
282
283
284
285
286
287


























288
289
290



291
292

293
294
295


296
297
298
299
300
301
302
303
304
305
306
307
308
309
  BEGIN
    MTT_sol_i := first(MTT_sol); MTT_sol := rest(MTT_sol);
    set(lhs(MTT_sol_i),rhs(MTT_sol_i));
  END;

  % No algebraic variables left!
  MTTNYz := 0;
END; % IF MTTNyz>0




























% Create the matrix declarations
OUT "$1_cse.r1";



write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; 
write "MATRIX MTTE(", MTTNx, ",", MTTNx, ")$"; 

SHUT "$1_cse.r1";

OUT "$1_csex.r1";


write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; 
SHUT "$1_csex.r1";

IF MTTNy>0 THEN
BEGIN
  OUT "$1_cseo.r1";
  write "MATRIX MTTY(", MTTNy, ",", MTTNx, ")$"; 
  SHUT "$1_cseo.r1";
END;

%%Create the _cse.r file
OUT "$1_cse.r2";
write "%File: $1_cse.r";
in ("$1_cse_write.r");







|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>
>
|
|
>



>
>
|





|







293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
  BEGIN
    MTT_sol_i := first(MTT_sol); MTT_sol := rest(MTT_sol);
    set(lhs(MTT_sol_i),rhs(MTT_sol_i));
  END;

  % No algebraic variables left!
  MTTNYz := 0;
END; % IF MTTNyz>0 and $solve

OUT "$1_ae.r";
IF (MTTNyz>0) THEN % not $solve (or perhaps solution failed?)
BEGIN
    WRITE "MATRIX MTTyz(",MTTNyz,",1)";
    WRITE "%File: $1_ae.r";
    FOR i := 1:MTTNyz DO
	WRITE "MTTyz(",i,",1) := ",MTTyz(i,1);
END; % if MTTNyz>0 (and !$solve)
WRITE ";END;";
SHUT "$1_ae.r";

OUT "$1_aej.r";
IF (MTTNyz>0) THEN % as above
BEGIN
    WRITE "MATRIX MTTyzj(",MTTNyz,",",MTTNyz,")";
    WRITE "%File: $1_aej.r";
    FOR i := 1:MTTNyz DO
	FOR j := 1:MTTNyz DO
	BEGIN
	   didj := df(MTTyz(i,1),mkid('mttui,j));
	   IF (didj NEQ 0) THEN
	      WRITE "MTTyzj(",i,",",j,") := ",didj;
	END;
END;
WRITE ";END;";
SHUT "$1_aej.r";

% Create the matrix declarations
OUT "$1_cse.r1";
write "%";
IF (MTTNx > 0) THEN
BEGIN
    write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; 
    write "MATRIX MTTE(", MTTNx, ",", MTTNx, ")$"; 
END;
SHUT "$1_cse.r1";

OUT "$1_csex.r1";
write "%File:$1_csex.r1";
IF (MTTNx > 0) THEN
    write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; 
SHUT "$1_csex.r1";

IF MTTNy>0 THEN
BEGIN
  OUT "$1_cseo.r1";
  write "MATRIX MTTY(", MTTNy, ",", 1, ")$"; 
  SHUT "$1_cseo.r1";
END;

%%Create the _cse.r file
OUT "$1_cse.r2";
write "%File: $1_cse.r";
in ("$1_cse_write.r");

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