Project

General

Profile

Download (13.1 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2

    
3
node __sin(x:real) returns (out:real);
4
let
5
out = if (0.0<=x and x<=0.15707963267) then 0.0 + (0.99589273524 * (x-0.0)) else 
6
      if (0.15707963267<=x and x<=0.31415926535) then 0.15643446504 + (0.97137055092 * (x-0.15707963267)) else 
7
      if (0.31415926535<=x and x<=0.47123889803) then 0.30901699437 + (0.92292999984 * (x-0.31415926535)) else 
8
      if (0.47123889803<=x and x<=0.62831853071) then 0.45399049974 + (0.85176384914 * (x-0.47123889803)) else 
9
      if (0.62831853071<=x and x<=0.78539816339) then 0.58778525229 + (0.75962444563 * (x-0.62831853071)) else 
10
      if (0.78539816339<=x and x<=0.94247779607) then 0.70710678118 + (0.64878056721 * (x-0.78539816339)) else 
11
      if (0.94247779607<=x and x<=1.09955742876) then 0.80901699437 + (0.52196155806 * (x-0.94247779607)) else 
12
      if (1.09955742876<=x and x<=1.25663706144) then 0.89100652418 + (0.38229012305 * (x-1.09955742876)) else 
13
      if (1.25663706144<=x and x<=1.41371669412) then 0.95105651629 + (0.23320543647 * (x-1.25663706144)) else 
14
      if (1.41371669412<=x and x<=1.57079632679) then 0.98768834059 + (0.07837845807 * (x-1.41371669412)) else -1.0;
15
tel
16

    
17

    
18
node my_sin(x:real) returns (out:real);
19
let
20
out = if (0.0<=x and x<=1.57079632679) then __sin(x) else 
21
      if (1.57079632679<=x and x<=3.14159265359) then __sin(3.14159265359-x) else 
22
      if (3.14159265359<=x and x<=4.71238898038) then -(__sin(x-3.14159265359)) else 
23
      if (4.71238898038<=x and x<=6.28318530718) then -(__sin(6.28318530718-x))  else -1.0;
24
tel
25

    
26
node my_cos(x:real) returns (out:real);
27
let
28
out = if (0.0<=x and x<=4.71238898038) then my_sin(1.57079632679+x) else 
29
      if (4.71238898038<=x and x<=6.28318530718) then my_sin(x-4.71238898038) else -1.0;
30
tel
31

    
32
node integrator_reset ( Fx  : real ; ResetLevel  : bool ; x0  : real  ) 
33
   returns ( ir_out  : real  ) ;
34
 
35
let
36
ir_out  = x0 -> if ( ResetLevel  ) then x0 else ( Fx * 1.000000  ) + pre ( ir_out  );
37
 tel 
38

    
39

    
40
node DynamicSaturation ( up_Out1_148  : real ; u_Out1_158  : real ; lo_Out1_168  : real  ) 
41
   returns ( y1_In1_210  : real  ) ;
42
var LowerRelop1_Out1_174  : bool ;
43
 Switch_Out1_183  : real ;
44
 Switch2_Out1_192  : real ;
45
 UpperRelop_Out1_198  : bool ;
46
 LowerRelop1_In1_172  : real ;
47
 LowerRelop1_In2_173  : real ;
48
 Switch_In1_180  : real ;
49
 Switch_In2_181  : bool ;
50
 Switch_In3_182  : real ;
51
 Switch2_In1_189  : real ;
52
 Switch2_In2_190  : bool ;
53
 Switch2_In3_191  : real ;
54
 UpperRelop_In1_196  : real ;
55
 UpperRelop_In2_197  : real ;
56
  
57
let
58
LowerRelop1_Out1_174  = LowerRelop1_In1_172 > LowerRelop1_In2_173;
59
Switch_Out1_183  = if Switch_In2_181 then Switch_In1_180 else Switch_In3_182;
60
Switch2_Out1_192  = if Switch2_In2_190 then Switch2_In1_189 else Switch2_In3_191;
61
UpperRelop_Out1_198  = UpperRelop_In1_196 < UpperRelop_In2_197;
62
Switch2_In1_189  = up_Out1_148;
63
LowerRelop1_In2_173  = up_Out1_148;
64
Switch_In3_182  = u_Out1_158;
65
LowerRelop1_In1_172  = u_Out1_158;
66
UpperRelop_In1_196  = u_Out1_158;
67
Switch_In1_180  = lo_Out1_168;
68
UpperRelop_In2_197  = lo_Out1_168;
69
Switch2_In3_191  = Switch_Out1_183;
70
y1_In1_210  = Switch2_Out1_192;
71
Switch2_In2_190  = LowerRelop1_Out1_174;
72
Switch_In2_181  = UpperRelop_Out1_198;
73
 tel 
74

    
75
node EngageORzero ( engage  : bool ; signal  : real  ) 
76
   returns ( out : real  ) ;  
77
let
78
  out  = if engage then signal else 0.0;
79
 tel 
80

    
81
node ManualOverride (manual  : real ; auto : real  ) 
82
   returns ( manual_out  : real  ) ;
83
var 
84
  temp  : bool ;
85
let
86
  temp  = if manual = 0.000000 then false else true;
87
  manual_out = if temp then manual else auto;
88
tel
89

    
90
node VarLimInteg ( Input_Out1_545  : real ; Max_Out1_555  : real ; Min_Out1_565  : real ; ICtrig_Out1_575  : bool ; IC_Out1_585  : real  ) 
91
   returns ( Out_In1_681  : real  ) ;
92
var Integrator1_Out1_618  : real ;
93
 Logical_Operator1_Out1_624  : bool ;
94
 Logical_Operator2_Out1_630  : bool ;
95
 Logical_Operator3_Out1_636  : bool ;
96
 Relational_Operator1_Out1_642  : bool ;
97
 Relational_Operator2_Out1_648  : bool ;
98
 Relational_Operator3_Out1_654  : bool ;
99
 Relational_Operator4_Out1_660  : bool ;
100
 Switch1_Out1_669  : real ;
101
 Integrator1_In1_615  : real ;
102
 Integrator1_In2_616  : bool ;
103
 Integrator1_In3_617  : real ;
104
 Logical_Operator1_In1_622  : bool ;
105
 Logical_Operator1_In2_623  : bool ;
106
 Logical_Operator2_In1_628  : bool ;
107
 Logical_Operator2_In2_629  : bool ;
108
 Logical_Operator3_In1_634  : bool ;
109
 Logical_Operator3_In2_635  : bool ;
110
 Relational_Operator1_In1_640  : real ;
111
 Relational_Operator1_In2_641  : real ;
112
 Relational_Operator2_In1_646  : real ;
113
 Relational_Operator2_In2_647  : real ;
114
 Relational_Operator3_In1_652  : real ;
115
 -- Relational_Operator3_In2_653  : real ;
116
 Relational_Operator4_In1_658  : real ;
117
 -- Relational_Operator4_In2_659  : real ;
118
 -- Switch1_In1_666  : real ;
119
 Switch1_In2_667  : bool ;
120
 Switch1_In3_668  : real ;
121
  
122
let
123
Integrator1_Out1_618  = Integrator1_In3_617 -> pre integrator_reset ( Integrator1_In1_615 , Integrator1_In2_616 , Integrator1_In3_617  );
124
Logical_Operator1_Out1_624  = Logical_Operator1_In1_622 or Logical_Operator1_In2_623;
125
Logical_Operator2_Out1_630  = Logical_Operator2_In1_628 and Logical_Operator2_In2_629;
126
Logical_Operator3_Out1_636  = Logical_Operator3_In1_634 and Logical_Operator3_In2_635;
127
Relational_Operator1_Out1_642  = Relational_Operator1_In1_640 <= Relational_Operator1_In2_641;
128
Relational_Operator2_Out1_648  = Relational_Operator2_In1_646 >= Relational_Operator2_In2_647;
129
Relational_Operator3_Out1_654  = Relational_Operator3_In1_652 > 0.0;
130
Relational_Operator4_Out1_660  = Relational_Operator4_In1_658 < 0.0;
131
Switch1_Out1_669  = if Switch1_In2_667 then 0.0 else Switch1_In3_668;
132
Integrator1_In3_617  = IC_Out1_585;
133
Integrator1_In2_616  = ICtrig_Out1_575;
134
Relational_Operator1_In2_641  = Min_Out1_565;
135
Relational_Operator2_In2_647  = Max_Out1_555;
136
-- Relational_Operator4_In2_659  = 0.0;
137
Switch1_In3_668  = Input_Out1_545;
138
Relational_Operator3_In1_652  = Input_Out1_545;
139
Relational_Operator4_In1_658  = Input_Out1_545;
140
Logical_Operator1_In2_623  = Logical_Operator3_Out1_636;
141
Logical_Operator3_In2_635  = Relational_Operator4_Out1_660;
142
Logical_Operator3_In1_634  = Relational_Operator1_Out1_642;
143
-- Relational_Operator3_In2_653  = 0.0;
144
Logical_Operator1_In1_622  = Logical_Operator2_Out1_630;
145
Logical_Operator2_In2_629  = Relational_Operator3_Out1_654;
146
Logical_Operator2_In1_628  = Relational_Operator2_Out1_648;
147
Switch1_In2_667  = Logical_Operator1_Out1_624;
148
Relational_Operator2_In1_646  = Integrator1_Out1_618;
149
Relational_Operator1_In1_640  = Integrator1_Out1_618;
150
Out_In1_681  = Integrator1_Out1_618;
151
Integrator1_In1_615  = Switch1_Out1_669;
152
-- Switch1_In1_666  = 0.0;
153
 tel 
154

    
155
node TransferFcn ( x_Out1_753  : real  ) 
156
   returns ( y_In1_836  : real  ) ;
157
var asharp1_Out1_762  : real ;
158
 b0sharp0_Out1_771  : real ;
159
 b0sharp1_Out1_780  : real ;
160
 delaysharp1_Out1_785  : real ;
161
 output_sum_Out1_795  : real ;
162
 samplesharp1_Out1_804  : real ;
163
 sum11_Out1_814  : real ;
164
 sum21_Out1_824  : real ;
165
 asharp1_In1_761  : real ;
166
 b0sharp0_In1_770  : real ;
167
 b0sharp1_In1_779  : real ;
168
 delaysharp1_In1_784  : real ;
169
 output_sum_In1_793  : real ;
170
 output_sum_In2_794  : real ;
171
 samplesharp1_In1_803  : real ;
172
 sum11_In1_812  : real ;
173
 sum11_In2_813  : real ;
174
 sum21_In1_822  : real ;
175
 sum21_In2_823  : real ;
176
  
177
let
178
asharp1_Out1_762  = 0.062500 * asharp1_In1_761;
179
b0sharp0_Out1_771  = b0sharp0_In1_770;
180
b0sharp1_Out1_780  = - (b0sharp1_In1_779);
181
delaysharp1_Out1_785  = 0.000000 -> pre delaysharp1_In1_784;
182
output_sum_Out1_795  = output_sum_In1_793 + output_sum_In2_794;
183
samplesharp1_Out1_804  = 0.020000 * samplesharp1_In1_803;
184
sum11_Out1_814  = sum11_In1_812 + - sum11_In2_813;
185
sum21_Out1_824  = sum21_In1_822 + sum21_In2_823;
186
asharp1_In1_761  = delaysharp1_Out1_785;
187
sum21_In2_823  = delaysharp1_Out1_785;
188
sum11_In2_813  = asharp1_Out1_762;
189
b0sharp1_In1_779  = asharp1_Out1_762;
190
output_sum_In1_793  = b0sharp0_Out1_771;
191
output_sum_In2_794  = b0sharp1_Out1_780;
192
samplesharp1_In1_803  = sum11_Out1_814;
193
sum21_In1_822  = samplesharp1_Out1_804;
194
delaysharp1_In1_784  = sum21_Out1_824;
195
sum11_In1_812  = x_Out1_753;
196
b0sharp0_In1_770  = x_Out1_753;
197
y_In1_836  = output_sum_Out1_795;
198
 tel 
199

    
200
node AutoThrottle ( ATEng_Out1_19  : bool ; maxThrot_Out1_29  : real ; minThrot_Out1_39  : real ; leverThrot_Out1_49  : real ; Phidegf_Out1_59  : real ; Ktas_Abstracted_Out1_69  : real ; Cas_ktsf_Out1_79  : real ; Vgdotf_Out1_89  : real ; ICthrot_Out1_99  : real  ) 
201
   returns ( ThrotCmd_In1_782  : real  ) ;
202
var Divide_Out1_119  : real ;
203
 DynamicSaturation_Out1_128  : real ;
204
 EngageORzero_Out1_219  : real ;
205
 Gain1_Out1_297  : real ;
206
 Kcas_Out1_306  : real ;
207
 Kr_Out1_315  : real ;
208
 Kr1_Out1_324  : real ;
209
 Logical_Operator_Out1_329  : bool ;
210
 ManualOverride_Out1_345  : real ;
211
 PHIMC1_Out1_399  : real ;
212
 Sum_Out1_417  : real ;
213
 Sum1_Out1_428  : real ;
214
 Sum2_Out1_438  : real ;
215
 Sum3_Out1_448  : real ;
216
 Sum5_Out1_458  : real ;
217
 Trigonometric_Function_Out1_463  : real ;
218
 VarLimIntegAT_Out1_474  : real ;
219
 kt2fps_Out1_650  : real ;
220
 transfer_Fcn_Out1_665  : real ;
221
 Divide_In1_117  : real ;
222
 -- Divide_In2_118  : real ;
223
 DynamicSaturation_In1_125  : real ;
224
 DynamicSaturation_In2_126  : real ;
225
 DynamicSaturation_In3_127  : real ;
226
 EngageORzero_In1_217  : bool ;
227
 EngageORzero_In2_218  : real ;
228
 Gain1_In1_296  : real ;
229
 Kcas_In1_305  : real ;
230
 Kr_In1_314  : real ;
231
 Kr1_In1_323  : real ;
232
 Logical_Operator_In1_328  : bool ;
233
 ManualOverride_In1_343  : real ;
234
 ManualOverride_In2_344  : real ;
235
 PHIMC1_In1_396  : real ;
236
 PHIMC1_In2_397  : bool ;
237
 PHIMC1_In3_398  : real ;
238
 Sum_In1_415  : real ;
239
 Sum_In2_416  : real ;
240
 Sum1_In1_425  : real ;
241
 Sum1_In2_426  : real ;
242
 Sum1_In3_427  : real ;
243
 Sum2_In1_436  : real ;
244
 Sum2_In2_437  : real ;
245
 Sum3_In1_446  : real ;
246
 Sum3_In2_447  : real ;
247
 Sum5_In1_456  : real ;
248
 Sum5_In2_457  : real ;
249
 Trigonometric_Function_In1_462  : real ;
250
 VarLimIntegAT_In1_469  : real ;
251
 VarLimIntegAT_In2_470  : real ;
252
 VarLimIntegAT_In3_471  : real ;
253
 VarLimIntegAT_In4_472  : bool ;
254
 VarLimIntegAT_In5_473  : real ;
255
 kt2fps_In1_649  : real ;
256
 transfer_Fcn_In1_664  : real ;
257
  
258
let
259
Divide_Out1_119  = Divide_In1_117 / 3.141500;
260
DynamicSaturation_Out1_128  = DynamicSaturation ( DynamicSaturation_In1_125 , DynamicSaturation_In2_126 , DynamicSaturation_In3_127  );
261
EngageORzero_Out1_219  = EngageORzero ( EngageORzero_In1_217 , EngageORzero_In2_218  );
262
Gain1_Out1_297  = 5.0 * Gain1_In1_296;
263
Kcas_Out1_306  = 0.200000 * Kcas_In1_305;
264
Kr_Out1_315  = 2.500000 * Kr_In1_314;
265
Kr1_Out1_324  = 1.200000 * Kr1_In1_323;
266
Logical_Operator_Out1_329  = not Logical_Operator_In1_328;
267
ManualOverride_Out1_345  = ManualOverride ( ManualOverride_In1_343 , ManualOverride_In2_344  );
268
PHIMC1_Out1_399  = if PHIMC1_In2_397 then PHIMC1_In1_396 else PHIMC1_In3_398;
269
Sum_Out1_417  = Sum_In1_415 + - Sum_In2_416;
270
Sum1_Out1_428  = Sum1_In1_425 + ( Sum1_In2_426 + - Sum1_In3_427  );
271
Sum2_Out1_438  = Sum2_In1_436 + - Sum2_In2_437;
272
Sum3_Out1_448  = Sum3_In1_446 + - Sum3_In2_447;
273
Sum5_Out1_458  = Sum5_In1_456 + - Sum5_In2_457;
274
Trigonometric_Function_Out1_463  = my_cos ( Trigonometric_Function_In1_462  );
275
VarLimIntegAT_Out1_474  = VarLimInteg ( VarLimIntegAT_In1_469 , VarLimIntegAT_In2_470 , VarLimIntegAT_In3_471 , VarLimIntegAT_In4_472 , VarLimIntegAT_In5_473  );
276
kt2fps_Out1_650  = 1.687800 * kt2fps_In1_649;
277
transfer_Fcn_Out1_665  = TransferFcn ( transfer_Fcn_In1_664  );
278
Sum2_In1_436  = 250.0;
279
kt2fps_In1_649  = Sum2_Out1_438;
280
Kr_In1_314  = Sum1_Out1_428;
281
Kcas_In1_305  = kt2fps_Out1_650;
282
VarLimIntegAT_In1_469  = Kr_Out1_315;
283
Sum1_In3_427  = Vgdotf_Out1_89;
284
Kr1_In1_323  = Vgdotf_Out1_89;
285
Sum3_In2_447  = Kr1_Out1_324;
286
transfer_Fcn_In1_664  = Gain1_Out1_297;
287
Gain1_In1_296  = Sum_Out1_417;
288
Sum_In2_416  = Trigonometric_Function_Out1_463;
289
Sum_In1_415  = 1.0;
290
Trigonometric_Function_In1_462  = Divide_Out1_119;
291
EngageORzero_In2_218  = Sum5_Out1_458;
292
VarLimIntegAT_In5_473  = ICthrot_Out1_99;
293
Sum5_In2_457  = ICthrot_Out1_99;
294
DynamicSaturation_In1_125  = maxThrot_Out1_29;
295
VarLimIntegAT_In2_470  = maxThrot_Out1_29;
296
VarLimIntegAT_In3_471  = minThrot_Out1_39;
297
DynamicSaturation_In3_127  = minThrot_Out1_39;
298
Sum3_In1_446  = VarLimIntegAT_Out1_474;
299
DynamicSaturation_In2_126  = Sum3_Out1_448;
300
Sum5_In1_456  = DynamicSaturation_Out1_128;
301
Sum1_In2_426  = PHIMC1_Out1_399;
302
PHIMC1_In3_398  = Kcas_Out1_306;
303
Sum1_In1_425  = transfer_Fcn_Out1_665;
304
Divide_In1_117  = Phidegf_Out1_59;
305
Sum2_In2_437  = Cas_ktsf_Out1_79;
306
VarLimIntegAT_In4_472  = Logical_Operator_Out1_329;
307
EngageORzero_In1_217  = ATEng_Out1_19;
308
Logical_Operator_In1_328  = ATEng_Out1_19;
309
PHIMC1_In2_397  = if 0 = 0 then false else true;
310
PHIMC1_In1_396  = Ktas_Abstracted_Out1_69;
311
ManualOverride_In1_343  = leverThrot_Out1_49;
312
ThrotCmd_In1_782  = ManualOverride_Out1_345;
313
ManualOverride_In2_344  = EngageORzero_Out1_219;
314
 tel 
315

    
316

    
317

    
318
node top ( ATEng : bool ; maxThrot : real ; minThrot : real ; leverThrot : real ; Phidegf : real ; Ktas_Abstracted: real ;Cas_ktsf : real ; Vgdotf : real ; ICthrot  : real  ) 
319
   returns (obs: bool) ;
320
  var ThrotCmd  : real;
321
    
322
let
323
  -- ICthrot = throt.bias
324
  ThrotCmd =   AutoThrottle (ATEng , maxThrot, minThrot, leverThrot, Phidegf,  Ktas_Abstracted, Cas_ktsf, Vgdotf, ICthrot);
325

    
326
  assert ATEng = true;
327
  assert leverThrot = 0.0;
328
  assert maxThrot > (minThrot + 10.0);
329
  assert minThrot >= 5.0;
330
  assert maxThrot <= 100.0;
331
  assert true -> maxThrot = pre(maxThrot);
332
  assert true -> minThrot = pre(minThrot);
333
  assert ICthrot = 0.0;
334
  
335

    
336
  obs =  ThrotCmd <= maxThrot and ThrotCmd >= minThrot;
337

    
338
 
339
 --!MAIN : true;
340
 --!PROPERTY: obs = true;
341
tel
342

    
(25-25/28)