Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.69 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:00:33
5
#open <conv>
6
node  _max_int(x : int;
7
	y : int;)
8
returns(z : int;);
9
let
10
	z = if (x > y) then
11
		x
12
	    else y;
13
tel
14
15
node  _max_real(x : real;
16
	y : real;)
17
returns(z : real;);
18
let
19
	z = if (x > y) then
20
		x
21
	    else y;
22
tel
23
24
node  _min_int(x : int;
25
	y : int;)
26
returns(z : int;);
27
let
28
	z = if (x < y) then
29
		x
30
	    else y;
31
tel
32
33
node  _min_real(x : real;
34
	y : real;)
35
returns(z : real;);
36
let
37
	z = if (x < y) then
38
		x
39
	    else y;
40
tel
41
42
(*
43
Original block name: Saturation_PP/Saturation
44
*)
45
node  Saturation_34_114(In_1 : real;
46
	In_2 : real;
47
	In_3 : real;
48
	In_4 : real;
49
	In_5 : real;
50
	In_6 : real;
51
	__time_step : real;
52
	__nb_step : int;)
53
returns(Out_1 : int;
54
	Out_2 : int;
55
	Out_3 : int;
56
	Out_4 : int;
57
	Out_5 : int;
58
	Out_6 : int;);
59
var lower_1 : int;
60
	lower_2 : int;
61
	lower_3 : int;
62
	lower_4 : int;
63
	lower_5 : int;
64
	lower_6 : int;
65
	lower_limit_1 : int;
66
	upper_1 : int;
67
	upper_2 : int;
68
	upper_3 : int;
69
	upper_4 : int;
70
	upper_5 : int;
71
	upper_6 : int;
72
	upper_limit_1 : int;
73
let
74
	lower_1 = _max_int(upper_1, lower_limit_1);
75
	lower_2 = _max_int(upper_2, lower_limit_1);
76
	lower_3 = _max_int(upper_3, lower_limit_1);
77
	lower_4 = _max_int(upper_4, lower_limit_1);
78
	lower_5 = _max_int(upper_5, lower_limit_1);
79
	lower_6 = _max_int(upper_6, lower_limit_1);
80
	lower_limit_1 = 2;
81
	upper_1 = _min_int(upper_limit_1, _Floor(In_1));
82
	upper_2 = _min_int(upper_limit_1, _Floor(In_2));
83
	upper_3 = _min_int(upper_limit_1, _Floor(In_3));
84
	upper_4 = _min_int(upper_limit_1, _Floor(In_4));
85
	upper_5 = _min_int(upper_limit_1, _Floor(In_5));
86
	upper_6 = _min_int(upper_limit_1, _Floor(In_6));
87
	upper_limit_1 = 5;
88
	Out_1 = lower_1;
89
	Out_2 = lower_2;
90
	Out_3 = lower_3;
91
	Out_4 = lower_4;
92
	Out_5 = lower_5;
93
	Out_6 = lower_6;
94
tel
95
96
(*
97
Original block name: Saturation_PP/Saturation1
98
*)
99
node  Saturation1_47_956(In_1 : real;
100
	In_2 : real;
101
	In_3 : real;
102
	In_4 : real;
103
	In_5 : real;
104
	In_6 : real;
105
	__time_step : real;
106
	__nb_step : int;)
107
returns(Out_1 : real;
108
	Out_2 : real;
109
	Out_3 : real;
110
	Out_4 : real;
111
	Out_5 : real;
112
	Out_6 : real;);
113
var lower_1 : real;
114
	lower_2 : real;
115
	lower_3 : real;
116
	lower_4 : real;
117
	lower_5 : real;
118
	lower_6 : real;
119
	lower_limit_1 : real;
120
	upper_1 : real;
121
	upper_2 : real;
122
	upper_3 : real;
123
	upper_4 : real;
124
	upper_5 : real;
125
	upper_6 : real;
126
	upper_limit_1 : real;
