Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5.44 KB)

1 4748b215 hbourbou
-- This file has been generated by CoCoSim2.
2
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 23:10:54
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_39399_003_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_39399_003_table_elem_1 : real;
19
	T_39399_003_table_elem_2 : real;
20
	T_39399_003_table_elem_3 : real;
21
	T_39399_003_Breakpoints_dim1_1 : real;
22
	T_39399_003_Breakpoints_dim1_2 : real;
23
	T_39399_003_Breakpoints_dim1_3 : real;
24
	T_39399_003_dimJump_1 : int;
25
	T_39399_003_index_dim_1_1 : int;
26
	T_39399_003_index_dim_1_2 : int;
27
	T_39399_003_coords_dim_1_1 : real;
28
	T_39399_003_coords_dim_1_2 : real;
29
	T_39399_003_u_node_1 : real;
30
	T_39399_003_N_shape_1 : real;
31
	T_39399_003_u_node_2 : real;
32
	T_39399_003_N_shape_2 : real;
33
	T_39399_003_bound_node_index_1 : int;
34
	T_39399_003_bound_node_index_2 : int;
35
	T_39399_003_clip_input_1 : real;
36
let
37
	T_39399_003_table_elem_1 = 20.000000000000000;
38
	T_39399_003_table_elem_2 = 40.000000000000000;
39
	T_39399_003_table_elem_3 = 0.000000000000000;
40
	T_39399_003_Breakpoints_dim1_1 = 10.000000000000000;
41
	T_39399_003_Breakpoints_dim1_2 = 29.999999800000001;
42
	T_39399_003_Breakpoints_dim1_3 = 30.000000000000000;
43
	T_39399_003_dimJump_1 = 1;
44
	T_39399_003_index_dim_1_1 = if ((D_1 >= T_39399_003_Breakpoints_dim1_3) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
45
		2
46
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_2) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
47
		2
48
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_1) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
49
		1
50
	    else 1;
51
	T_39399_003_coords_dim_1_1 = if ((D_1 >= T_39399_003_Breakpoints_dim1_3) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
52
		T_39399_003_Breakpoints_dim1_2
53
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_2) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
54
		T_39399_003_Breakpoints_dim1_2
55
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_1) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
56
		T_39399_003_Breakpoints_dim1_1
57
	    else T_39399_003_Breakpoints_dim1_1;
58
	T_39399_003_index_dim_1_2 = if ((D_1 >= T_39399_003_Breakpoints_dim1_3) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
59
		3
60
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_2) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
61
		3
62
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_1) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
63
		2
64
	    else 2;
65
	T_39399_003_coords_dim_1_2 = if ((D_1 >= T_39399_003_Breakpoints_dim1_3) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_3) <= 0.000000000000003552713678800501) then
66
		T_39399_003_Breakpoints_dim1_3
67
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_2) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
68
		T_39399_003_Breakpoints_dim1_3
69
	    else if ((D_1 >= T_39399_003_Breakpoints_dim1_1) or abs_real(D_1 - T_39399_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
70
		T_39399_003_Breakpoints_dim1_2
71
	    else T_39399_003_Breakpoints_dim1_2;
72
	T_39399_003_bound_node_index_1 = (T_39399_003_index_dim_1_1 * 1);
73
	T_39399_003_u_node_1 = if (T_39399_003_bound_node_index_1 = 1) then
74
		T_39399_003_table_elem_1
75
	    else if (T_39399_003_bound_node_index_1 = 2) then
76
		T_39399_003_table_elem_2
77
	    else T_39399_003_table_elem_3;
78
	T_39399_003_bound_node_index_2 = (T_39399_003_index_dim_1_2 * 1);
79
	T_39399_003_u_node_2 = if (T_39399_003_bound_node_index_2 = 1) then
80
		T_39399_003_table_elem_1
81
	    else if (T_39399_003_bound_node_index_2 = 2) then
82
		T_39399_003_table_elem_2
83
	    else T_39399_003_table_elem_3;
84
	T_39399_003_clip_input_1 = if ((D_1 < T_39399_003_coords_dim_1_1) and abs_real(D_1 - T_39399_003_coords_dim_1_1) > 0.000000000000001776356839400250) then
85
		T_39399_003_coords_dim_1_1
86
	    else if ((D_1 > T_39399_003_coords_dim_1_2) and abs_real(D_1 - T_39399_003_coords_dim_1_2) > 0.000000000000003552713678800501) then
87
		T_39399_003_coords_dim_1_2
88
	    else D_1;
89
	T_39399_003_N_shape_1 = ((T_39399_003_coords_dim_1_2 - T_39399_003_clip_input_1) / (T_39399_003_coords_dim_1_2 - T_39399_003_coords_dim_1_1));
90
	T_39399_003_N_shape_2 = ((T_39399_003_clip_input_1 - T_39399_003_coords_dim_1_1) / (T_39399_003_coords_dim_1_2 - T_39399_003_coords_dim_1_1));
91
	T_1 = ( (T_39399_003_N_shape_1 * T_39399_003_u_node_1) + (T_39399_003_N_shape_2 * T_39399_003_u_node_2) );
92
tel
93
94
(*
95
Original block name: FromWorkSpace_1_setting_to_zero_PP/FromWorkspace
96
*)
97
node  FromWorkspace_31_581(__time_step : real;
98
	__nb_step : int;)
99
returns(Out1_1 : real;);
100
var D_1 : real;
101
	T_1 : real;
102
let
103
	D_1 = if ((__nb_step mod 1) = 0) then
104
		__time_step
105
	    else if (__nb_step = 0) then
106
		0.0
107
	    else (pre D_1);
108
	T_1 = T_39399_003_ext_node(D_1);
109
	Out1_1 = T_1;
110
tel
111
112
(*
113
Original block name: FromWorkSpace_1_setting_to_zero_PP
114
*)
115
node  FromWorkSpace_1_setting_to_zero_PP(_virtual : bool;)
116
returns(Out1_1 : real;);
117
var FromWorkspace_1 : real;
118
	__time_step : real;
119
	__nb_step : int;
120
let
121
	FromWorkspace_1 = FromWorkspace_31_581(__time_step, __nb_step);
122
	Out1_1 = FromWorkspace_1;
123
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
124
	__nb_step = (0 -> ((pre __nb_step) + 1));
125
tel