Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (10.3 KB)

1 4748b215 hbourbou
-- This file has been generated by CoCoSim2.
2
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:48:43
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: LookupTableND_test_1D_clip_PP/Saturation
33
*)
34
node  Saturation_22_943(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 = -0.500000000000000;
45
	upper_1 = _min_real(upper_limit_1, In_1);
46
	upper_limit_1 = 25.000000000000000;
47
	Out_1 = lower_1;
48
tel
49
50
(*
51
external node code for doing Lookup_nD
52
*)
53
node  n_minus_DLookupTable_23_575_ext_node(Saturation_1 : real;)
54
returns(n_minus_DLookupTable_1 : real;);
55
var n_minus_DLookupTable_23_575_table_elem_1 : real;
56
	n_minus_DLookupTable_23_575_table_elem_2 : real;
57
	n_minus_DLookupTable_23_575_table_elem_3 : real;
58
	n_minus_DLookupTable_23_575_table_elem_4 : real;
59
	n_minus_DLookupTable_23_575_table_elem_5 : real;
60
	n_minus_DLookupTable_23_575_Breakpoints_dim1_1 : real;
61
	n_minus_DLookupTable_23_575_Breakpoints_dim1_2 : real;
62
	n_minus_DLookupTable_23_575_Breakpoints_dim1_3 : real;
63
	n_minus_DLookupTable_23_575_Breakpoints_dim1_4 : real;
64
	n_minus_DLookupTable_23_575_Breakpoints_dim1_5 : real;
65
	n_minus_DLookupTable_23_575_dimJump_1 : int;
66
	n_minus_DLookupTable_23_575_index_dim_1_1 : int;
67
	n_minus_DLookupTable_23_575_index_dim_1_2 : int;
68
	n_minus_DLookupTable_23_575_coords_dim_1_1 : real;
69
	n_minus_DLookupTable_23_575_coords_dim_1_2 : real;
70
	n_minus_DLookupTable_23_575_u_node_1 : real;
71
	n_minus_DLookupTable_23_575_N_shape_1 : real;
72
	n_minus_DLookupTable_23_575_u_node_2 : real;
73
	n_minus_DLookupTable_23_575_N_shape_2 : real;
74
	n_minus_DLookupTable_23_575_bound_node_index_1 : int;
75
	n_minus_DLookupTable_23_575_bound_node_index_2 : int;
76
	n_minus_DLookupTable_23_575_clip_input_1 : real;
77
let
78
	n_minus_DLookupTable_23_575_table_elem_1 = 0.000000000000000;
79
	n_minus_DLookupTable_23_575_table_elem_2 = 8.000000000000000;
80
	n_minus_DLookupTable_23_575_table_elem_3 = 10.000000000000000;
81
	n_minus_DLookupTable_23_575_table_elem_4 = 40.000000000000000;
82
	n_minus_DLookupTable_23_575_table_elem_5 = 30.000000000000000;
83
	n_minus_DLookupTable_23_575_Breakpoints_dim1_1 = 1.000000000000000;
84
	n_minus_DLookupTable_23_575_Breakpoints_dim1_2 = 4.000000000000000;
85
	n_minus_DLookupTable_23_575_Breakpoints_dim1_3 = 8.000000000000000;
86
	n_minus_DLookupTable_23_575_Breakpoints_dim1_4 = 20.000000000000000;
87
	n_minus_DLookupTable_23_575_Breakpoints_dim1_5 = 24.000000000000000;
88
	n_minus_DLookupTable_23_575_dimJump_1 = 1;
89
	n_minus_DLookupTable_23_575_index_dim_1_1 = if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_5) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_5) <= 0.000000000000003552713678800501) then
90
		4
91
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_4) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
92
		4
93
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_3) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_3) <= 0.000000000000001776356839400250) then
94
		3
95
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_2) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_2) <= 0.000000000000000888178419700125) then
96
		2
97
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_1) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
98
		1
99
	    else 1;
100
	n_minus_DLookupTable_23_575_coords_dim_1_1 = if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_5) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_5) <= 0.000000000000003552713678800501) then
101
		n_minus_DLookupTable_23_575_Breakpoints_dim1_4
102
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_4) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
103
		n_minus_DLookupTable_23_575_Breakpoints_dim1_4
104
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_3) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_3) <= 0.000000000000001776356839400250) then
105
		n_minus_DLookupTable_23_575_Breakpoints_dim1_3
106
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_2) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_2) <= 0.000000000000000888178419700125) then
107
		n_minus_DLookupTable_23_575_Breakpoints_dim1_2
108
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_1) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
109
		n_minus_DLookupTable_23_575_Breakpoints_dim1_1
110
	    else n_minus_DLookupTable_23_575_Breakpoints_dim1_1;
111
	n_minus_DLookupTable_23_575_index_dim_1_2 = if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_5) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_5) <= 0.000000000000003552713678800501) then
112
		5
113
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_4) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
114
		5
115
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_3) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_3) <= 0.000000000000001776356839400250) then
116
		4
117
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_2) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_2) <= 0.000000000000000888178419700125) then
118
		3
119
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_1) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
120
		2
121
	    else 2;
122
	n_minus_DLookupTable_23_575_coords_dim_1_2 = if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_5) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_5) <= 0.000000000000003552713678800501) then
