Project

General

Profile

Download (11.9 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:45:25
5
node  _max_real(x : real;
6
	y : real;)
7
returns(z : real;);
8
let
9
	z = if (x > y) then
10
		x
11
	    else y;
12
tel
13

    
14
node  _min_real(x : real;
15
	y : real;)
16
returns(z : real;);
17
let
18
	z = if (x < y) then
19
		x
20
	    else y;
21
tel
22

    
23
node  abs_real(x : real;)
24
returns(y : real;);
25
let
26
	y = if (x >= 0.0) then
27
		x
28
	    else (- x);
29
tel
30

    
31
(*
32
Original block name: LookupTableDynamic_4_PP/Saturation1
33
*)
34
node  Saturation1_80_284(In_1 : real;
35
	__time_step : real;
36
	__nb_step : int;)
37
returns(Out_1 : real;);
38
var lower_1 : real;
39
	lower_limit_1 : real;
40
	upper_1 : real;
41
	upper_limit_1 : real;
42
let
43
	lower_1 = _max_real(upper_1, lower_limit_1);
44
	lower_limit_1 = -1.000000000000000;
45
	upper_1 = _min_real(upper_limit_1, In_1);
46
	upper_limit_1 = 4.000000000000000;
47
	Out_1 = lower_1;
48
tel
49

    
50
(*
51
external node code for doing Lookup_nD
52
*)
53
node  LookupTableDynamic_79_290_ext_node(Saturation1_1 : real;
54
	Constant_1 : real;
55
	Constant_2 : real;
56
	Constant_3 : real;
57
	Constant_4 : real;
58
	Constant_5 : real;
59
	Constant_6 : real;
60
	Constant1_1 : real;
61
	Constant1_2 : real;
62
	Constant1_3 : real;
63
	Constant1_4 : real;
64
	Constant1_5 : real;
65
	Constant1_6 : real;)
66
returns(LookupTableDynamic_1 : real;);
67
var LookupTableDynamic_79_290_table_elem_1 : real;
68
	LookupTableDynamic_79_290_table_elem_2 : real;
69
	LookupTableDynamic_79_290_table_elem_3 : real;
70
	LookupTableDynamic_79_290_table_elem_4 : real;
71
	LookupTableDynamic_79_290_table_elem_5 : real;
72
	LookupTableDynamic_79_290_table_elem_6 : real;
73
	LookupTableDynamic_79_290_Breakpoints_dim1_1 : real;
74
	LookupTableDynamic_79_290_Breakpoints_dim1_2 : real;
75
	LookupTableDynamic_79_290_Breakpoints_dim1_3 : real;
76
	LookupTableDynamic_79_290_Breakpoints_dim1_4 : real;
77
	LookupTableDynamic_79_290_Breakpoints_dim1_5 : real;
78
	LookupTableDynamic_79_290_Breakpoints_dim1_6 : real;
79
	LookupTableDynamic_79_290_dimJump_1 : int;
80
	LookupTableDynamic_79_290_index_dim_1_1 : int;
81
	LookupTableDynamic_79_290_index_dim_1_2 : int;
82
	LookupTableDynamic_79_290_coords_dim_1_1 : real;
83
	LookupTableDynamic_79_290_coords_dim_1_2 : real;
84
	LookupTableDynamic_79_290_u_node_1 : real;
85
	LookupTableDynamic_79_290_N_shape_1 : real;
86
	LookupTableDynamic_79_290_u_node_2 : real;
87
	LookupTableDynamic_79_290_N_shape_2 : real;
88
	LookupTableDynamic_79_290_bound_node_index_1 : int;
89
	LookupTableDynamic_79_290_bound_node_index_2 : int;
90
	LookupTableDynamic_79_290_clip_input_1 : real;
91
let
92
	LookupTableDynamic_79_290_table_elem_1 = Constant1_1;
93
	LookupTableDynamic_79_290_table_elem_2 = Constant1_2;
94
	LookupTableDynamic_79_290_table_elem_3 = Constant1_3;
95
	LookupTableDynamic_79_290_table_elem_4 = Constant1_4;
96
	LookupTableDynamic_79_290_table_elem_5 = Constant1_5;
97
	LookupTableDynamic_79_290_table_elem_6 = Constant1_6;
98
	LookupTableDynamic_79_290_Breakpoints_dim1_1 = Constant_1;
99
	LookupTableDynamic_79_290_Breakpoints_dim1_2 = Constant_2;
100
	LookupTableDynamic_79_290_Breakpoints_dim1_3 = Constant_3;
101
	LookupTableDynamic_79_290_Breakpoints_dim1_4 = Constant_4;
102
	LookupTableDynamic_79_290_Breakpoints_dim1_5 = Constant_5;
103
	LookupTableDynamic_79_290_Breakpoints_dim1_6 = Constant_6;
104
	LookupTableDynamic_79_290_dimJump_1 = 1;
105
	LookupTableDynamic_79_290_index_dim_1_1 = if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_6) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
