Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (10.6 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:45:13
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_3_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
	In2_1 : real;
61
	In2_2 : real;
62
	In2_3 : real;
63
	In2_4 : real;
64
	In2_5 : real;
65
	In2_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_retTableInd_1 : int;
85
	LookupTableDynamic_79_290_disFromTableNode_dim_1_1 : real;
86
	LookupTableDynamic_79_290_disFromTableNode_dim_1_2 : real;
87
	LookupTableDynamic_79_290_nearestIndex_dim_1 : int;
88
let
89
	LookupTableDynamic_79_290_table_elem_1 = In2_1;
90
	LookupTableDynamic_79_290_table_elem_2 = In2_2;
91
	LookupTableDynamic_79_290_table_elem_3 = In2_3;
92
	LookupTableDynamic_79_290_table_elem_4 = In2_4;
93
	LookupTableDynamic_79_290_table_elem_5 = In2_5;
94
	LookupTableDynamic_79_290_table_elem_6 = In2_6;
95
	LookupTableDynamic_79_290_Breakpoints_dim1_1 = Constant_1;
96
	LookupTableDynamic_79_290_Breakpoints_dim1_2 = Constant_2;
97
	LookupTableDynamic_79_290_Breakpoints_dim1_3 = Constant_3;
98
	LookupTableDynamic_79_290_Breakpoints_dim1_4 = Constant_4;
99
	LookupTableDynamic_79_290_Breakpoints_dim1_5 = Constant_5;
100
	LookupTableDynamic_79_290_Breakpoints_dim1_6 = Constant_6;
101
	LookupTableDynamic_79_290_dimJump_1 = 1;
102
	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
103
		6
104
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
105
		5
106
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
107
		4
108
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
109
		3
110
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
111
		2
112
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
113
		1
114
	    else 1;
115
	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
116
		LookupTableDynamic_79_290_Breakpoints_dim1_5
117
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
118
		LookupTableDynamic_79_290_Breakpoints_dim1_5
119
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
120
		LookupTableDynamic_79_290_Breakpoints_dim1_4
121
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
122
		LookupTableDynamic_79_290_Breakpoints_dim1_3
123
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
124
		LookupTableDynamic_79_290_Breakpoints_dim1_2
125
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
126
		LookupTableDynamic_79_290_Breakpoints_dim1_1
127
	    else LookupTableDynamic_79_290_Breakpoints_dim1_1;
128
	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
129
		6
130
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
131
		6
132
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
133
		5
134
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
135
		4
136
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
137
		3
138
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
139
		2
140
	    else 2;
141
	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
142
		LookupTableDynamic_79_290_Breakpoints_dim1_6
143
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_5) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
144
		LookupTableDynamic_79_290_Breakpoints_dim1_6
145
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_4) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
146
		LookupTableDynamic_79_290_Breakpoints_dim1_5
147
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_3) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
148
		LookupTableDynamic_79_290_Breakpoints_dim1_4
149
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_2) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
150
		LookupTableDynamic_79_290_Breakpoints_dim1_3
151
	    else if ((Saturation1_1 >= LookupTableDynamic_79_290_Breakpoints_dim1_1) or abs_real(Saturation1_1 - LookupTableDynamic_79_290_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
152
		LookupTableDynamic_79_290_Breakpoints_dim1_2
153
	    else LookupTableDynamic_79_290_Breakpoints_dim1_2;
154
	LookupTableDynamic_79_290_disFromTableNode_dim_1_1 = (Saturation1_1 - LookupTableDynamic_79_290_coords_dim_1_1);
155
	LookupTableDynamic_79_290_disFromTableNode_dim_1_2 = (LookupTableDynamic_79_290_coords_dim_1_2 - Saturation1_1);
156
	LookupTableDynamic_79_290_nearestIndex_dim_1 = if ((LookupTableDynamic_79_290_disFromTableNode_dim_1_2 <= LookupTableDynamic_79_290_disFromTableNode_dim_1_1) or abs_real(LookupTableDynamic_79_290_disFromTableNode_dim_1_2 - LookupTableDynamic_79_290_disFromTableNode_dim_1_1) <= 0.000000000000001000000000000000) then
157
		LookupTableDynamic_79_290_index_dim_1_2
158
	    else LookupTableDynamic_79_290_index_dim_1_1;
159
	LookupTableDynamic_79_290_retTableInd_1 = (LookupTableDynamic_79_290_nearestIndex_dim_1 * 1);
160
	LookupTableDynamic_1 = if (LookupTableDynamic_79_290_retTableInd_1 = 1) then
161
		LookupTableDynamic_79_290_table_elem_1
162
	    else if (LookupTableDynamic_79_290_retTableInd_1 = 2) then
163
		LookupTableDynamic_79_290_table_elem_2
164
	    else if (LookupTableDynamic_79_290_retTableInd_1 = 3) then
165
		LookupTableDynamic_79_290_table_elem_3
166
	    else if (LookupTableDynamic_79_290_retTableInd_1 = 4) then
167
		LookupTableDynamic_79_290_table_elem_4
168
	    else if (LookupTableDynamic_79_290_retTableInd_1 = 5) then
169
		LookupTableDynamic_79_290_table_elem_5
170
	    else LookupTableDynamic_79_290_table_elem_6;
171
tel
172
173
(*
174
Original block name: LookupTableDynamic_3_PP
175
*)
176
node  LookupTableDynamic_3_PP(In1_1 : real;
177
	In2_1 : real;
178
	In2_2 : real;
179
	In2_3 : real;
180
	In2_4 : real;
181
	In2_5 : real;
182
	In2_6 : real;)
183
returns(Out1_1 : real;);
184
var Constant_1 : real;
185
	Constant_2 : real;
186
	Constant_3 : real;
187
	Constant_4 : real;
188
	Constant_5 : real;
189
	Constant_6 : real;
190
	LookupTableDynamic_1 : real;
191
	Saturation1_1 : real;
192
	__time_step : real;
193
	__nb_step : int;
194
let
195
	Constant_1 = 2.000000000000000;
196
	Constant_2 = 3.000000000000000;
197
	Constant_3 = 4.000000000000000;
198
	Constant_4 = 5.000000000000000;
199
	Constant_5 = 6.000000000000000;
200
	Constant_6 = 7.000000000000000;
201
	LookupTableDynamic_1 = LookupTableDynamic_79_290_ext_node(Saturation1_1, Constant_1, Constant_2, Constant_3, Constant_4, Constant_5, Constant_6, In2_1, In2_2, In2_3, In2_4, In2_5, In2_6);
202
	Saturation1_1 = Saturation1_80_284(In1_1, __time_step, __nb_step);
203
	Out1_1 = LookupTableDynamic_1;
204
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
205
	__nb_step = (0 -> ((pre __nb_step) + 1));
206
tel