Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (7.06 KB)

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

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:39:02
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_003_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_21436_003_table_elem_1 : real;
19
	T_21436_003_table_elem_2 : real;
20
	T_21436_003_table_elem_3 : real;
21
	T_21436_003_table_elem_4 : real;
22
	T_21436_003_table_elem_5 : real;
23
	T_21436_003_Breakpoints_dim1_1 : real;
24
	T_21436_003_Breakpoints_dim1_2 : real;
25
	T_21436_003_Breakpoints_dim1_3 : real;
26
	T_21436_003_Breakpoints_dim1_4 : real;
27
	T_21436_003_Breakpoints_dim1_5 : real;
28
	T_21436_003_dimJump_1 : int;
29
	T_21436_003_index_dim_1_1 : int;
30
	T_21436_003_index_dim_1_2 : int;
31
	T_21436_003_coords_dim_1_1 : real;
32
	T_21436_003_coords_dim_1_2 : real;
33
	T_21436_003_u_node_1 : real;
34
	T_21436_003_N_shape_1 : real;
35
	T_21436_003_u_node_2 : real;
36
	T_21436_003_N_shape_2 : real;
37
	T_21436_003_bound_node_index_1 : int;
38
	T_21436_003_bound_node_index_2 : int;
39
	T_21436_003_clip_input_1 : real;
40
let
41
	T_21436_003_table_elem_1 = 1.000000000000000;
42
	T_21436_003_table_elem_2 = 2.000000000000000;
43
	T_21436_003_table_elem_3 = 3.000000000000000;
44
	T_21436_003_table_elem_4 = 4.000000000000000;
45
	T_21436_003_table_elem_5 = 5.000000000000000;
46
	T_21436_003_Breakpoints_dim1_1 = 0.000000000000000;
47
	T_21436_003_Breakpoints_dim1_2 = 10.000000000000000;
48
	T_21436_003_Breakpoints_dim1_3 = 20.000000000000000;
49
	T_21436_003_Breakpoints_dim1_4 = 30.000000000000000;
50
	T_21436_003_Breakpoints_dim1_5 = 40.000000000000000;
51
	T_21436_003_dimJump_1 = 1;
52
	T_21436_003_index_dim_1_1 = if ((D_1 >= T_21436_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_5) <= 0.000000000000007105427357601002) then
53
		4
54
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
55
		4
56
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
57
		3
58
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_2) <= 0.000000000000001776356839400250) then
59
		2
60
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
61
		1
62
	    else 1;
63
	T_21436_003_coords_dim_1_1 = if ((D_1 >= T_21436_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_5) <= 0.000000000000007105427357601002) then
64
		T_21436_003_Breakpoints_dim1_4
65
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
66
		T_21436_003_Breakpoints_dim1_4
67
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
68
		T_21436_003_Breakpoints_dim1_3
69
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_2) <= 0.000000000000001776356839400250) then
70
		T_21436_003_Breakpoints_dim1_2
71
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
72
		T_21436_003_Breakpoints_dim1_1
73
	    else T_21436_003_Breakpoints_dim1_1;
74
	T_21436_003_index_dim_1_2 = if ((D_1 >= T_21436_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_5) <= 0.000000000000007105427357601002) then
75
		5
76
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
77
		5
78
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
79
		4
80
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_2) <= 0.000000000000001776356839400250) then
81
		3
82
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
83
		2
84
	    else 2;
85
	T_21436_003_coords_dim_1_2 = if ((D_1 >= T_21436_003_Breakpoints_dim1_5) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_5) <= 0.000000000000007105427357601002) then
86
		T_21436_003_Breakpoints_dim1_5
87
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_4) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_4) <= 0.000000000000003552713678800501) then
88
		T_21436_003_Breakpoints_dim1_5
89
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_3) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
90
		T_21436_003_Breakpoints_dim1_4
91
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_2) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_2) <= 0.000000000000001776356839400250) then
92
		T_21436_003_Breakpoints_dim1_3
93
	    else if ((D_1 >= T_21436_003_Breakpoints_dim1_1) or abs_real(D_1 - T_21436_003_Breakpoints_dim1_1) <= 0.000000000000000000000000000000) then
94
		T_21436_003_Breakpoints_dim1_2
95
	    else T_21436_003_Breakpoints_dim1_2;
96
	T_21436_003_bound_node_index_1 = (T_21436_003_index_dim_1_1 * 1);
97
	T_21436_003_u_node_1 = if (T_21436_003_bound_node_index_1 = 1) then
98
		T_21436_003_table_elem_1
99
	    else if (T_21436_003_bound_node_index_1 = 2) then
100
		T_21436_003_table_elem_2
101
	    else if (T_21436_003_bound_node_index_1 = 3) then
102
		T_21436_003_table_elem_3
103
	    else if (T_21436_003_bound_node_index_1 = 4) then
104
		T_21436_003_table_elem_4
105
	    else T_21436_003_table_elem_5;
106
	T_21436_003_bound_node_index_2 = (T_21436_003_index_dim_1_2 * 1);
107
	T_21436_003_u_node_2 = if (T_21436_003_bound_node_index_2 = 1) then
108
		T_21436_003_table_elem_1
109
	    else if (T_21436_003_bound_node_index_2 = 2) then
110
		T_21436_003_table_elem_2
111
	    else if (T_21436_003_bound_node_index_2 = 3) then
112
		T_21436_003_table_elem_3
113
	    else if (T_21436_003_bound_node_index_2 = 4) then
114
		T_21436_003_table_elem_4
115
	    else T_21436_003_table_elem_5;
116
	T_21436_003_clip_input_1 = D_1;
117
	T_21436_003_N_shape_1 = ((T_21436_003_coords_dim_1_2 - T_21436_003_clip_input_1) / (T_21436_003_coords_dim_1_2 - T_21436_003_coords_dim_1_1));
118
	T_21436_003_N_shape_2 = ((T_21436_003_clip_input_1 - T_21436_003_coords_dim_1_1) / (T_21436_003_coords_dim_1_2 - T_21436_003_coords_dim_1_1));
119
	T_1 = ( (T_21436_003_N_shape_1 * T_21436_003_u_node_1) + (T_21436_003_N_shape_2 * T_21436_003_u_node_2) );
120
tel
121

    
122
(*
123
Original block name: FromWorkSpace_interp_extrap_ts_PP/FromWorkspace
124
*)
125
node  FromWorkspace_19_080(__time_step : real;
126
	__nb_step : int;)
127
returns(Out1_1 : real;);
128
var D_1 : real;
129
	T_1 : real;
130
let
131
	D_1 = if ((__nb_step mod 1) = 0) then
132
		__time_step
133
	    else if (__nb_step = 0) then
134
		0.0
135
	    else (pre D_1);
136
	T_1 = T_21436_003_ext_node(D_1);
137
	Out1_1 = T_1;
138
tel
139

    
140
(*
141
Original block name: FromWorkSpace_interp_extrap_ts_PP
142
*)
143
node  FromWorkSpace_interp_extrap_ts_PP(_virtual : bool;)
144
returns(Out1_1 : real;);
145
var FromWorkspace_1 : real;
146
	__time_step : real;
147
	__nb_step : int;
148
let
149
	FromWorkspace_1 = FromWorkspace_19_080(__time_step, __nb_step);
150
	Out1_1 = FromWorkspace_1;
151
	__time_step = (0.0 -> ((pre __time_step) + 0.100000000000000));
152
	__nb_step = (0 -> ((pre __nb_step) + 1));
153
tel
154