106
		5
107
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
108
		5
109
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
110
		4
111
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
112
		3
113
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
114
		2
115
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
116
		1
117
	    else 1;
118
	LookupTableDynamic_79_290_coords_dim_1_1 = if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_6) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
119
		LookupTableDynamic_79_290_Breakpoints_dim1_5
120
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
121
		LookupTableDynamic_79_290_Breakpoints_dim1_5
122
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
123
		LookupTableDynamic_79_290_Breakpoints_dim1_4
124
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
125
		LookupTableDynamic_79_290_Breakpoints_dim1_3
126
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
127
		LookupTableDynamic_79_290_Breakpoints_dim1_2
128
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
129
		LookupTableDynamic_79_290_Breakpoints_dim1_1
130
	    else LookupTableDynamic_79_290_Breakpoints_dim1_1;
131
	LookupTableDynamic_79_290_index_dim_1_2 = if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_6) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
132
		6
133
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
134
		6
135
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
136
		5
137
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
138
		4
139
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
140
		3
141
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
142
		2
143
	    else 2;
144
	LookupTableDynamic_79_290_coords_dim_1_2 = if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_6) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
145
		LookupTableDynamic_79_290_Breakpoints_dim1_6
146
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
147
		LookupTableDynamic_79_290_Breakpoints_dim1_6
148
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
149
		LookupTableDynamic_79_290_Breakpoints_dim1_5
150
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
151
		LookupTableDynamic_79_290_Breakpoints_dim1_4
152
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
153
		LookupTableDynamic_79_290_Breakpoints_dim1_3
154
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
155
		LookupTableDynamic_79_290_Breakpoints_dim1_2
156
	    else LookupTableDynamic_79_290_Breakpoints_dim1_2;
157
	LookupTableDynamic_79_290_bound_node_index_1 = (LookupTableDynamic_79_290_index_dim_1_1 * 1);
158
	LookupTableDynamic_79_290_u_node_1 = if (LookupTableDynamic_79_290_bound_node_index_1 = 1) then
159
		LookupTableDynamic_79_290_table_elem_1
160
	    else if (LookupTableDynamic_79_290_bound_node_index_1 = 2) then
161
		LookupTableDynamic_79_290_table_elem_2
162
	    else if (LookupTableDynamic_79_290_bound_node_index_1 = 3) then
163
		LookupTableDynamic_79_290_table_elem_3
164
	    else if (LookupTableDynamic_79_290_bound_node_index_1 = 4) then
165
		LookupTableDynamic_79_290_table_elem_4
166
	    else if (LookupTableDynamic_79_290_bound_node_index_1 = 5) then
167
		LookupTableDynamic_79_290_table_elem_5
168
	    else LookupTableDynamic_79_290_table_elem_6;
