Project

General

Profile

Download (9.31 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:29
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_21948_003_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_21948_003_table_elem_1 : real;
19
	T_21948_003_table_elem_2 : real;
20
	T_21948_003_table_elem_3 : real;
21
	T_21948_003_table_elem_4 : real;
22
	T_21948_003_table_elem_5 : real;
23
	T_21948_003_table_elem_6 : real;
24
	T_21948_003_table_elem_7 : real;
25
	T_21948_003_Breakpoints_dim1_1 : real;
26
	T_21948_003_Breakpoints_dim1_2 : real;
27
	T_21948_003_Breakpoints_dim1_3 : real;
28
	T_21948_003_Breakpoints_dim1_4 : real;
29
	T_21948_003_Breakpoints_dim1_5 : real;
30
	T_21948_003_Breakpoints_dim1_6 : real;
31
	T_21948_003_Breakpoints_dim1_7 : real;
32
	T_21948_003_dimJump_1 : int;
33
	T_21948_003_index_dim_1_1 : int;
34
	T_21948_003_index_dim_1_2 : int;
35
	T_21948_003_coords_dim_1_1 : real;
36
	T_21948_003_coords_dim_1_2 : real;
37
	T_21948_003_u_node_1 : real;
38
	T_21948_003_N_shape_1 : real;
39
	T_21948_003_u_node_2 : real;
40
	T_21948_003_N_shape_2 : real;
41
	T_21948_003_bound_node_index_1 : int;
42
	T_21948_003_bound_node_index_2 : int;
43
	T_21948_003_clip_input_1 : real;
44
let
45
	T_21948_003_table_elem_1 = 5.000000000000000;
46
	T_21948_003_table_elem_2 = 20.000000000000000;
47
	T_21948_003_table_elem_3 = 25.000000000000000;
48
	T_21948_003_table_elem_4 = 40.000000000000000;
49
	T_21948_003_table_elem_5 = 4.000000000000000;
50
	T_21948_003_table_elem_6 = 4.000000000000000;
51
	T_21948_003_table_elem_7 = 55.000000000000000;
52
	T_21948_003_Breakpoints_dim1_1 = 0.000000000000000;
53
	T_21948_003_Breakpoints_dim1_2 = 0.200000000000000;
54
	T_21948_003_Breakpoints_dim1_3 = 0.400000000000000;
55
	T_21948_003_Breakpoints_dim1_4 = 0.600000000000000;
56
	T_21948_003_Breakpoints_dim1_5 = 0.800000000000000;
57
	T_21948_003_Breakpoints_dim1_6 = 1.000000000000000;
58
	T_21948_003_Breakpoints_dim1_7 = 1.200000000000000;
59
	T_21948_003_dimJump_1 = 1;
60
	T_21948_003_index_dim_1_1 = if ((D_1 >= T_21948_003_Breakpoints_dim1_7) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
61
		6
62
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_6) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
63
		6
64
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
65
		5
66
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
67
		4
68
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
69
		3
70
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
71
		2
72
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
73
		1
74
	    else 1;
75
	T_21948_003_coords_dim_1_1 = if ((D_1 >= T_21948_003_Breakpoints_dim1_7) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
76
		T_21948_003_Breakpoints_dim1_6
77
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_6) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
78
		T_21948_003_Breakpoints_dim1_6
79
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
80
		T_21948_003_Breakpoints_dim1_5
81
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
82
		T_21948_003_Breakpoints_dim1_4
83
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
84
		T_21948_003_Breakpoints_dim1_3
85
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
86
		T_21948_003_Breakpoints_dim1_2
87
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
88
		T_21948_003_Breakpoints_dim1_1
89
	    else T_21948_003_Breakpoints_dim1_1;
90
	T_21948_003_index_dim_1_2 = if ((D_1 >= T_21948_003_Breakpoints_dim1_7) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
91
		7
92
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_6) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
93
		7
94
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
95
		6
96
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
97
		5
98
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
99
		4
100
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
101
		3
102
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
103
		2
104
	    else 2;
105
	T_21948_003_coords_dim_1_2 = if ((D_1 >= T_21948_003_Breakpoints_dim1_7) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
106
		T_21948_003_Breakpoints_dim1_7
107
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_6) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
108
		T_21948_003_Breakpoints_dim1_7
109
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
110
		T_21948_003_Breakpoints_dim1_6
111
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
112
		T_21948_003_Breakpoints_dim1_5
113
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
114
		T_21948_003_Breakpoints_dim1_4
115
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
116
		T_21948_003_Breakpoints_dim1_3
117
	    else if ((D_1 >= T_21948_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21948_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
118
		T_21948_003_Breakpoints_dim1_2
119
	    else T_21948_003_Breakpoints_dim1_2;
120
	T_21948_003_bound_node_index_1 = (T_21948_003_index_dim_1_1 * 1);
121
	T_21948_003_u_node_1 = if (T_21948_003_bound_node_index_1 = 1) then
122
		T_21948_003_table_elem_1
123
	    else if (T_21948_003_bound_node_index_1 = 2) then
124
		T_21948_003_table_elem_2
125
	    else if (T_21948_003_bound_node_index_1 = 3) then
126
		T_21948_003_table_elem_3
127
	    else if (T_21948_003_bound_node_index_1 = 4) then
128
		T_21948_003_table_elem_4
129
	    else if (T_21948_003_bound_node_index_1 = 5) then
130
		T_21948_003_table_elem_5
131
	    else if (T_21948_003_bound_node_index_1 = 6) then
132
		T_21948_003_table_elem_6
133
	    else T_21948_003_table_elem_7;
134
	T_21948_003_bound_node_index_2 = (T_21948_003_index_dim_1_2 * 1);
135
	T_21948_003_u_node_2 = if (T_21948_003_bound_node_index_2 = 1) then
136
		T_21948_003_table_elem_1
137
	    else if (T_21948_003_bound_node_index_2 = 2) then
138
		T_21948_003_table_elem_2
139
	    else if (T_21948_003_bound_node_index_2 = 3) then
140
		T_21948_003_table_elem_3
141
	    else if (T_21948_003_bound_node_index_2 = 4) then
142
		T_21948_003_table_elem_4
143
	    else if (T_21948_003_bound_node_index_2 = 5) then
144
		T_21948_003_table_elem_5
145
	    else if (T_21948_003_bound_node_index_2 = 6) then
146
		T_21948_003_table_elem_6
147
	    else T_21948_003_table_elem_7;
148
	T_21948_003_clip_input_1 = if ((D_1 < T_21948_003_coords_dim_1_1) and abs_real(D_1 - T_21948_003_coords_dim_1_1) > 0.000000000000000000000000000000) then
149
		T_21948_003_coords_dim_1_1
150
	    else if ((D_1 > T_21948_003_coords_dim_1_2) and abs_real(D_1 - T_21948_003_coords_dim_1_2) > 0.000000000000000027755575615629) then
151
		T_21948_003_coords_dim_1_2
152
	    else D_1;
153
	T_21948_003_N_shape_1 = ((T_21948_003_coords_dim_1_2 - T_21948_003_clip_input_1) / (T_21948_003_coords_dim_1_2 - T_21948_003_coords_dim_1_1));
154
	T_21948_003_N_shape_2 = ((T_21948_003_clip_input_1 - T_21948_003_coords_dim_1_1) / (T_21948_003_coords_dim_1_2 - T_21948_003_coords_dim_1_1));
155
	T_1 = ( (T_21948_003_N_shape_1 * T_21948_003_u_node_1) + (T_21948_003_N_shape_2 * T_21948_003_u_node_2) );
156
tel
157

    
158
(*
159
Original block name: FromWorkSpace_interp_hold_PP/FromWorkspace
160
*)
161
node  FromWorkspace_19_080(__time_step : real;
162
	__nb_step : int;)
163
returns(Out1_1 : real;);
164
var D_1 : real;
165
	T_1 : real;
166
let
167
	D_1 = if ((__nb_step mod 1) = 0) then
168
		__time_step
169
	    else if (__nb_step = 0) then
170
		0.0
171
	    else (pre D_1);
172
	T_1 = T_21948_003_ext_node(D_1);
173
	Out1_1 = T_1;
174
tel
175

    
176
(*
177
Original block name: FromWorkSpace_interp_hold_PP
178
*)
179
node  FromWorkSpace_interp_hold_PP(_virtual : bool;)
180
returns(Out1_1 : real;);
181
var FromWorkspace_1 : real;
182
	__time_step : real;
183
	__nb_step : int;
184
let
185
	FromWorkspace_1 = FromWorkspace_19_080(__time_step, __nb_step);
186
	Out1_1 = FromWorkspace_1;
187
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
188
	__nb_step = (0 -> ((pre __nb_step) + 1));
189
tel
190

    
(739-739/1153)