Project

General

Profile

Download (10.2 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:39:41
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_21942_004_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_21942_004_table_elem_1 : real;
19
	T_21942_004_table_elem_2 : real;
20
	T_21942_004_table_elem_3 : real;
21
	T_21942_004_table_elem_4 : real;
22
	T_21942_004_table_elem_5 : real;
23
	T_21942_004_table_elem_6 : real;
24
	T_21942_004_table_elem_7 : real;
25
	T_21942_004_table_elem_8 : real;
26
	T_21942_004_Breakpoints_dim1_1 : real;
27
	T_21942_004_Breakpoints_dim1_2 : real;
28
	T_21942_004_Breakpoints_dim1_3 : real;
29
	T_21942_004_Breakpoints_dim1_4 : real;
30
	T_21942_004_Breakpoints_dim1_5 : real;
31
	T_21942_004_Breakpoints_dim1_6 : real;
32
	T_21942_004_Breakpoints_dim1_7 : real;
33
	T_21942_004_Breakpoints_dim1_8 : real;
34
	T_21942_004_dimJump_1 : int;
35
	T_21942_004_index_dim_1_1 : int;
36
	T_21942_004_index_dim_1_2 : int;
37
	T_21942_004_coords_dim_1_1 : real;
38
	T_21942_004_coords_dim_1_2 : real;
39
	T_21942_004_u_node_1 : real;
40
	T_21942_004_N_shape_1 : real;
41
	T_21942_004_u_node_2 : real;
42
	T_21942_004_N_shape_2 : real;
43
	T_21942_004_bound_node_index_1 : int;
44
	T_21942_004_bound_node_index_2 : int;
45
	T_21942_004_clip_input_1 : real;
46
let
47
	T_21942_004_table_elem_1 = 5.000000000000000;
48
	T_21942_004_table_elem_2 = 20.000000000000000;
49
	T_21942_004_table_elem_3 = 25.000000000000000;
50
	T_21942_004_table_elem_4 = 40.000000000000000;
51
	T_21942_004_table_elem_5 = 2.000000000000000;
52
	T_21942_004_table_elem_6 = 4.000000000000000;
53
	T_21942_004_table_elem_7 = 6.000000000000000;
54
	T_21942_004_table_elem_8 = 0.000000000000000;
55
	T_21942_004_Breakpoints_dim1_1 = 0.000000000000000;
56
	T_21942_004_Breakpoints_dim1_2 = 0.200000000000000;
57
	T_21942_004_Breakpoints_dim1_3 = 0.400000000000000;
58
	T_21942_004_Breakpoints_dim1_4 = 0.600000000000000;
59
	T_21942_004_Breakpoints_dim1_5 = 0.800000000000000;
60
	T_21942_004_Breakpoints_dim1_6 = 1.000000000000000;
61
	T_21942_004_Breakpoints_dim1_7 = 1.199999998000000;
62
	T_21942_004_Breakpoints_dim1_8 = 1.200000000000000;
63
	T_21942_004_dimJump_1 = 1;
64
	T_21942_004_index_dim_1_1 = if ((D_1 >= T_21942_004_Breakpoints_dim1_8) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_8) <= 0.000000000000000222044604925031) then
65
		7
66
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_7) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
67
		7
68
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_6) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
69
		6
70
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_5) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
71
		5
72
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_4) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
73
		4
74
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_3) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
75
		3
76
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_2) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
77
		2
78
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_1) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
79
		1
80
	    else 1;
81
	T_21942_004_coords_dim_1_1 = if ((D_1 >= T_21942_004_Breakpoints_dim1_8) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_8) <= 0.000000000000000222044604925031) then
82
		T_21942_004_Breakpoints_dim1_7
83
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_7) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
84
		T_21942_004_Breakpoints_dim1_7
85
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_6) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
86
		T_21942_004_Breakpoints_dim1_6
87
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_5) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
88
		T_21942_004_Breakpoints_dim1_5
89
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_4) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
90
		T_21942_004_Breakpoints_dim1_4
91
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_3) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
92
		T_21942_004_Breakpoints_dim1_3
93
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_2) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
94
		T_21942_004_Breakpoints_dim1_2
95
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_1) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
96
		T_21942_004_Breakpoints_dim1_1
97
	    else T_21942_004_Breakpoints_dim1_1;
98
	T_21942_004_index_dim_1_2 = if ((D_1 >= T_21942_004_Breakpoints_dim1_8) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_8) <= 0.000000000000000222044604925031) then
99
		8
100
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_7) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
101
		8
102
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_6) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
103
		7
104
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_5) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
105
		6
106
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_4) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
107
		5
108
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_3) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
109
		4
110
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_2) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
111
		3
112
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_1) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
113
		2
114
	    else 2;
115
	T_21942_004_coords_dim_1_2 = if ((D_1 >= T_21942_004_Breakpoints_dim1_8) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_8) <= 0.000000000000000222044604925031) then
116
		T_21942_004_Breakpoints_dim1_8
