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

History | View | Annotate | Download (1.63 KB)

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

2 | |

3 |
-- Compiler: Lustre compiler 2 (ToLustre.m) |

4 |
-- Time: 07-Nov-2018 18:21:40 |

5 |
#open <lustrec_math> |

6 |
node bool_to_real(x : bool;) |

7 |
returns(y : real;); |

8 |
let |

9 |
y = if x then |

10 |
1.0 |

11 |
else 0.0; |

12 |
tel |

13 | |

14 | |

15 |
(* |

16 |
Original block name: Fcn1 |

17 |
*) |

18 |
node Fcn1(In1_1 : real; |

19 |
In1_2 : real; |

20 |
In1_3 : real; |

21 |
In1_4 : real; |

22 |
In2_1 : real; |

23 |
In2_2 : real; |

24 |
In2_3 : real; |

25 |
In2_4 : real; |

26 |
In2_5 : real; |

27 |
In2_6 : real; |

28 |
In3_1 : real; |

29 |
In3_2 : real; |

30 |
In3_3 : real; |

31 |
In3_4 : real; |

32 |
In4_1 : real; |

33 |
In4_2 : real; |

34 |
In4_3 : real; |

35 |
In5_1 : real; |

36 |
In5_2 : real; |

37 |
In5_3 : real; |

38 |
In6_1 : real; |

39 |
In6_2 : real; |

40 |
In6_3 : real; |

41 |
In6_4 : real; |

42 |
In6_5 : real; |

43 |
In6_6 : real;) |

44 |
returns(Out1_1 : real; |

45 |
Out2_1 : real; |

46 |
Out3_1 : real; |

47 |
Out4_1 : real; |

48 |
Out5_1 : real; |

49 |
Out6_1 : real;); |

50 |
var Fcn_1 : real; |

51 |
Fcn1_1 : real; |

52 |
Fcn2_1 : real; |

53 |
Fcn3_1 : real; |

54 |
Fcn4_1 : real; |

55 |
Fcn5_1 : real; |

56 |
__time_step : real; |

57 |
__nb_step : int; |

58 |
let |

59 |
Fcn_1 = 1.000000000000000 - 2.000000000000000 * ( In1_1 * In1_4 + In1_2 * In1_3 ); |

60 |
Fcn1_1 = In2_2 * In2_6 - In2_5 * In2_3; |

61 |
Fcn2_1 = - In3_1 * In3_1 - In3_2 * In3_2 - In3_3 * In3_3 + In3_4 * In3_4; |

62 |
Fcn3_1 = cos(In4_3 / 2.000000000000000) * cos(In4_2 / 2.000000000000000) * sin(In4_1 / 2.000000000000000) - sin(In4_3 / 2.000000000000000) * sin(In4_2 / 2.000000000000000) * cos(In4_1 / 2.000000000000000); |

63 |
Fcn4_1 = sin(In5_1) * sin(In5_2) * cos(In5_3) - cos(In5_1) * sin(In5_3); |

64 |
Fcn5_1 = bool_to_real(In6_2 * In6_6 > In6_5 * In6_3); |

65 |
Out1_1 = Fcn_1; |

66 |
Out2_1 = Fcn1_1; |

67 |
Out3_1 = Fcn2_1; |

68 |
Out4_1 = Fcn3_1; |

69 |
Out5_1 = Fcn4_1; |

70 |
Out6_1 = Fcn5_1; |

71 |
__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000)); |

72 |
__nb_step = (0 -> ((pre __nb_step) + 1)); |

73 |
tel |

74 |