123
		n_minus_DLookupTable_23_575_Breakpoints_dim1_5
124
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_4) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
125
		n_minus_DLookupTable_23_575_Breakpoints_dim1_5
126
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_3) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_3) <= 0.000000000000001776356839400250) then
127
		n_minus_DLookupTable_23_575_Breakpoints_dim1_4
128
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_2) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_2) <= 0.000000000000000888178419700125) then
129
		n_minus_DLookupTable_23_575_Breakpoints_dim1_3
130
	    else if ((Saturation_1 >= n_minus_DLookupTable_23_575_Breakpoints_dim1_1) or abs_real(Saturation_1 - n_minus_DLookupTable_23_575_Breakpoints_dim1_1) <= 0.000000000000000222044604925031) then
131
		n_minus_DLookupTable_23_575_Breakpoints_dim1_2
132
	    else n_minus_DLookupTable_23_575_Breakpoints_dim1_2;
133
	n_minus_DLookupTable_23_575_bound_node_index_1 = (n_minus_DLookupTable_23_575_index_dim_1_1 * 1);
134
	n_minus_DLookupTable_23_575_u_node_1 = if (n_minus_DLookupTable_23_575_bound_node_index_1 = 1) then
135
		n_minus_DLookupTable_23_575_table_elem_1
136
	    else if (n_minus_DLookupTable_23_575_bound_node_index_1 = 2) then
137
		n_minus_DLookupTable_23_575_table_elem_2
138
	    else if (n_minus_DLookupTable_23_575_bound_node_index_1 = 3) then
139
		n_minus_DLookupTable_23_575_table_elem_3
140
	    else if (n_minus_DLookupTable_23_575_bound_node_index_1 = 4) then
141
		n_minus_DLookupTable_23_575_table_elem_4
142
	    else n_minus_DLookupTable_23_575_table_elem_5;
143
	n_minus_DLookupTable_23_575_bound_node_index_2 = (n_minus_DLookupTable_23_575_index_dim_1_2 * 1);
144
	n_minus_DLookupTable_23_575_u_node_2 = if (n_minus_DLookupTable_23_575_bound_node_index_2 = 1) then
145
		n_minus_DLookupTable_23_575_table_elem_1
146
	    else if (n_minus_DLookupTable_23_575_bound_node_index_2 = 2) then
147
		n_minus_DLookupTable_23_575_table_elem_2
148
	    else if (n_minus_DLookupTable_23_575_bound_node_index_2 = 3) then
149
		n_minus_DLookupTable_23_575_table_elem_3
150
	    else if (n_minus_DLookupTable_23_575_bound_node_index_2 = 4) then
151
		n_minus_DLookupTable_23_575_table_elem_4
152
	    else n_minus_DLookupTable_23_575_table_elem_5;
153
	n_minus_DLookupTable_23_575_clip_input_1 = if ((Saturation_1 < n_minus_DLookupTable_23_575_coords_dim_1_1) and abs_real(Saturation_1 - n_minus_DLookupTable_23_575_coords_dim_1_1) > 0.000000000000000222044604925031) then
154
		n_minus_DLookupTable_23_575_coords_dim_1_1
155
	    else if ((Saturation_1 > n_minus_DLookupTable_23_575_coords_dim_1_2) and abs_real(Saturation_1 - n_minus_DLookupTable_23_575_coords_dim_1_2) > 0.000000000000000888178419700125) then
156
		n_minus_DLookupTable_23_575_coords_dim_1_2
157
	    else Saturation_1;
158
	n_minus_DLookupTable_23_575_N_shape_1 = ((n_minus_DLookupTable_23_575_coords_dim_1_2 - n_minus_DLookupTable_23_575_clip_input_1) / (n_minus_DLookupTable_23_575_coords_dim_1_2 - n_minus_DLookupTable_23_575_coords_dim_1_1));
159
	n_minus_DLookupTable_23_575_N_shape_2 = ((n_minus_DLookupTable_23_575_clip_input_1 - n_minus_DLookupTable_23_575_coords_dim_1_1) / (n_minus_DLookupTable_23_575_coords_dim_1_2 - n_minus_DLookupTable_23_575_coords_dim_1_1));
160
	n_minus_DLookupTable_1 = ( (n_minus_DLookupTable_23_575_N_shape_1 * n_minus_DLookupTable_23_575_u_node_1) + (n_minus_DLookupTable_23_575_N_shape_2 * n_minus_DLookupTable_23_575_u_node_2) );
161
tel
162
163
(*
164
Original block name: LookupTableND_test_1D_clip_PP
165
*)
166
node  LookupTableND_test_1D_clip_PP(In1_1 : real;)
167
returns(Out1_1 : real;);
168
var Saturation_1 : real;
169
	n_minus_DLookupTable_1 : real;
170
	__time_step : real;
171
	__nb_step : int;
172
let
173
	Saturation_1 = Saturation_22_943(In1_1, __time_step, __nb_step);
174
	n_minus_DLookupTable_1 = n_minus_DLookupTable_23_575_ext_node(Saturation_1);
175
	Out1_1 = n_minus_DLookupTable_1;
176
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
177
	__nb_step = (0 -> ((pre __nb_step) + 1));
178
tel