Revision 3d9babd4
Added by PierreLoïc Garoche over 2 years ago
github_issues/2019_09_05_hamza_rosace_alg_loop/fullrosace_PP.LUSTREC.lus  

1 
 This file has been generated by CoCoSim2. 

2  
3 
 Compiler: Lustre compiler 2 (nasa_toLustre.ToLustre.m) 

4 
 Time: 04Sep2019 16:48:14 

5 
#open <lustrec_math> 

6  
7 
node _make_clock( 

8 
period : int; phase : int;) 

9 
returns( 

10 
clk : bool;); 

11 
var 

12 
count : int; 

13 
let 

14 
count = (((period  phase) > ((pre (count)) + 1)) mod period); 

15 
clk = (count = 0); 

16 
tel 

17  
18 
(* 

19 
Original block name: fullrosace_PP/AltitudeHold/AltitudeCaptureHold/DT_Integrator1 

20 
*) 

21 
node DT_Integrator1_15_001( 

22 
f_lpar_x_rpar__1 : real; x0_1 : real; __time_step : real; __nb_step : int;) 

23 
returns( 

24 
F_lpar_x_rpar__1 : real;); 

25 
var 

26 
Product_1 : real; UnitDelay_1 : real; 

27 
let 

28 
Product_1 = 1.0 * x0_1 * ( (1.0 > (pre (0.0))) ); 

29 
UnitDelay_1 = (0.0 > (pre (( ( (f_lpar_x_rpar__1 * 0.020) ) + ( UnitDelay_1 + Product_1 ) )))); 

30 
F_lpar_x_rpar__1 = ( UnitDelay_1 + Product_1 ); 

31 
tel 

32  
33 
(* 

34 
Original block name: fullrosace_PP/AltitudeHold/AltitudeCaptureHold 

35 
*) 

36 
node AltitudeCaptureHold_9_000_condExecSS( 

37 
h_meas_1 : real; h_c_1 : real; Vz_c_1 : real; _isEnabled : bool; __time_step : real; 

38 
__nb_step : int;) 

39 
returns( 

40 
Vz_c_newline__1 : real;); 

41 
var 

42 
pre_Vz_c_newline__1 : real; _isEnabled_clock : bool clock; _isEnabled_reset_clock : bool clock; 

43 
let 

44 
pre_Vz_c_newline__1 = if (__nb_step > 0) then 

45 
(pre (Vz_c_newline__1)) 

46 
else 0.0; 

47 
_isEnabled_clock = _isEnabled; 

48 
_isEnabled_reset_clock = (false > (_isEnabled_clock and (not ((pre (_isEnabled_clock)))))); 