169
	LookupTableDynamic_79_290_bound_node_index_2 = (LookupTableDynamic_79_290_index_dim_1_2 * 1);
170
	LookupTableDynamic_79_290_u_node_2 = if (LookupTableDynamic_79_290_bound_node_index_2 = 1) then
171
		LookupTableDynamic_79_290_table_elem_1
172
	    else if (LookupTableDynamic_79_290_bound_node_index_2 = 2) then
173
		LookupTableDynamic_79_290_table_elem_2
174
	    else if (LookupTableDynamic_79_290_bound_node_index_2 = 3) then
175
		LookupTableDynamic_79_290_table_elem_3
176
	    else if (LookupTableDynamic_79_290_bound_node_index_2 = 4) then
177
		LookupTableDynamic_79_290_table_elem_4
178
	    else if (LookupTableDynamic_79_290_bound_node_index_2 = 5) then
179
		LookupTableDynamic_79_290_table_elem_5
180
	    else LookupTableDynamic_79_290_table_elem_6;
181
	LookupTableDynamic_79_290_clip_input_1 = Saturation1_1;
182
	LookupTableDynamic_79_290_N_shape_1 = ((LookupTableDynamic_79_290_coords_dim_1_2 - LookupTableDynamic_79_290_clip_input_1) / (LookupTableDynamic_79_290_coords_dim_1_2 - LookupTableDynamic_79_290_coords_dim_1_1));
183
	LookupTableDynamic_79_290_N_shape_2 = ((LookupTableDynamic_79_290_clip_input_1 - LookupTableDynamic_79_290_coords_dim_1_1) / (LookupTableDynamic_79_290_coords_dim_1_2 - LookupTableDynamic_79_290_coords_dim_1_1));
184
	LookupTableDynamic_1 = ( (LookupTableDynamic_79_290_N_shape_1 * LookupTableDynamic_79_290_u_node_1) + (LookupTableDynamic_79_290_N_shape_2 * LookupTableDynamic_79_290_u_node_2) );
185
tel
186

    
187
(*
188
Original block name: LookupTableDynamic_4_PP
189
*)
190
node  LookupTableDynamic_4_PP(In1_1 : real;)
191
returns(Out1_1 : real;);
192
var Constant_1 : real;
193
	Constant_2 : real;
194
	Constant_3 : real;
195
	Constant_4 : real;
196
	Constant_5 : real;
197
	Constant_6 : real;
198
	Constant1_1 : real;
199
	Constant1_2 : real;
200
	Constant1_3 : real;
201
	Constant1_4 : real;
202
	Constant1_5 : real;
203
	Constant1_6 : real;
204
	LookupTableDynamic_1 : real;
205
	Saturation1_1 : real;
206
	__time_step : real;
207
	__nb_step : int;
208
let
209
	Constant_1 = 2.000000000000000;
210
	Constant_2 = 3.000000000000000;
211
	Constant_3 = 4.000000000000000;
212
	Constant_4 = 5.000000000000000;
213
	Constant_5 = 6.000000000000000;
214
	Constant_6 = 7.000000000000000;
215
	Constant1_1 = 12.000000000000000;
216
	Constant1_2 = 23.000000000000000;
217
	Constant1_3 = 44.000000000000000;
218
	Constant1_4 = 25.000000000000000;
219
	Constant1_5 = 16.000000000000000;
220
	Constant1_6 = 7.000000000000000;
221
	LookupTableDynamic_1 = LookupTableDynamic_79_290_ext_node(Saturation1_1, Constant_1, Constant_2, Constant_3, Constant_4, Constant_5, Constant_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6);
222
	Saturation1_1 = Saturation1_80_284(In1_1, __time_step, __nb_step);
223
	Out1_1 = LookupTableDynamic_1;
224
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
225
	__nb_step = (0 -> ((pre __nb_step) + 1));
226
tel
227

    
(859-859/1153)