127
let
128
	lower_1 = _max_real(upper_1, lower_limit_1);
129
	lower_2 = _max_real(upper_2, lower_limit_1);
130
	lower_3 = _max_real(upper_3, lower_limit_1);
131
	lower_4 = _max_real(upper_4, lower_limit_1);
132
	lower_5 = _max_real(upper_5, lower_limit_1);
133
	lower_6 = _max_real(upper_6, lower_limit_1);
134
	lower_limit_1 = 2.000000000000000;
135
	upper_1 = _min_real(upper_limit_1, In_1);
136
	upper_2 = _min_real(upper_limit_1, In_2);
137
	upper_3 = _min_real(upper_limit_1, In_3);
138
	upper_4 = _min_real(upper_limit_1, In_4);
139
	upper_5 = _min_real(upper_limit_1, In_5);
140
	upper_6 = _min_real(upper_limit_1, In_6);
141
	upper_limit_1 = 5.000000000000000;
142
	Out_1 = lower_1;
143
	Out_2 = lower_2;
144
	Out_3 = lower_3;
145
	Out_4 = lower_4;
146
	Out_5 = lower_5;
147
	Out_6 = lower_6;
148
tel
149
150
(*
151
Original block name: Saturation_PP
152
*)
153
node  Saturation_PP(_virtual : bool;)
154
returns(Out1_1 : int;
155
	Out1_2 : int;
156
	Out1_3 : int;
157
	Out1_4 : int;
158
	Out1_5 : int;
159
	Out1_6 : int;
160
	Out2_1 : real;
161
	Out2_2 : real;
162
	Out2_3 : real;
163
	Out2_4 : real;
164
	Out2_5 : real;
165
	Out2_6 : real;);
166
var Constant_1 : real;
167
	Constant_2 : real;
168
	Constant_3 : real;
169
	Constant_4 : real;
170
	Constant_5 : real;
171
	Constant_6 : real;
172
	Saturation_1 : int;
173
	Saturation_2 : int;
174
	Saturation_3 : int;
175
	Saturation_4 : int;
176
	Saturation_5 : int;
177
	Saturation_6 : int;
178
	Saturation1_1 : real;
179
	Saturation1_2 : real;
180
	Saturation1_3 : real;
181
	Saturation1_4 : real;
182
	Saturation1_5 : real;
183
	Saturation1_6 : real;
184
	__time_step : real;
185
	__nb_step : int;
186
let
187
	Constant_1 = 1.000000000000000;
188
	Constant_2 = 4.000000000000000;
189
	Constant_3 = 2.300000000000000;
190
	Constant_4 = 5.000000000000000;
191
	Constant_5 = 3.000000000000000;
192
	Constant_6 = 6.000000000000000;
193
	(Saturation_1, Saturation_2, Saturation_3, Saturation_4, Saturation_5, Saturation_6) = Saturation_34_114(Constant_1, Constant_2, Constant_3, Constant_4, Constant_5, Constant_6, __time_step, __nb_step);
194
	(Saturation1_1, Saturation1_2, Saturation1_3, Saturation1_4, Saturation1_5, Saturation1_6) = Saturation1_47_956(Constant_1, Constant_2, Constant_3, Constant_4, Constant_5, Constant_6, __time_step, __nb_step);
195
	Out1_1 = Saturation_1;
196
	Out1_2 = Saturation_2;
197
	Out1_3 = Saturation_3;
198
	Out1_4 = Saturation_4;
199
	Out1_5 = Saturation_5;
200
	Out1_6 = Saturation_6;
201
	Out2_1 = Saturation1_1;
202
	Out2_2 = Saturation1_2;
203
	Out2_3 = Saturation1_3;
204
	Out2_4 = Saturation1_4;
205
	Out2_5 = Saturation1_5;
206
	Out2_6 = Saturation1_6;
207
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
208
	__nb_step = (0 -> ((pre __nb_step) + 1));
209
tel