Project

General

Profile

Download (9 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:38:36
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_21436_002_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_21436_002_table_elem_1 : real;
19
	T_21436_002_table_elem_2 : real;
20
	T_21436_002_table_elem_3 : real;
21
	T_21436_002_table_elem_4 : real;
22
	T_21436_002_table_elem_5 : real;
23
	T_21436_002_table_elem_6 : real;
24
	T_21436_002_table_elem_7 : real;
25
	T_21436_002_Breakpoints_dim1_1 : real;
26
	T_21436_002_Breakpoints_dim1_2 : real;
27
	T_21436_002_Breakpoints_dim1_3 : real;
28
	T_21436_002_Breakpoints_dim1_4 : real;
29
	T_21436_002_Breakpoints_dim1_5 : real;
30
	T_21436_002_Breakpoints_dim1_6 : real;
31
	T_21436_002_Breakpoints_dim1_7 : real;
32
	T_21436_002_dimJump_1 : int;
33
	T_21436_002_index_dim_1_1 : int;
34
	T_21436_002_index_dim_1_2 : int;
35
	T_21436_002_coords_dim_1_1 : real;
36
	T_21436_002_coords_dim_1_2 : real;
37
	T_21436_002_u_node_1 : real;
38
	T_21436_002_N_shape_1 : real;
39
	T_21436_002_u_node_2 : real;
40
	T_21436_002_N_shape_2 : real;
41
	T_21436_002_bound_node_index_1 : int;
42
	T_21436_002_bound_node_index_2 : int;
43
	T_21436_002_clip_input_1 : real;
44
let
45
	T_21436_002_table_elem_1 = 5.000000000000000;
46
	T_21436_002_table_elem_2 = 20.000000000000000;
47
	T_21436_002_table_elem_3 = 25.000000000000000;
48
	T_21436_002_table_elem_4 = 40.000000000000000;
49
	T_21436_002_table_elem_5 = 2.000000000000000;
50
	T_21436_002_table_elem_6 = 4.000000000000000;
51
	T_21436_002_table_elem_7 = 6.000000000000000;
52
	T_21436_002_Breakpoints_dim1_1 = 0.000000000000000;
53
	T_21436_002_Breakpoints_dim1_2 = 0.200000000000000;
54
	T_21436_002_Breakpoints_dim1_3 = 0.400000000000000;
55
	T_21436_002_Breakpoints_dim1_4 = 0.600000000000000;
56
	T_21436_002_Breakpoints_dim1_5 = 0.800000000000000;
57
	T_21436_002_Breakpoints_dim1_6 = 1.000000000000000;
58
	T_21436_002_Breakpoints_dim1_7 = 1.200000000000000;
59
	T_21436_002_dimJump_1 = 1;
60
	T_21436_002_index_dim_1_1 = if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
61
		6
62
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
63
		6
64
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
65
		5
66
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
67
		4
68
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
69
		3
70
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
71
		2
72
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
73
		1
74
	    else 1;
75
	T_21436_002_coords_dim_1_1 = if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
76
		T_21436_002_Breakpoints_dim1_6
77
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
78
		T_21436_002_Breakpoints_dim1_6
79
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
80
		T_21436_002_Breakpoints_dim1_5
81
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
82
		T_21436_002_Breakpoints_dim1_4
83
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
84
		T_21436_002_Breakpoints_dim1_3
85
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
86
		T_21436_002_Breakpoints_dim1_2
87
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
88
		T_21436_002_Breakpoints_dim1_1
89
	    else T_21436_002_Breakpoints_dim1_1;
90
	T_21436_002_index_dim_1_2 = if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
91
		7
92
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
93
		7
94
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
95
		6
96
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
97
		5
98
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
99
		4
100
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
101
		3
102
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
103
		2
104
	    else 2;
105
	T_21436_002_coords_dim_1_2 = if ((D_1 >= T_21436_002_Breakpoints_dim1_7) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_7) <= 0.000000000000000222044604925031) then
106
		T_21436_002_Breakpoints_dim1_7
107
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_6) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_6) <= 0.000000000000000222044604925031) then
108
		T_21436_002_Breakpoints_dim1_7
109
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_5) <= 0.000000000000000111022302462516) then
110
		T_21436_002_Breakpoints_dim1_6