49 
Vz_c_newline__1 = (merge _isEnabled_clock 

50 
(true > (AltitudeCaptureHold_9_000((h_meas_1 when _isEnabled_clock), (h_c_1 when _isEnabled_clock), (Vz_c_1 when _isEnabled_clock), (__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every _isEnabled_reset_clock)) 

51 
(false > pre_Vz_c_newline__1 when false(_isEnabled_clock))); 

52 
tel 

53  
54 
(* 

55 
Original block name: fullrosace_PP/AltitudeHold/AltitudeCaptureHold 

56 
*) 

57 
node AltitudeCaptureHold_9_000( 

58 
h_meas_1 : real; h_c_1 : real; Vz_c_1 : real; __time_step : real; __nb_step : int;) 

59 
returns( 

60 
Vz_c_newline__1 : real;); 

61 
var 

62 
Sum1_1 : real; 

63 
let 

64 
Sum1_1 = h_meas_1  h_c_1; 

65 
Vz_c_newline__1 = ( ( (Sum1_1 * 0.10140480) ) + ( DT_Integrator1_15_001((Sum1_1 * 0.00482880), Vz_c_1  Sum1_1 * 0.10140, __time_step, __nb_step) ) ); 

66 
tel 

67  
68 
(* 

69 
Original block name: fullrosace_PP/AltitudeHold/Climb_command 

70 
*) 

71 
node Climb_command_61_001_condExecSS( 

72 
_isEnabled : bool; __time_step : real; __nb_step : int;) 

73 
returns( 

74 
Vz_c_1 : real;); 

75 
var 

76 
pre_Vz_c_1 : real; _isEnabled_clock : bool clock; 

77 
let 

78 
pre_Vz_c_1 = if (__nb_step > 0) then 

79 
(pre (Vz_c_1)) 

80 
else 0.0; 

81 
_isEnabled_clock = _isEnabled; 

82 
Vz_c_1 = (merge _isEnabled_clock 

83 
(true > Climb_command_61_001((__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock))) 

84 
(false > pre_Vz_c_1 when false(_isEnabled_clock))); 

85 
tel 

86  
87 
(* 

88 
Original block name: fullrosace_PP/AltitudeHold/Climb_command 

89 
*) 

90 
node Climb_command_61_001( 

91 
__time_step : real; __nb_step : int;) 

92 
returns( 

93 
Vz_c_1 : real;); 

94 
let 

95 
Vz_c_1 = 2.50; 

96 
tel 

97  
98 
(* 

99 
Original block name: fullrosace_PP/AltitudeHold/Descent_command 

100 
*) 

101 
node Descent_command_66_002_condExecSS( 

102 
_isEnabled : bool; __time_step : real; __nb_step : int;) 

103 
returns( 

104 
Vz_c_1 : real;); 

105 
var 

106 
pre_Vz_c_1 : real; _isEnabled_clock : bool clock; _isEnabled_reset_clock : bool clock; 

107 
let 

108 
pre_Vz_c_1 = if (__nb_step > 0) then 

109 
(pre (Vz_c_1)) 

110 
else 0.0; 

111 
_isEnabled_clock = _isEnabled; 

112 
_isEnabled_reset_clock = (false > (_isEnabled_clock and (not ((pre (_isEnabled_clock)))))); 

113 
Vz_c_1 = (merge _isEnabled_clock 

114 
(true > (Descent_command_66_002((__time_step when _isEnabled_clock), (__nb_step when _isEnabled_clock)) every _isEnabled_reset_clock)) 

115 
(false > pre_Vz_c_1 when false(_isEnabled_clock))); 

116 
tel 

117  
118 
(* 

119 
Original block name: fullrosace_PP/AltitudeHold/Descent_command 

120 
*) 

121 
node Descent_command_66_002( 

122 
__time_step : real; __nb_step : int;) 

123 
returns( 

124 
Vz_c_1 : real;); 

125 
let 

126 
Vz_c_1 = 2.50; 

127 
tel 

128  
129 
(* 

130 
Original block name: fullrosace_PP/AltitudeHold/Memory 

131 
*) 

132 
node Memory_72_001( 

133 
In1_1 : real; __time_step : real; __nb_step : int;) 

134 
returns( 

135 
Out1_1 : real;); 

136 
let 

137 
Out1_1 = ( (0.0 > (pre (In1_1))) ); 

138 
tel 

139  
140 
(* 

141 
Original block name: fullrosace_PP/AltitudeHold 

142 
*) 

143 
node AltitudeHold_6_000( 

144 
hc_1 : real; hmeas_1 : real; __time_step : real; __nb_step : int;) 

145 
returns( 

146 
Vz_c_1 : real;); 

147 
var 

148 
ExecutionCond_of_AltitudeCaptureHold_9_000 : bool; ExecutionCond_of_Climb_command_61_001 : bool; ExecutionCond_of_Descent_command_66_002 : bool; Logic_SpeedCommand_1 : bool; Logic_SpeedCommand_2 : bool; 

149 
Logic_SpeedCommand_3 : bool; Merge_1 : real; Sum3_1 : real; 

150 
let 

151 
ExecutionCond_of_AltitudeCaptureHold_9_000 = Logic_SpeedCommand_3; 

152 
ExecutionCond_of_Climb_command_61_001 = Logic_SpeedCommand_1; 

153 
ExecutionCond_of_Descent_command_66_002 = Logic_SpeedCommand_2; 

154 
(Logic_SpeedCommand_1, Logic_SpeedCommand_2, Logic_SpeedCommand_3) = if Sum3_1 > 50.0 then 

155 
(true, false, false) 

156 
else if Sum3_1 <  50.0 then 

157 
(false, true, false) 

158 
else (false, false, true); 

159 
Merge_1 = if ExecutionCond_of_Climb_command_61_001 then 

160 
( Climb_command_61_001_condExecSS(ExecutionCond_of_Climb_command_61_001, __time_step, __nb_step) ) 

161 
else if ExecutionCond_of_Descent_command_66_002 then 

162 
( Descent_command_66_002_condExecSS(ExecutionCond_of_Descent_command_66_002, __time_step, __nb_step) ) 

163 
else if ExecutionCond_of_AltitudeCaptureHold_9_000 then 

164 
( AltitudeCaptureHold_9_000_condExecSS(hmeas_1, hc_1, Memory_72_001(Merge_1, __time_step, __nb_step), ExecutionCond_of_AltitudeCaptureHold_9_000, __time_step, __nb_step) ) 

165 
else (0.0 > (pre (Merge_1))); 

166 
Sum3_1 = hc_1  hmeas_1; 

167 
Vz_c_1 = Merge_1; 

168 
tel 

169  
170 
(* 

171 
Original block name: fullrosace_PP/Elevator/Gain1 

172 
*) 

173 
node Gain1_103_001( 

174 
u_1 : real; __time_step : real; __nb_step : int;) 

175 
returns( 

176 
Out1_1 : real; Out1_2 : real;); 

177 
let 

178 
Out1_1 = ( (0.0 * u_1) ); 

179 
Out1_2 = ( (625.0 * u_1) ); 

180 
tel 

181  
182 
(* 

183 
Original block name: fullrosace_PP/Elevator/Gain2 

184 
*) 

185 
node Gain2_111_001( 

186 
u_1 : real; u_2 : real; __time_step : real; __nb_step : int;) 

187 
returns( 

188 
Out1_1 : real; Out1_2 : real;); 

189 
let 

190 
Out1_1 = ( (0.0 * u_1) + (1.0 * u_2) ); 

191 
Out1_2 = ( (625.0 * u_1) + (42.50 * u_2) ); 

192 
tel 

193  
194 
(* 

195 
Original block name: fullrosace_PP/Elevator/Gain3 

196 
*) 

197 
node Gain3_119_001( 

198 
u_1 : real; u_2 : real; __time_step : real; __nb_step : int;) 

199 
returns( 

200 
Out1_1 : real;); 

201 
let 

202 
Out1_1 = ( (1.0 * u_1) + (0.0 * u_2) ); 

203 
tel 

204  
205 
(* 

206 
Original block name: fullrosace_PP/Elevator 

207 
*) 

208 
node Elevator_100_001( 

209 
delta_e_c_1 : real; __time_step : real; __nb_step : int;) 

210 
returns( 

211 
delta_e_1 : real;); 

212 
var 

213 
Gain1_1 : real; Gain1_2 : real; Gain2_1 : real; Gain2_2 : real; UnitDelay_1 : real; 

214 
UnitDelay_2 : real; 

215 
let 

216 
(Gain1_1, Gain1_2) = Gain1_103_001(delta_e_c_1, __time_step, __nb_step); 

217 
(Gain2_1, Gain2_2) = Gain2_111_001(UnitDelay_1, UnitDelay_2, __time_step, __nb_step); 

218 
UnitDelay_1 = (0.012009615652468 > (pre (( ( (( Gain1_1 + Gain2_1 ) * 0.0050) ) + UnitDelay_1 )))); 

219 
UnitDelay_2 = (0.0 > (pre (( ( (( Gain1_2 + Gain2_2 ) * 0.0050) ) + UnitDelay_2 )))); 

220 
delta_e_1 = ( ( (delta_e_c_1 * 0.0) ) + ( Gain3_119_001(UnitDelay_1, UnitDelay_2, __time_step, __nb_step) ) ); 

221 
tel 

222  
223 
(* 

224 
Original block name: fullrosace_PP/Engine 

225 
*) 

226 
node Engine_150_001( 

227 
delta_x_c_1 : real; __time_step : real; __nb_step : int;) 

228 
returns( 

229 
T_1 : real;); 

230 
var 

231 
UnitDelay_1 : real; 

232 
let 

233 
UnitDelay_1 = (1.58686607949260 > (pre (( ( (( ( (delta_x_c_1 * 0.750) ) + ( (UnitDelay_1 * 0.750) ) ) * 0.0050) ) + UnitDelay_1 )))); 

234 
T_1 = ( ( (delta_x_c_1 * 0.0) ) + ( (UnitDelay_1 * 26350.0) ) ); 

235 
tel 

236  
237 
(* 

238 
Original block name: fullrosace_PP/FlightDynamics/Flight_Dynamics_Model/Aero_Coefficients 

239 
*) 

240 
node Aero_Coefficients_188_000( 

241 
de_1 : real; alpha_1 : real; q_1 : real; V_1 : real; __time_step : real; 

242 
__nb_step : int;) 

243 
returns( 

244 
CD_Drag_coefficient_1 : real; CL_Lift_coefficient_1 : real; Cm_Pitching_coefficient_1 : real;); 

245 
var 

246 
Sum1_1 : real; 

247 
let 

248 
Sum1_1 = alpha_1  0.050; 

249 
CD_Drag_coefficient_1 = ( 0.0160 + ( (de_1 * 0.050) ) + ( (( (Sum1_1 * Sum1_1) ) * 2.50) ) ); 

250 
CL_Lift_coefficient_1 = ( ( (de_1 * 0.1930) ) + ( (Sum1_1 * 5.50) ) ); 

251 
Cm_Pitching_coefficient_1 = ( 0.040 + ( (de_1 * 1.50) ) + ( (alpha_1 * 0.830) ) + ( (( (( 1.0 * q_1 / V_1 ) * 2.1450) ) * 30.0) ) ); 

252 
tel 

253  
254 
(* 

255 
Original block name: fullrosace_PP/FlightDynamics/Flight_Dynamics_Model/Aero_forces_moment 

256 
*) 

257 
node Aero_forces_moment_242_001( 

258 
alpha_1 : real; CD_1 : real; CL_1 : real; Cm_1 : real; qbar_1 : real; 

259 
__time_step : real; __nb_step : int;) 

260 
returns( 

261 
Xa_Xb_force_1 : real; Za_Zb_force_1 : real; Ma_Pitching_moment_1 : real;); 

262 
var 

263 
Gain1_1 : real; Trigo_Function_1 : real; Trigo_Function1_1 : real; 

264 
let 

265 
Gain1_1 = (qbar_1 * 122.599999999999994); 

266 
Trigo_Function_1 = sin(alpha_1); 

267 
Trigo_Function1_1 = cos(alpha_1); 

268 
Xa_Xb_force_1 = ( 1.0 * ( 0.0  ( 1.0 * CD_1 * Trigo_Function1_1 ) + ( 1.0 * Trigo_Function_1 * CL_1 ) ) * Gain1_1 ); 

269 
Za_Zb_force_1 = ( 1.0 * ( 0.0  ( 1.0 * CD_1 * Trigo_Function_1 )  ( 1.0 * Trigo_Function1_1 * CL_1 ) ) * Gain1_1 ); 

270 
Ma_Pitching_moment_1 = ( 1.0 * ( (Cm_1 * 4.290) ) * Gain1_1 ); 

271 
tel 

272  
273 
(* 

274 
Original block name: fullrosace_PP/FlightDynamics/Flight_Dynamics_Model 

275 
*) 

276 
node Flight_Dynamics_Model_186_000( 

277 
x_1 : real; x_2 : real; x_3 : real; x_4 : real; x_5 : real; 

278 
x_6 : real; x_7 : real; __time_step : real; __nb_step : int;) 

279 
returns( 

280 
Za_1 : real; xdot_1 : real; xdot_2 : real; xdot_3 : real; xdot_4 : real; 

281 
xdot_5 : real;); 

282 
var 

283 
Aero_Coefficients_1 : real; Aero_Coefficients_2 : real; Aero_Coefficients_3 : real; Aero_forces_moment_1 : real; Aero_forces_moment_2 : real; 

284 
Aero_forces_moment_3 : real; Angle_of_attack_1 : real; Mux3_2 : real; Mux3_3 : real; Mux3_4 : real; 

285 
Mux3_5 : real; Mux3_6 : real; Mux3_7 : real; V_Airspeed_1 : real; 

286 
let 

287 
(Aero_Coefficients_1, Aero_Coefficients_2, Aero_Coefficients_3) = Aero_Coefficients_188_000(x_2, Angle_of_attack_1, x_5, V_Airspeed_1, __time_step, __nb_step); 

288 
(Aero_forces_moment_1, Aero_forces_moment_2, Aero_forces_moment_3) = Aero_forces_moment_242_001(Angle_of_attack_1, Aero_Coefficients_1, Aero_Coefficients_2, Aero_Coefficients_3, 0.50 * ( 1.2250 * pow(1.0 + 0.00650 / 288.149999999999977 * x_7,  9.806649999999999 / ( 287.050000000000011 * 0.00650 )  1.0) ) * pow(V_Airspeed_1, 2.0), __time_step, __nb_step); 

289 
Angle_of_attack_1 = atan(x_4 / x_3); 

290 
Mux3_2 = x_2; 

291 
Mux3_3 = x_3; 

292 
Mux3_4 = x_4; 

293 
Mux3_5 = x_5; 

294 
Mux3_6 = x_6; 

295 
Mux3_7 = x_7; 

296 
V_Airspeed_1 = sqrt(pow(x_3, 2.0) + pow(x_4, 2.0)); 

297 
Za_1 = Aero_forces_moment_2; 

298 
xdot_1 = (  9.806649999999999 * sin(Mux3_6)  Mux3_5 * Mux3_4 + 1.0 / 57837.50 * ( x_1 + Aero_forces_moment_1 ) ); 

299 
xdot_2 = ( 9.806649999999999 * cos(Mux3_6) + Mux3_5 * Mux3_3 + 1.0 / 57837.50 * Aero_forces_moment_2 ); 

300 
xdot_3 = ( 1.0 / 3781272.0 * Aero_forces_moment_3 ); 

301 
xdot_4 = Mux3_5; 

302 
xdot_5 = ( Mux3_3 * sin(Mux3_6)  Mux3_4 * cos(Mux3_6) ); 

303 
tel 

304  
305 
(* 

306 
Original block name: fullrosace_PP/FlightDynamics 

307 
*) 

308 
node FlightDynamics_181_000( 

309 
T_1 : real; delta_e_1 : real; __time_step : real; __nb_step : int;) 

310 
returns( 

311 
Va_1 : real; az_1 : real; q_1 : real; Vz_1 : real; h_1 : real;); 

312 
var 

313 
Flight_Dynamics_Model_1 : real; Flight_Dynamics_Model_2 : real; Flight_Dynamics_Model_3 : real; Flight_Dynamics_Model_4 : real; Flight_Dynamics_Model_5 : real; 

314 
Flight_Dynamics_Model_6 : real; Mux1_1 : real; Mux1_2 : real; Mux1_4 : real; UnitDelay_1 : real; 

315 
UnitDelay_2 : real; UnitDelay_3 : real; UnitDelay_4 : real; UnitDelay_5 : real; 

316 
let 

317 
(Flight_Dynamics_Model_1, Flight_Dynamics_Model_2, Flight_Dynamics_Model_3, Flight_Dynamics_Model_4, Flight_Dynamics_Model_5, Flight_Dynamics_Model_6) = Flight_Dynamics_Model_186_000(T_1, delta_e_1, UnitDelay_1, UnitDelay_2, UnitDelay_3, UnitDelay_4, UnitDelay_5, __time_step, __nb_step); 

318 
Mux1_1 = UnitDelay_1; 

319 
Mux1_2 = UnitDelay_2; 

320 
Mux1_4 = UnitDelay_4; 

321 
UnitDelay_1 = (229.919332201218026 > (pre (( ( (Flight_Dynamics_Model_2 * 0.0050) ) + UnitDelay_1 )))); 

322 
UnitDelay_2 = (6.091032765135377 > (pre (( ( (Flight_Dynamics_Model_3 * 0.0050) ) + UnitDelay_2 )))); 

323 
UnitDelay_3 = (0.0 > (pre (( ( (Flight_Dynamics_Model_4 * 0.0050) ) + UnitDelay_3 )))); 

324 
UnitDelay_4 = (0.026485847681737 > (pre (( ( (Flight_Dynamics_Model_5 * 0.0050) ) + UnitDelay_4 )))); 

325 
UnitDelay_5 = (10000.0 > (pre (( ( (Flight_Dynamics_Model_6 * 0.0050) ) + UnitDelay_5 )))); 

326 
Va_1 = ( sqrt(pow(Mux1_1, 2.0) + pow(Mux1_2, 2.0)) ); 

327 
az_1 = ( 9.806649999999999 * cos(Mux1_4) + 1.0 / 57837.50 * Flight_Dynamics_Model_1 ); 

328 
q_1 = UnitDelay_3; 

329 
Vz_1 = ( Mux1_2 * cos(Mux1_4)  Mux1_1 * sin(Mux1_4) ); 

330 
h_1 = UnitDelay_5; 

331 
tel 

332  
333 
(* 

334 
Original block name: fullrosace_PP/Va_filter/Discrete_State_Space 

335 
*) 

336 
node Discrete_State_Space_417_000( 

337 
U_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

338 
returns( 

339 
Y_1 : real;); 

340 
var 

341 
X0_1 : real; X0_2 : real; 

342 
let 

343 
X0_1 = (219.894860440452163 > (pre (( ( (0.0 * X0_1) + (0.956543675476034 * X0_2) ) + ( (0.000479064865372 * U_1) ) )))); 

344 
X0_2 = (230.0 > (pre (( ( (1.0 * X0_1) + (1.955578398054313 * X0_2) ) + ( (0.000486212556349 * U_1) ) )))); 

345 
Y_1 = ( ( (0.0 * U_1) ) + ( (0.0 * X0_1) + (1.0 * X0_2) ) ); 

346 
tel 

347  
348 
(* 

349 
Original block name: fullrosace_PP/Va_filter 

350 
*) 

351 
node Va_filter_415_001( 

352 
Va_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

353 
returns( 

354 
Va_meas_1 : real;); 

355 
let 

356 
Va_meas_1 = ( Discrete_State_Space_417_000(Va_1, __time_step, __nb_step, _clk_2_0) ); 

357 
tel 

358  
359 
(* 

360 
Original block name: fullrosace_PP/Va_speed_control/DT_Integrator 

361 
*) 

362 
node DT_Integrator_456_001( 

363 
f_lpar_x_rpar__1 : real; x0_1 : real; __time_step : real; __nb_step : int;) 

364 
returns( 

365 
F_lpar_x_rpar__1 : real;); 

366 
var 

367 
Product_1 : real; UnitDelay_1 : real; 

368 
let 

369 
Product_1 = 1.0 * x0_1 * ( (1.0 > (pre (0.0))) ); 

370 
UnitDelay_1 = (0.0 > (pre (( ( (f_lpar_x_rpar__1 * 0.020) ) + ( UnitDelay_1 + Product_1 ) )))); 

371 
F_lpar_x_rpar__1 = ( UnitDelay_1 + Product_1 ); 

372 
tel 

373  
374 
(* 

375 
Original block name: fullrosace_PP/Va_speed_control 

376 
*) 

377 
node Va_speed_control_450_002( 

378 
Va_c_1 : real; Va_meas_1 : real; q_meas_1 : real; Vz_meas_1 : real; __time_step : real; 

379 
__nb_step : int;) 

380 
returns( 

381 
delta_x_c_1 : real;); 

382 
let 

383 
delta_x_c_1 = ( ( DT_Integrator_456_001((( Va_c_1  Va_meas_1 ) * 0.049802610664357), 1.58686607949260, __time_step, __nb_step) ) + ( (( Va_meas_1  230.0 ) * 0.486813084356079) ) + ( (q_meas_1 * 21.692383376322041) ) + ( (Vz_meas_1 * 0.077603095495388) ) ); 

384 
tel 

385  
386 
(* 

387 
Original block name: fullrosace_PP/Vz_filter_/Discrete_State_Space 

388 
*) 

389 
node Discrete_State_Space_509_000( 

390 
U_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

391 
returns( 

392 
Y_1 : real;); 

393 
var 

394 
X0_1 : real; X0_2 : real; 

395 
let 

396 
X0_1 = (0.0 > (pre (( ( (0.0 * X0_1) + (0.956543675476034 * X0_2) ) + ( (0.000479064865372 * U_1) ) )))); 

397 
X0_2 = (0.0 > (pre (( ( (1.0 * X0_1) + (1.955578398054313 * X0_2) ) + ( (0.000486212556349 * U_1) ) )))); 

398 
Y_1 = ( ( (0.0 * U_1) ) + ( (0.0 * X0_1) + (1.0 * X0_2) ) ); 

399 
tel 

400  
401 
(* 

402 
Original block name: fullrosace_PP/Vz_filter_ 

403 
*) 

404 
node Vz_filter__507_001( 

405 
Vz_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

406 
returns( 

407 
Vz_meas_1 : real;); 

408 
let 

409 
Vz_meas_1 = ( Discrete_State_Space_509_000(Vz_1, __time_step, __nb_step, _clk_2_0) ); 

410 
tel 

411  
412 
(* 

413 
Original block name: fullrosace_PP/Vz_speed_control/Discrete_Time_Integrator 

414 
*) 

415 
node Discrete_Time_Integrator_548_161( 

416 
f_lpar_x_rpar__1 : real; x0_1 : real; __time_step : real; __nb_step : int;) 

417 
returns( 

418 
F_lpar_x_rpar__1 : real;); 

419 
var 

420 
Product_1 : real; UnitDelay_1 : real; 

421 
let 

422 
Product_1 = 1.0 * x0_1 * ( (1.0 > (pre (0.0))) ); 

423 
UnitDelay_1 = (0.0 > (pre (( ( (f_lpar_x_rpar__1 * 0.020) ) + ( UnitDelay_1 + Product_1 ) )))); 

424 
F_lpar_x_rpar__1 = ( UnitDelay_1 + Product_1 ); 

425 
tel 

426  
427 
(* 

428 
Original block name: fullrosace_PP/Vz_speed_control 

429 
*) 

430 
node Vz_speed_control_542_161( 

431 
Vz_c_1 : real; Vz_meas_1 : real; q_meas_1 : real; az_meas_1 : real; __time_step : real; 

432 
__nb_step : int;) 

433 
returns( 

434 
delta_e_c_1 : real;); 

435 
let 

436 
delta_e_c_1 = ( ( Discrete_Time_Integrator_548_161((( Vz_c_1  Vz_meas_1 ) * 0.000627342822264), 0.012009615652468, __time_step, __nb_step) ) + ( (Vz_meas_1 * 0.003252836726554) ) + ( (q_meas_1 * 0.376071446897134) ) + ( (az_meas_1 * 0.001566907423747) ) ); 

437 
tel 

438  
439 
(* 

440 
Original block name: fullrosace_PP/az_filter/Discrete_State_Space 

441 
*) 

442 
node Discrete_State_Space_597_161( 

443 
U_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

444 
returns( 

445 
Y_1 : real;); 

446 
var 

447 
X0_1 : real; X0_2 : real; 

448 
let 

449 
X0_1 = (0.0 > (pre (( ( (0.0 * X0_1) + (0.411240701442774 * X0_2) ) + ( (0.107849979167580 * U_1) ) )))); 

450 
X0_2 = (0.0 > (pre (( ( (1.0 * X0_1) + (1.158045899830964 * X0_2) ) + ( (0.145344822444230 * U_1) ) )))); 

451 
Y_1 = ( ( (0.0 * U_1) ) + ( (0.0 * X0_1) + (1.0 * X0_2) ) ); 

452 
tel 

453  
454 
(* 

455 
Original block name: fullrosace_PP/az_filter 

456 
*) 

457 
node az_filter_595_161( 

458 
az_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

459 
returns( 

460 
az_meas_1 : real;); 

461 
let 

462 
az_meas_1 = ( Discrete_State_Space_597_161(az_1, __time_step, __nb_step, _clk_2_0) ); 

463 
tel 

464  
465 
(* 

466 
Original block name: fullrosace_PP/h_filter_/Discrete_State_Space 

467 
*) 

468 
node Discrete_State_Space_632_161( 

469 
U_1 : real; __time_step : real; __nb_step : int; _clk_4_0 : bool clock;) 

470 
returns( 

471 
Y_1 : real;); 

472 
var 

473 
X0_1 : real; X0_2 : real; 

474 
let 

475 
X0_1 = (5371.593477021927356 > (pre (( ( (0.0 * X0_1) + (0.586756156020839 * X0_2) ) + ( (0.049596808318647 * U_1) ) )))); 

476 
X0_2 = (10000.0 > (pre (( ( (1.0 * X0_1) + (1.477888930110354 * X0_2) ) + ( (0.059270417591839 * U_1) ) )))); 

477 
Y_1 = ( ( (0.0 * U_1) ) + ( (0.0 * X0_1) + (1.0 * X0_2) ) ); 

478 
tel 

479  
480 
(* 

481 
Original block name: fullrosace_PP/h_filter_ 

482 
*) 

483 
node h_filter__630_161( 

484 
h_1 : real; __time_step : real; __nb_step : int; _clk_4_0 : bool clock;) 

485 
returns( 

486 
h_meas_1 : real;); 

487 
let 

488 
h_meas_1 = ( Discrete_State_Space_632_161(h_1, __time_step, __nb_step, _clk_4_0) ); 

489 
tel 

490  
491 
(* 

492 
Original block name: fullrosace_PP/q_filter/Discrete_State_Space 

493 
*) 

494 
node Discrete_State_Space_667_161( 

495 
U_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

496 
returns( 

497 
Y_1 : real;); 

498 
var 

499 
X0_1 : real; X0_2 : real; 

500 
let 

501 
X0_1 = (0.0 > (pre (( ( (0.0 * X0_1) + (0.766000101841272 * X0_2) ) + ( (0.014857648981438 * U_1) ) )))); 

502 
X0_2 = (0.0 > (pre (( ( (1.0 * X0_1) + (1.734903205885821 * X0_2) ) + ( (0.016239246974013 * U_1) ) )))); 

503 
Y_1 = ( ( (0.0 * U_1) ) + ( (0.0 * X0_1) + (1.0 * X0_2) ) ); 

504 
tel 

505  
506 
(* 

507 
Original block name: fullrosace_PP/q_filter 

508 
*) 

509 
node q_filter_665_161( 

510 
q_1 : real; __time_step : real; __nb_step : int; _clk_2_0 : bool clock;) 

511 
returns( 

512 
q_meas_1 : real;); 

513 
let 

514 
q_meas_1 = ( Discrete_State_Space_667_161(q_1, __time_step, __nb_step, _clk_2_0) ); 

515 
tel 

516  
517 
(* 

518 
Original block name: fullrosace_PP 

519 
*) 

520 
node fullrosace_PP( 

521 
h_c_1 : real; Va_c_1 : real;) 

522 
returns( 

523 
Va_1 : real; h_1 : real;); 

524 
var 

525 
FlightDynamics_1 : real; FlightDynamics_2 : real; FlightDynamics_3 : real; FlightDynamics_4 : real; FlightDynamics_5 : real; 

526 
RateTransition10_1 : real; RateTransition11_1 : real; RateTransition12_1 : real; RateTransition13_1 : real; RateTransition14_1 : real; 

527 
RateTransition15_1 : real; RateTransition16_1 : real; RateTransition17_1 : real; RateTransition5_1 : real; RateTransition6_1 : real; 

528 
RateTransition7_1 : real; RateTransition9_1 : real; Sampler_1 : real; Sampler1_1 : real; Sampler2_1 : real; 

529 
Sampler3_1 : real; Sampler4_1 : real; Vz_filter__1 : real; q_filter_1 : real; __time_step : real; 

530 
__nb_step : int; _clk_2_0 : bool clock; _clk_4_0 : bool clock; 

531 
let 

532 
(FlightDynamics_1, FlightDynamics_2, FlightDynamics_3, FlightDynamics_4, FlightDynamics_5) = FlightDynamics_181_000(Engine_150_001(RateTransition13_1, __time_step, __nb_step), Elevator_100_001(RateTransition14_1, __time_step, __nb_step), __time_step, __nb_step); 

533 
RateTransition10_1 = if _clk_4_0 then 

534 
( az_filter_595_161(Sampler2_1, __time_step, __nb_step, _clk_2_0) ) 

535 
else (0.0 > (pre (RateTransition10_1))); 

536 
RateTransition11_1 = if _clk_4_0 then 

537 
( Va_filter_415_001(Sampler3_1, __time_step, __nb_step, _clk_2_0) ) 

538 
else (0.0 > (pre (RateTransition11_1))); 

539 
RateTransition12_1 = if _clk_4_0 then 

540 
Va_c_1 

541 
else (0.0 > (pre (RateTransition12_1))); 

542 
RateTransition13_1 = if _clk_4_0 then 

543 
(1.58686607949260 > (pre (( Va_speed_control_450_002(RateTransition12_1, RateTransition11_1, RateTransition16_1, RateTransition9_1, __time_step, __nb_step) )))) 

544 
else (1.58686607949260 > (pre (RateTransition13_1))); 

545 
RateTransition14_1 = if _clk_4_0 then 

546 
(0.012009615652468 > (pre (( Vz_speed_control_542_161(RateTransition6_1, RateTransition17_1, RateTransition15_1, RateTransition10_1, __time_step, __nb_step) )))) 

547 
else (0.012009615652468 > (pre (RateTransition14_1))); 

548 
RateTransition15_1 = if _clk_4_0 then 

549 
q_filter_1 

550 
else (0.0 > (pre (RateTransition15_1))); 

551 
RateTransition16_1 = if _clk_4_0 then 

552 
q_filter_1 

553 
else (0.0 > (pre (RateTransition16_1))); 

554 
RateTransition17_1 = if _clk_4_0 then 

555 
Vz_filter__1 

556 
else (0.0 > (pre (RateTransition17_1))); 

557 
RateTransition5_1 = if _clk_4_0 then 

558 
( h_filter__630_161(Sampler_1, __time_step, __nb_step, _clk_4_0) ) 

559 
else (10000.0 > (pre (RateTransition5_1))); 

560 
RateTransition6_1 = if _clk_4_0 then 

561 
( AltitudeHold_6_000(RateTransition7_1, RateTransition5_1, __time_step, __nb_step) ) 

562 
else (0.0 > (pre (RateTransition6_1))); 

563 
RateTransition7_1 = if _clk_4_0 then 

564 
h_c_1 

565 
else (0.0 > (pre (RateTransition7_1))); 

566 
RateTransition9_1 = if _clk_4_0 then 

567 
Vz_filter__1 

568 
else (0.0 > (pre (RateTransition9_1))); 

569 
Sampler_1 = if _clk_4_0 then 

570 
FlightDynamics_5 

571 
else (10000.0 > (pre (Sampler_1))); 

572 
Sampler1_1 = if _clk_2_0 then 

573 
FlightDynamics_3 

574 
else (0.0 > (pre (Sampler1_1))); 

575 
Sampler2_1 = if _clk_2_0 then 

576 
FlightDynamics_2 

577 
else (0.0 > (pre (Sampler2_1))); 

578 
Sampler3_1 = if _clk_2_0 then 

579 
FlightDynamics_1 

580 
else (230.0 > (pre (Sampler3_1))); 

581 
Sampler4_1 = if _clk_2_0 then 

582 
FlightDynamics_4 

583 
else (0.0 > (pre (Sampler4_1))); 

584 
Vz_filter__1 = Vz_filter__507_001(Sampler4_1, __time_step, __nb_step, _clk_2_0); 

585 
q_filter_1 = q_filter_665_161(Sampler1_1, __time_step, __nb_step, _clk_2_0); 

586 
Va_1 = FlightDynamics_1; 

587 
h_1 = FlightDynamics_5; 

588 
__time_step = (0.0 > ((pre (__time_step)) + 0.0050)); 

589 
__nb_step = (0 > ((pre (__nb_step)) + 1)); 

590 
_clk_2_0 = _make_clock(2, 0); 

591 
_clk_4_0 = _make_clock(4, 0); 

592 
tel 

593 
Also available in: Unified diff
Clock issue