Differences From Artifact [55395e3ee1]:

To Artifact [a962e03b00]:


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
39


40


41
42
43
44
45
46
47
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
39
40


41
42
43
44
45
46
47
48
49
50
51
52







+
+
+















-
+




-
-
+
+

+
+







# Copyright (c) P.J.Gawthrop, 1990, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  1996/08/25 09:52:20  peter
## Initial revision
##
###############################################################

#Inform user
echo Creating $1_ss.r

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

# Use reduce to accomplish the transformation
reduce >sspar2ss_r.log << EOF

%Read the definition file
in "$1_def.r";

%Read the constitutive relationships (May be used in rss file). 
in "$1_cr.r";
%in "$1_cr.r";

%Read the steady-state values 
in "$1_sspar.r";

%Read in the parameter file
in "$1_sympar.r";
%Read in the constrained-state equation
%in "$1_cse.r";

%Read in the ode
%in "$1_ode.r";

OFF Echo;
OFF Nat;
OUT "$1_ss.r";


%Write out the steady-state values (if any)
60
61
62
63
64
65
66


67


68


69


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91






















92
93
94
95
96
97
98
99
100
65
66
67
68
69
70
71
72
73

74
75
76
77
78
79
80
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
111
112







+
+
-
+
+

+
+

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










IF MTTNy>0 THEN
BEGIN
  write "matrix MTTY0(", MTTNy, ",1)";
END;
MTTY0 := MTTY;

IF MTTNx>0 THEN
  write "matrix MTTdX0(", MTTNx, ",1)";
%Write them out by component - but only if values have been set

MTTdX0 := MTTdX;


%Write them out by component - but only if values have been set
%(This assumes that if element 1 not set then the rest aren't either)
%ON Rounded; %Make numbers have dec. points-- nice for c
%
clear MTTx1;
IF MTTNx>0 THEN
IF MTTX0(1,1) NEQ MTTX1 THEN
FOR i := 1:MTTNx DO
BEGIN
  write "MTTX", i, " := ", MTTX0(i,1);
END;

clear MTTu1;
IF MTTNu>0 THEN
IF MTTu0(1,1) NEQ MTTu1 THEN
FOR i := 1:MTTNu DO
BEGIN
  write "MTTu", i, " := ", MTTu0(i,1);
END;

%Derivatives are zero in the steady-state
IF MTTNz>0 THEN
FOR i := 1:MTTNz DO
BEGIN
  write "MTTdz", i, " := 0";
END;
%clear MTTx1;
%IF MTTNx>0 THEN
%IF MTTX0(1,1) NEQ MTTX1 THEN
%FOR i := 1:MTTNx DO
%BEGIN
%  write "MTTx", i, " := ", MTTX0(i,1);
%END;
%
%clear MTTu1;
%IF MTTNu>0 THEN
%IF MTTu0(1,1) NEQ MTTu1 THEN
%FOR i := 1:MTTNu DO
%BEGIN
%  write "MTTu", i, " := ", MTTu0(i,1);
%END;
%
%%Derivatives are zero in the steady-state
%IF MTTNz>0 THEN
%FOR i := 1:MTTNz DO
%BEGIN
%  write "MTTdz", i, " := 0";
%END;

write "END;";

SHUT "$1_ss.r";
quit;
EOF

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

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