Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / FromWorkSpace_interp_extrap_struct_PP.LUSTREC.lus @ cd1faebc

History | View | Annotate | Download (12 KB)

1
-- This file has been generated by CoCoSim2.
2

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

    
13
(*
14
external node code for doing Lookup_nD
15
*)
16
node  T_21436_002_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_21436_002_table_elem_1 : real;
19
	T_21436_002_table_elem_2 : real;
20
	T_21436_002_table_elem_3 : real;
21
	T_21436_002_table_elem_4 : real;
22
	T_21436_002_table_elem_5 : real;
23
	T_21436_002_table_elem_6 : real;
24
	T_21436_002_table_elem_7 : real;
25
	T_21436_002_table_elem_8 : real;
26
	T_21436_002_table_elem_9 : real;
27
	T_21436_002_table_elem_10 : real;
28
	T_21436_002_Breakpoints_dim1_1 : real;
29
	T_21436_002_Breakpoints_dim1_2 : real;
30
	T_21436_002_Breakpoints_dim1_3 : real;
31
	T_21436_002_Breakpoints_dim1_4 : real;
32
	T_21436_002_Breakpoints_dim1_5 : real;
33
	T_21436_002_Breakpoints_dim1_6 : real;
34
	T_21436_002_Breakpoints_dim1_7 : real;
35
	T_21436_002_Breakpoints_dim1_8 : real;
36
	T_21436_002_Breakpoints_dim1_9 : real;
37
	T_21436_002_Breakpoints_dim1_10 : real;
38
	T_21436_002_dimJump_1 : int;
39
	T_21436_002_index_dim_1_1 : int;
40
	T_21436_002_index_dim_1_2 : int;
41
	T_21436_002_coords_dim_1_1 : real;
42
	T_21436_002_coords_dim_1_2 : real;
43
	T_21436_002_u_node_1 : real;
44
	T_21436_002_N_shape_1 : real;
45
	T_21436_002_u_node_2 : real;
46
	T_21436_002_N_shape_2 : real;
47
	T_21436_002_bound_node_index_1 : int;
48
	T_21436_002_bound_node_index_2 : int;
49
	T_21436_002_clip_input_1 : real;
50
let
51
	T_21436_002_table_elem_1 = 3.000000000000000;
52
	T_21436_002_table_elem_2 = 4.000000000000000;
53
	T_21436_002_table_elem_3 = 5.000000000000000;
54
	T_21436_002_table_elem_4 = 6.000000000000000;
55
	T_21436_002_table_elem_5 = 7.000000000000000;
56
	T_21436_002_table_elem_6 = 8.000000000000000;
57
	T_21436_002_table_elem_7 = 9.000000000000000;
58
	T_21436_002_table_elem_8 = 20.000000000000000;
59
	T_21436_002_table_elem_9 = 32.000000000000000;
60
	T_21436_002_table_elem_10 = 33.000000000000000;
61
	T_21436_002_Breakpoints_dim1_1 = 1.000000000000000;
62
	T_21436_002_Breakpoints_dim1_2 = 2.000000000000000;
63
	T_21436_002_Breakpoints_dim1_3 = 3.000000000000000;
64
	T_21436_002_Breakpoints_dim1_4 = 4.000000000000000;
65
	T_21436_002_Breakpoints_dim1_5 = 5.000000000000000;
66
	T_21436_002_Breakpoints_dim1_6 = 6.000000000000000;
67
	T_21436_002_Breakpoints_dim1_7 = 7.000000000000000;
68
	T_21436_002_Breakpoints_dim1_8 = 8.000000000000000;
69
	T_21436_002_Breakpoints_dim1_9 = 9.000000000000000;
70
	T_21436_002_Breakpoints_dim1_10 = 10.000000000000000;
71
	T_21436_002_dimJump_1 = 1;
72
	T_21436_002_index_dim_1_1 = if ((D_1 >= T_21436_002_Breakpoints_dim1_10) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_10) <= 0.000000000000001776356839400250) then