117
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_7) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
118
		T_21942_004_Breakpoints_dim1_8
119
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_6) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
120
		T_21942_004_Breakpoints_dim1_7
121
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_5) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
122
		T_21942_004_Breakpoints_dim1_6
123
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_4) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
124
		T_21942_004_Breakpoints_dim1_5
125
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_3) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
126
		T_21942_004_Breakpoints_dim1_4
127
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_2) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
128
		T_21942_004_Breakpoints_dim1_3
129
	    else if ((D_1 >= T_21942_004_Breakpoints_dim1_1) or abs_real(D_1 - T_21942_004_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
130
		T_21942_004_Breakpoints_dim1_2
131
	    else T_21942_004_Breakpoints_dim1_2;
132
	T_21942_004_bound_node_index_1 = (T_21942_004_index_dim_1_1 * 1);
133
	T_21942_004_u_node_1 = if (T_21942_004_bound_node_index_1 = 1) then
134
		T_21942_004_table_elem_1
135
	    else if (T_21942_004_bound_node_index_1 = 2) then
136
		T_21942_004_table_elem_2
137
	    else if (T_21942_004_bound_node_index_1 = 3) then
138
		T_21942_004_table_elem_3
139
	    else if (T_21942_004_bound_node_index_1 = 4) then
140
		T_21942_004_table_elem_4
141
	    else if (T_21942_004_bound_node_index_1 = 5) then
142
		T_21942_004_table_elem_5
143
	    else if (T_21942_004_bound_node_index_1 = 6) then
144
		T_21942_004_table_elem_6
145
	    else if (T_21942_004_bound_node_index_1 = 7) then
146
		T_21942_004_table_elem_7
147
	    else T_21942_004_table_elem_8;
148
	T_21942_004_bound_node_index_2 = (T_21942_004_index_dim_1_2 * 1);
149
	T_21942_004_u_node_2 = if (T_21942_004_bound_node_index_2 = 1) then
150
		T_21942_004_table_elem_1
151
	    else if (T_21942_004_bound_node_index_2 = 2) then
152
		T_21942_004_table_elem_2
153
	    else if (T_21942_004_bound_node_index_2 = 3) then
154
		T_21942_004_table_elem_3
155
	    else if (T_21942_004_bound_node_index_2 = 4) then
156
		T_21942_004_table_elem_4
157
	    else if (T_21942_004_bound_node_index_2 = 5) then
158
		T_21942_004_table_elem_5
159
	    else if (T_21942_004_bound_node_index_2 = 6) then
160
		T_21942_004_table_elem_6
161
	    else if (T_21942_004_bound_node_index_2 = 7) then
162
		T_21942_004_table_elem_7
163
	    else T_21942_004_table_elem_8;
164
	T_21942_004_clip_input_1 = if ((D_1 < T_21942_004_coords_dim_1_1) and abs_real(D_1 - T_21942_004_coords_dim_1_1) > 0.000000000000000000000000000000) then
165
		T_21942_004_coords_dim_1_1
166
	    else if ((D_1 > T_21942_004_coords_dim_1_2) and abs_real(D_1 - T_21942_004_coords_dim_1_2) > 0.000000000000000027755575615629) then
167
		T_21942_004_coords_dim_1_2
168
	    else D_1;
169
	T_21942_004_N_shape_1 = ((T_21942_004_coords_dim_1_2 - T_21942_004_clip_input_1) / (T_21942_004_coords_dim_1_2 - T_21942_004_coords_dim_1_1));
170
	T_21942_004_N_shape_2 = ((T_21942_004_clip_input_1 - T_21942_004_coords_dim_1_1) / (T_21942_004_coords_dim_1_2 - T_21942_004_coords_dim_1_1));
171
	T_1 = ( (T_21942_004_N_shape_1 * T_21942_004_u_node_1) + (T_21942_004_N_shape_2 * T_21942_004_u_node_2) );
172
tel
173

    
174
(*
175
Original block name: FromWorkSpace_interp_set0_PP/F
176
*)
177
node  F_15_073(__time_step : real;
178
	__nb_step : int;)
179
returns(Out1_1 : real;);
180
var D_1 : real;
181
	T_1 : real;
182
let
183
	D_1 = if ((__nb_step mod 1) = 0) then
184
		__time_step
185
	    else if (__nb_step = 0) then
186
		0.0
187
	    else (pre D_1);
188
	T_1 = T_21942_004_ext_node(D_1);
189
	Out1_1 = T_1;
190
tel
191

    
192
(*
193
Original block name: FromWorkSpace_interp_set0_PP
194
*)
195
node  FromWorkSpace_interp_set0_PP(_virtual : bool;)
196
returns(Out1_1 : real;);
197
var F_1 : real;
198
	__time_step : real;
199
	__nb_step : int;
200
let
201
	F_1 = F_15_073(__time_step, __nb_step);
202
	Out1_1 = F_1;
203
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
204
	__nb_step = (0 -> ((pre __nb_step) + 1));
205
tel
206

    
(745-745/1153)