Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (7.55 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:45:56
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_294_ext_node(In1_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
	In2_1 : real;
24
	In2_2 : real;
25
	In2_3 : real;
26
	In2_4 : real;
27
	In2_5 : real;
28
	In2_6 : real;)
29
returns(LookupTableDynamic_1 : real;);
30
var LookupTableDynamic_64_294_table_elem_1 : real;
31
	LookupTableDynamic_64_294_table_elem_2 : real;
32
	LookupTableDynamic_64_294_table_elem_3 : real;
33
	LookupTableDynamic_64_294_table_elem_4 : real;
34
	LookupTableDynamic_64_294_table_elem_5 : real;
35
	LookupTableDynamic_64_294_table_elem_6 : real;
36
	LookupTableDynamic_64_294_Breakpoints_dim1_1 : real;
37
	LookupTableDynamic_64_294_Breakpoints_dim1_2 : real;
38
	LookupTableDynamic_64_294_Breakpoints_dim1_3 : real;
39
	LookupTableDynamic_64_294_Breakpoints_dim1_4 : real;
40
	LookupTableDynamic_64_294_Breakpoints_dim1_5 : real;
41
	LookupTableDynamic_64_294_Breakpoints_dim1_6 : real;
42
	LookupTableDynamic_64_294_dimJump_1 : int;
43
	LookupTableDynamic_64_294_index_dim_1_1 : int;
44
	LookupTableDynamic_64_294_index_dim_1_2 : int;
45
	LookupTableDynamic_64_294_coords_dim_1_1 : real;
46
	LookupTableDynamic_64_294_retTableInd_1 : int;
47
let
48
	LookupTableDynamic_64_294_table_elem_1 = In2_1;
49
	LookupTableDynamic_64_294_table_elem_2 = In2_2;
50
	LookupTableDynamic_64_294_table_elem_3 = In2_3;
51
	LookupTableDynamic_64_294_table_elem_4 = In2_4;
52
	LookupTableDynamic_64_294_table_elem_5 = In2_5;
53
	LookupTableDynamic_64_294_table_elem_6 = In2_6;
54
	LookupTableDynamic_64_294_Breakpoints_dim1_1 = Constant1_1;
55
	LookupTableDynamic_64_294_Breakpoints_dim1_2 = Constant1_2;
56
	LookupTableDynamic_64_294_Breakpoints_dim1_3 = Constant1_3;
57
	LookupTableDynamic_64_294_Breakpoints_dim1_4 = Constant1_4;
58
	LookupTableDynamic_64_294_Breakpoints_dim1_5 = Constant1_5;
59
	LookupTableDynamic_64_294_Breakpoints_dim1_6 = Constant1_6;
60
	LookupTableDynamic_64_294_dimJump_1 = 1;
61
	LookupTableDynamic_64_294_index_dim_1_1 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
62
		6
63
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
64
		5
65
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
66
		4
67
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
68
		3
69
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
70
		2
71
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
72
		1
73
	    else 1;
74
	LookupTableDynamic_64_294_coords_dim_1_1 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
75
		LookupTableDynamic_64_294_Breakpoints_dim1_5
76
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
77
		LookupTableDynamic_64_294_Breakpoints_dim1_5
78
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
79
		LookupTableDynamic_64_294_Breakpoints_dim1_4
80
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
81
		LookupTableDynamic_64_294_Breakpoints_dim1_3
82
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
83
		LookupTableDynamic_64_294_Breakpoints_dim1_2
84
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
85
		LookupTableDynamic_64_294_Breakpoints_dim1_1
86
	    else LookupTableDynamic_64_294_Breakpoints_dim1_1;
87
	LookupTableDynamic_64_294_index_dim_1_2 = if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_6) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_6) <= 0.000000000000001000000000000000) then
88
		6
89
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_5) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_5) <= 0.000000000000001000000000000000) then
90
		6
91
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_4) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_4) <= 0.000000000000001000000000000000) then
92
		5
93
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_3) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_3) <= 0.000000000000001000000000000000) then
94
		4
95
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_2) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_2) <= 0.000000000000001000000000000000) then
96
		3
97
	    else if ((In1_1 >= LookupTableDynamic_64_294_Breakpoints_dim1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_Breakpoints_dim1_1) <= 0.000000000000001000000000000000) then
98
		2
99
	    else 2;
100
	LookupTableDynamic_64_294_retTableInd_1 = if ((In1_1 <= LookupTableDynamic_64_294_coords_dim_1_1) or abs_real(In1_1 - LookupTableDynamic_64_294_coords_dim_1_1) <= 0.000000000000001000000000000000) then
101
		(LookupTableDynamic_64_294_index_dim_1_1 * 1)
102
	    else (LookupTableDynamic_64_294_index_dim_1_2 * 1);
103
	LookupTableDynamic_1 = if (LookupTableDynamic_64_294_retTableInd_1 = 1) then
104
		LookupTableDynamic_64_294_table_elem_1
105
	    else if (LookupTableDynamic_64_294_retTableInd_1 = 2) then
106
		LookupTableDynamic_64_294_table_elem_2
107
	    else if (LookupTableDynamic_64_294_retTableInd_1 = 3) then
108
		LookupTableDynamic_64_294_table_elem_3
109
	    else if (LookupTableDynamic_64_294_retTableInd_1 = 4) then
110
		LookupTableDynamic_64_294_table_elem_4
111
	    else if (LookupTableDynamic_64_294_retTableInd_1 = 5) then
112
		LookupTableDynamic_64_294_table_elem_5
113
	    else LookupTableDynamic_64_294_table_elem_6;
114
tel
115

    
116
(*
117
Original block name: LookupTableDynamic_interp_endvalue_PP
118
*)
119
node  LookupTableDynamic_interp_endvalue_PP(In1_1 : real;
120
	In2_1 : real;
121
	In2_2 : real;
122
	In2_3 : real;
123
	In2_4 : real;
124
	In2_5 : real;
125
	In2_6 : real;)
126
returns(Out1_1 : real;);
127
var Constant1_1 : real;
128
	Constant1_2 : real;
129
	Constant1_3 : real;
130
	Constant1_4 : real;
131
	Constant1_5 : real;
132
	Constant1_6 : real;
133
	LookupTableDynamic_1 : real;
134
	__time_step : real;
135
	__nb_step : int;
136
let
137
	Constant1_1 = 12.000000000000000;
138
	Constant1_2 = 23.000000000000000;
139
	Constant1_3 = 44.000000000000000;
140
	Constant1_4 = 55.000000000000000;
141
	Constant1_5 = 66.000000000000000;
142
	Constant1_6 = 77.000000000000000;
143
	LookupTableDynamic_1 = LookupTableDynamic_64_294_ext_node(In1_1, Constant1_1, Constant1_2, Constant1_3, Constant1_4, Constant1_5, Constant1_6, In2_1, In2_2, In2_3, In2_4, In2_5, In2_6);
144
	Out1_1 = LookupTableDynamic_1;
145
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
146
	__nb_step = (0 -> ((pre __nb_step) + 1));
147
tel
148