Project

General

Profile

Download (9.93 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:35
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  LookupTableDynamic_64_293_ext_node(Constant2_1 : real;
17
	Constant1_1 : real;
18
	Constant1_2 : real;
19
	Constant1_3 : real;
20
	Constant1_4 : real;
21
	Constant1_5 : real;
22
	Constant1_6 : real;
23
	Constant3_1 : real;
24
	Constant3_2 : real;
25
	Constant3_3 : real;
26
	Constant3_4 : real;
27
	Constant3_5 : real;
28
	Constant3_6 : real;)
29
returns(LookupTableDynamic_1 : real;);
30
var LookupTableDynamic_64_293_table_elem_1 : real;
31
	LookupTableDynamic_64_293_table_elem_2 : real;
32
	LookupTableDynamic_64_293_table_elem_3 : real;
33
	LookupTableDynamic_64_293_table_elem_4 : real;
34
	LookupTableDynamic_64_293_table_elem_5 : real;
35
	LookupTableDynamic_64_293_table_elem_6 : real;
36
	LookupTableDynamic_64_293_Breakpoints_dim1_1 : real;
37
	LookupTableDynamic_64_293_Breakpoints_dim1_2 : real;
38
	LookupTableDynamic_64_293_Breakpoints_dim1_3 : real;
39
	LookupTableDynamic_64_293_Breakpoints_dim1_4 : real;
40
	LookupTableDynamic_64_293_Breakpoints_dim1_5 : real;
41
	LookupTableDynamic_64_293_Breakpoints_dim1_6 : real;
42
	LookupTableDynamic_64_293_dimJump_1 : int;
43
	LookupTableDynamic_64_293_index_dim_1_1 : int;
44
	LookupTableDynamic_64_293_index_dim_1_2 : int;
45
	LookupTableDynamic_64_293_coords_dim_1_1 : real;
46
	LookupTableDynamic_64_293_retTableInd_1 : int;
47
let
48
	LookupTableDynamic_64_293_table_elem_1 = Constant3_1;
49
	LookupTableDynamic_64_293_table_elem_2 = Constant3_2;
50
	LookupTableDynamic_64_293_table_elem_3 = Constant3_3;
51
	LookupTableDynamic_64_293_table_elem_4 = Constant3_4;
52
	LookupTableDynamic_64_293_table_elem_5 = Constant3_5;
53
	LookupTableDynamic_64_293_table_elem_6 = Constant3_6;
54
	LookupTableDynamic_64_293_Breakpoints_dim1_1 = Constant1_1;
55
	LookupTableDynamic_64_293_Breakpoints_dim1_2 = Constant1_2;
56
	LookupTableDynamic_64_293_Breakpoints_dim1_3 = Constant1_3;
57
	LookupTableDynamic_64_293_Breakpoints_dim1_4 = Constant1_4;
58
	LookupTableDynamic_64_293_Breakpoints_dim1_5 = Constant1_5;
59
	LookupTableDynamic_64_293_Breakpoints_dim1_6 = Constant1_6;
60
	LookupTableDynamic_64_293_dimJump_1 = 1;
61
	LookupTableDynamic_64_293_index_dim_1_1 = if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_6) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
62
		6
63
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_5) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
64
		5
65
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_4) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
66
		4
67
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_3) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
68
		3
69
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_2) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
70
		2
71
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_1) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
72
		1
73
	    else 1;
74
	LookupTableDynamic_64_293_coords_dim_1_1 = if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_6) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
75
		LookupTableDynamic_64_293_Breakpoints_dim1_5
76
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_5) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
77
		LookupTableDynamic_64_293_Breakpoints_dim1_5
78
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_4) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
79
		LookupTableDynamic_64_293_Breakpoints_dim1_4
80
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_3) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
81
		LookupTableDynamic_64_293_Breakpoints_dim1_3
82
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_2) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
83
		LookupTableDynamic_64_293_Breakpoints_dim1_2
84
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_1) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
85
		LookupTableDynamic_64_293_Breakpoints_dim1_1
86
	    else LookupTableDynamic_64_293_Breakpoints_dim1_1;
87
	LookupTableDynamic_64_293_index_dim_1_2 = if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_6) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
88
		6
89
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_5) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
90
		6
91
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_4) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
92
		5
93
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_3) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
94
		4
95
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_2) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
96
		3