73
		9
74
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_9) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_9) <= 0.000000000000001776356839400250) then
75
		9
76
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_8) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_8) <= 0.000000000000001776356839400250) then
77
		8
78
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000888178419700125) then
79
		7
80
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000888178419700125) then
81
		6
82
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000888178419700125) then
83
		5
84
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000888178419700125) then
85
		4
86
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
87
		3
88
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
89
		2
90
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
91
		1
92
	    else 1;
93
	T_21436_002_coords_dim_1_1 = if ((D_1 >= T_21436_002_Breakpoints_dim1_10) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_10) <= 0.000000000000001776356839400250) then
94
		T_21436_002_Breakpoints_dim1_9
95
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_9) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_9) <= 0.000000000000001776356839400250) then
96
		T_21436_002_Breakpoints_dim1_9
97
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_8) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_8) <= 0.000000000000001776356839400250) then
98
		T_21436_002_Breakpoints_dim1_8
99
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000888178419700125) then
100
		T_21436_002_Breakpoints_dim1_7
101
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000888178419700125) then
102
		T_21436_002_Breakpoints_dim1_6
103
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000888178419700125) then
104
		T_21436_002_Breakpoints_dim1_5
105
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000888178419700125) then
106
		T_21436_002_Breakpoints_dim1_4
107
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
108
		T_21436_002_Breakpoints_dim1_3
109
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
110
		T_21436_002_Breakpoints_dim1_2
111
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
112
		T_21436_002_Breakpoints_dim1_1
113
	    else T_21436_002_Breakpoints_dim1_1;
114
	T_21436_002_index_dim_1_2 = if ((D_1 >= T_21436_002_Breakpoints_dim1_10) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_10) <= 0.000000000000001776356839400250) then
115
		10
116
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_9) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_9) <= 0.000000000000001776356839400250) then
117
		10
118
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_8) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_8) <= 0.000000000000001776356839400250) then
119
		9
120
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000888178419700125) then
121
		8
122
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000888178419700125) then
123
		7
124
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000888178419700125) then
125
		6
126
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000888178419700125) then
127
		5
128
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
129
		4
130
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
131
		3
132
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
133
		2
134
	    else 2;
135
	T_21436_002_coords_dim_1_2 = if ((D_1 >= T_21436_002_Breakpoints_dim1_10) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_10) <= 0.000000000000001776356839400250) then
136
		T_21436_002_Breakpoints_dim1_10
137
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_9) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_9) <= 0.000000000000001776356839400250) then
138
		T_21436_002_Breakpoints_dim1_10
139
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_8) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_8) <= 0.000000000000001776356839400250) then
140
		T_21436_002_Breakpoints_dim1_9
141
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000888178419700125) then
142
		T_21436_002_Breakpoints_dim1_8
143
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000888178419700125) then
144
		T_21436_002_Breakpoints_dim1_7
145
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000888178419700125) then
146
		T_21436_002_Breakpoints_dim1_6
147
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000888178419700125) then
148
		T_21436_002_Breakpoints_dim1_5
149
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000444089209850063) then
150
		T_21436_002_Breakpoints_dim1_4
151
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000444089209850063) then
152
		T_21436_002_Breakpoints_dim1_3
153
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
154
		T_21436_002_Breakpoints_dim1_2
155
	    else T_21436_002_Breakpoints_dim1_2;
156
	T_21436_002_bound_node_index_1 = (T_21436_002_index_dim_1_1 * 1);
157
	T_21436_002_u_node_1 = if (T_21436_002_bound_node_index_1 = 1) then
158
		T_21436_002_table_elem_1
159
	    else if (T_21436_002_bound_node_index_1 = 2) then
160
		T_21436_002_table_elem_2
161
	    else if (T_21436_002_bound_node_index_1 = 3) then
162
		T_21436_002_table_elem_3
