Overview
Comment:Changed double to float.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 2ed0780548d9668b53a58eb4c78f73fc4fd9a58f10954a43f6b2a67212b765e7
User & Date: gawthrop@users.sourceforge.net on 1997-05-01 13:44:19
Other Links: branch diff | manifest | tags
Context
1997-05-01
13:51:37
Replaced float by double. check-in: 922f499085 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:44:19
Changed double to float. check-in: 2ed0780548 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:42:43
Chaged double to float check-in: 956a23cac9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/ode2odes_r2c from [ee1a7cc7a6] to [6b09ae24e2].

16
17
18
19
20
21
22



23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32







+
+
+







# Copyright (c) P.J.Gawthrop 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.3  1997/05/01  11:15:33  peterg
# Back under RCS
#
# Revision 1.2  1997/03/20  14:36:56  peterg
# Includes the sympar.h file
#
## Revision 1.1  1997/01/21 22:54:54  peterg
## Initial revision
##
###############################################################
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
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







-
-
-
-
+
+
+
+












-
-
+
+







write "#include ""$1_odes.h"" "$

%External (global) variable list
write "#include ""$1_sympar.h"" "$


write "/* Declare standard arrays */"$
write "double y[", MTTNy+1, "]; /* $1_ode output */"$
write "double dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ 
write "double x[", MTTNx+1, "]; /* $1_ode state */"$ 
write "double u[", MTTNu+1, "]; /* $1_ode input */"$
write "float y[", MTTNy+1, "]; /* $1_ode output */"$
write "float dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ 
write "float x[", MTTNx+1, "]; /* $1_ode state */"$ 
write "float u[", MTTNu+1, "]; /* $1_ode input */"$


write "/* Files */ "$
write "  FILE *fopen(), *fps, *fpso;"$

write "main()"$
write "  "$
write "{"$



write "/* Counters etc*/ "$
write "  double time;"$
write "  double dt;"$
write "  float time;"$
write "  float dt;"$
write "  int i;"$
write "  int k;"$

write "/*functions */ "$
write "  extern  $1_numpar();"$

%Open the output files

Modified mttroot/mtt/bin/trans/ode_r2c from [2a37f33be2] to [272e66ff00].

16
17
18
19
20
21
22



23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32







+
+
+







# Copyright (c) P.J.Gawthrop 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.3  1997/03/20  14:51:11  peterg
# Includes the sympar.c file.
#
# Revision 1.2  1997/01/21  22:57:17  peterg
# Various bug fixes.
#
## Revision 1.1  1997/01/21 10:52:23  peterg
## Initial revision
##
###############################################################
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
113
114
115
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
113
114
115
116
117
118







-
-
-
-
+
+
+
+



-
+


-
+






-
+





-
+








write "void $1_ode()"$

write "  "$
write "{"$

write "/* Declare standard arrays */"$
write "  extern double y[", MTTNy+1, "]; /* $1_ode output */"$
write "  extern double dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ 
write "  extern double x[", MTTNx+1, "]; /* $1_ode state */"$ 
write "  extern double u[", MTTNu+1, "]; /* $1_ode input */"$
write "  extern float y[", MTTNy+1, "]; /* $1_ode output */"$
write "  extern float dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ 
write "  extern float x[", MTTNx+1, "]; /* $1_ode state */"$ 
write "  extern float u[", MTTNu+1, "]; /* $1_ode input */"$

%Declare the dummy variables t0--t9
write "/* Dummy variable list */ "$
write "  double t0;"$
write "  float t0;"$
FOR i := 1:9 DO
BEGIN
  write "  double t", i, ";"$
  write "  float t", i, ";"$
END$

%Declarations$
write "/* State variable list */ "$
FOR i := 1:MTTNx DO
BEGIN
  write "  double mttx", i, ";"$
  write "  float mttx", i, ";"$
END$

write "/* Input variable list */ "$
FOR i := 1:MTTNu DO
BEGIN
  write "  double mttu", i, ";"$
  write "  float mttu", i, ";"$
END$

write "/* Counter */ "$
write "  int i;"$

write "/* Parameter  list */ "$
write "#include ", """$1_sympar.c"""$
131
132
133
134
135
136
137
138

139
140
141
142
143
144
145
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148







-
+







  END$
END$


write "  "$
write "    /*====== Compute the state derivative and output ======*/"$

SHUT $1_ode.c1
SHUT "$1_ode.c1";

% Load the general translator package
LOAD GENTRAN;
GENTRANLANG!* := 'C;
ON GENTRANSEG;
MAXEXPPRINTLEN!* := 80;


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