97
	    else if ((Constant2_1 >= LookupTableDynamic_64_293_Breakpoints_dim1_1) or abs_real(Constant2_1 - LookupTableDynamic_64_293_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
98
		2
99
	    else 2;
100
	LookupTableDynamic_64_293_retTableInd_1 = if ((Constant2_1 <= LookupTableDynamic_64_293_coords_dim_1_1) or abs_real(Constant2_1 - LookupTableDynamic_64_293_coords_dim_1_1) <= 0.000000000000001000000000000000) then
101
		(LookupTableDynamic_64_293_index_dim_1_1 * 1)
102
	    else (LookupTableDynamic_64_293_index_dim_1_2 * 1);
103
	LookupTableDynamic_1 = if (LookupTableDynamic_64_293_retTableInd_1 = 1) then
104
		LookupTableDynamic_64_293_table_elem_1
105
	    else if (LookupTableDynamic_64_293_retTableInd_1 = 2) then
106
		LookupTableDynamic_64_293_table_elem_2
107
	    else if (LookupTableDynamic_64_293_retTableInd_1 = 3) then
108
		LookupTableDynamic_64_293_table_elem_3
109
	    else if (LookupTableDynamic_64_293_retTableInd_1 = 4) then
110
		LookupTableDynamic_64_293_table_elem_4
111
	    else if (LookupTableDynamic_64_293_retTableInd_1 = 5) then
112
		LookupTableDynamic_64_293_table_elem_5
113
	    else LookupTableDynamic_64_293_table_elem_6;
114
tel
115

    
116
(*
117
Original block name: LookupTableDynamic_above_PP
118
*)
119
node  LookupTableDynamic_above_PP(_virtual : bool;)
120
returns(Out1_1 : real;
121
	Out1_2 : real;
122
	Out1_3 : real;
123
	Out1_4 : real;
124
	Out1_5 : real;
125
	Out1_6 : real;);
126
var Constant1_1 : real;
127
	Constant1_2 : real;
128
	Constant1_3 : real;
129
	Constant1_4 : real;
130
	Constant1_5 : real;
131
	Constant1_6 : real;
132
	Constant2_1 : real;
133
	Constant2_2 : real;
134
	Constant2_3 : real;
135
	Constant2_4 : real;
136
	Constant2_5 : real;
137
	Constant2_6 : real;
138
	Constant3_1 : real;
139
	Constant3_2 : real;
140
	Constant3_3 : real;
141
	Constant3_4 : real;
142
	Constant3_5 : real;
143
	Constant3_6 : real;
144
	LookupTableDynamic_1 : real;
145
	LookupTableDynamic_2 : real;
146
	LookupTableDynamic_3 : real;
147
	LookupTableDynamic_4 : real;
148
	LookupTableDynamic_5 : real;
149
	LookupTableDynamic_6 : real;
150
	__time_step : real;
151
	__nb_step : int;
152
let
153
	Constant1_1 = 2.000000000000000;
154
	Constant1_2 = 3.000000000000000;
155
	Constant1_3 = 4.000000000000000;
156
	Constant1_4 = 5.000000000000000;
157
	Constant1_5 = 6.000000000000000;
158
	Constant1_6 = 7.000000000000000;
159
	Constant2_1 = 2.300000000000000;
160
	Constant2_2 = 3.000000000000000;
161
	Constant2_3 = 4.400000000000000;
162
	Constant2_4 = 5.000000000000000;
163
	Constant2_5 = 6.600000000000000;
164
	Constant2_6 = 7.000000000000000;
165
	Constant3_1 = 12.000000000000000;
166
	Constant3_2 = 23.000000000000000;
167
	Constant3_3 = 44.000000000000000;
168
	Constant3_4 = 55.000000000000000;
169
	Constant3_5 = 66.000000000000000;
170
	Constant3_6 = 77.000000000000000;
171
	LookupTableDynamic_1 = LookupTableDynamic_64_293_ext_node(Constant2_1, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
172
	LookupTableDynamic_2 = LookupTableDynamic_64_293_ext_node(Constant2_2, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
173
	LookupTableDynamic_3 = LookupTableDynamic_64_293_ext_node(Constant2_3, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
174
	LookupTableDynamic_4 = LookupTableDynamic_64_293_ext_node(Constant2_4, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
175
	LookupTableDynamic_5 = LookupTableDynamic_64_293_ext_node(Constant2_5, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
176
	LookupTableDynamic_6 = LookupTableDynamic_64_293_ext_node(Constant2_6, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, Constant3_1, Constant3_2, Constant3_3, Constant3_4, Constant3_5, Constant3_6);
177
	Out1_1 = LookupTableDynamic_1;
178
	Out1_2 = LookupTableDynamic_2;
179
	Out1_3 = LookupTableDynamic_3;
180
	Out1_4 = LookupTableDynamic_4;
181
	Out1_5 = LookupTableDynamic_5;
182
	Out1_6 = LookupTableDynamic_6;
183
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
184
	__nb_step = (0 -> ((pre __nb_step) + 1));
185
tel
186

    
(865-865/1153)