163
	    else if (T_21436_002_bound_node_index_1 = 4) then
164
		T_21436_002_table_elem_4
165
	    else if (T_21436_002_bound_node_index_1 = 5) then
166
		T_21436_002_table_elem_5
167
	    else if (T_21436_002_bound_node_index_1 = 6) then
168
		T_21436_002_table_elem_6
169
	    else if (T_21436_002_bound_node_index_1 = 7) then
170
		T_21436_002_table_elem_7
171
	    else if (T_21436_002_bound_node_index_1 = 8) then
172
		T_21436_002_table_elem_8
173
	    else if (T_21436_002_bound_node_index_1 = 9) then
174
		T_21436_002_table_elem_9
175
	    else T_21436_002_table_elem_10;
176
	T_21436_002_bound_node_index_2 = (T_21436_002_index_dim_1_2 * 1);
177
	T_21436_002_u_node_2 = if (T_21436_002_bound_node_index_2 = 1) then
178
		T_21436_002_table_elem_1
179
	    else if (T_21436_002_bound_node_index_2 = 2) then
180
		T_21436_002_table_elem_2
181
	    else if (T_21436_002_bound_node_index_2 = 3) then
182
		T_21436_002_table_elem_3
183
	    else if (T_21436_002_bound_node_index_2 = 4) then
184
		T_21436_002_table_elem_4
185
	    else if (T_21436_002_bound_node_index_2 = 5) then
186
		T_21436_002_table_elem_5
187
	    else if (T_21436_002_bound_node_index_2 = 6) then
188
		T_21436_002_table_elem_6
189
	    else if (T_21436_002_bound_node_index_2 = 7) then
190
		T_21436_002_table_elem_7
191
	    else if (T_21436_002_bound_node_index_2 = 8) then
192
		T_21436_002_table_elem_8
193
	    else if (T_21436_002_bound_node_index_2 = 9) then
194
		T_21436_002_table_elem_9
195
	    else T_21436_002_table_elem_10;
196
	T_21436_002_clip_input_1 = D_1;
197
	T_21436_002_N_shape_1 = ((T_21436_002_coords_dim_1_2 - T_21436_002_clip_input_1) / (T_21436_002_coords_dim_1_2 - T_21436_002_coords_dim_1_1));
198
	T_21436_002_N_shape_2 = ((T_21436_002_clip_input_1 - T_21436_002_coords_dim_1_1) / (T_21436_002_coords_dim_1_2 - T_21436_002_coords_dim_1_1));
199
	T_1 = ( (T_21436_002_N_shape_1 * T_21436_002_u_node_1) + (T_21436_002_N_shape_2 * T_21436_002_u_node_2) );
200
tel
201

    
202
(*
203
Original block name: FromWorkSpace_interp_extrap_struct_PP/FromWorkspace
204
*)
205
node  FromWorkspace_19_080(__time_step : real;
206
	__nb_step : int;)
207
returns(Out1_1 : real;);
208
var D_1 : real;
209
	T_1 : real;
210
let
211
	D_1 = if ((__nb_step mod 1) = 0) then
212
		__time_step
213
	    else if (__nb_step = 0) then
214
		0.0
215
	    else (pre D_1);
216
	T_1 = T_21436_002_ext_node(D_1);
217
	Out1_1 = T_1;
218
tel
219

    
220
(*
221
Original block name: FromWorkSpace_interp_extrap_struct_PP
222
*)
223
node  FromWorkSpace_interp_extrap_struct_PP(_virtual : bool;)
224
returns(Out1_1 : real;);
225
var FromWorkspace_1 : real;
226
	__time_step : real;
227
	__nb_step : int;
228
let
229
	FromWorkspace_1 = FromWorkspace_19_080(__time_step, __nb_step);
230
	Out1_1 = FromWorkspace_1;
231
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
232
	__nb_step = (0 -> ((pre __nb_step) + 1));
233
tel
234