111
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_4) <= 0.000000000000000111022302462516) then
112
		T_21436_002_Breakpoints_dim1_5
113
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_3) <= 0.000000000000000055511151231258) then
114
		T_21436_002_Breakpoints_dim1_4
115
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_2) <= 0.000000000000000027755575615629) then
116
		T_21436_002_Breakpoints_dim1_3
117
	    else if ((D_1 >= T_21436_002_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_002_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
118
		T_21436_002_Breakpoints_dim1_2
119
	    else T_21436_002_Breakpoints_dim1_2;
120
	T_21436_002_bound_node_index_1 = (T_21436_002_index_dim_1_1 * 1);
121
	T_21436_002_u_node_1 = if (T_21436_002_bound_node_index_1 = 1) then
122
		T_21436_002_table_elem_1
123
	    else if (T_21436_002_bound_node_index_1 = 2) then
124
		T_21436_002_table_elem_2
125
	    else if (T_21436_002_bound_node_index_1 = 3) then
126
		T_21436_002_table_elem_3
127
	    else if (T_21436_002_bound_node_index_1 = 4) then
128
		T_21436_002_table_elem_4
129
	    else if (T_21436_002_bound_node_index_1 = 5) then
130
		T_21436_002_table_elem_5
131
	    else if (T_21436_002_bound_node_index_1 = 6) then
132
		T_21436_002_table_elem_6
133
	    else T_21436_002_table_elem_7;
134
	T_21436_002_bound_node_index_2 = (T_21436_002_index_dim_1_2 * 1);
135
	T_21436_002_u_node_2 = if (T_21436_002_bound_node_index_2 = 1) then
136
		T_21436_002_table_elem_1
137
	    else if (T_21436_002_bound_node_index_2 = 2) then
138
		T_21436_002_table_elem_2
139
	    else if (T_21436_002_bound_node_index_2 = 3) then
140
		T_21436_002_table_elem_3
141
	    else if (T_21436_002_bound_node_index_2 = 4) then
142
		T_21436_002_table_elem_4
143
	    else if (T_21436_002_bound_node_index_2 = 5) then
144
		T_21436_002_table_elem_5
145
	    else if (T_21436_002_bound_node_index_2 = 6) then
146
		T_21436_002_table_elem_6
147
	    else T_21436_002_table_elem_7;
148
	T_21436_002_clip_input_1 = D_1;
149
	T_21436_002_N_shape_1 = ((T_21436_002_coords_dim_1_2 - T_21436_002_clip_input_1) / (T_21436_002_coords_dim_1_2 - T_21436_002_coords_dim_1_1));
150
	T_21436_002_N_shape_2 = ((T_21436_002_clip_input_1 - T_21436_002_coords_dim_1_1) / (T_21436_002_coords_dim_1_2 - T_21436_002_coords_dim_1_1));
151
	T_1 = ( (T_21436_002_N_shape_1 * T_21436_002_u_node_1) + (T_21436_002_N_shape_2 * T_21436_002_u_node_2) );
152
tel
153

    
154
(*
155
Original block name: FromWorkSpace_interp_extrap_PP/FromWorkspace
156
*)
157
node  FromWorkspace_19_079(__time_step : real;
158
	__nb_step : int;)
159
returns(Out1_1 : real;);
160
var D_1 : real;
161
	T_1 : real;
162
let
163
	D_1 = if ((__nb_step mod 1) = 0) then
164
		__time_step
165
	    else if (__nb_step = 0) then
166
		0.0
167
	    else (pre D_1);
168
	T_1 = T_21436_002_ext_node(D_1);
169
	Out1_1 = T_1;
170
tel
171

    
172
(*
173
Original block name: FromWorkSpace_interp_extrap_PP
174
*)
175
node  FromWorkSpace_interp_extrap_PP(_virtual : bool;)
176
returns(Out1_1 : real;);
177
var FromWorkspace_1 : real;
178
	__time_step : real;
179
	__nb_step : int;
180
let
181
	FromWorkspace_1 = FromWorkspace_19_079(__time_step, __nb_step);
182
	Out1_1 = FromWorkspace_1;
183
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
184
	__nb_step = (0 -> ((pre __nb_step) + 1));
185
tel
186

    
(715-715/1153)