1

 This file has been generated by CoCoSim2.

2


3

 Compiler: Lustre compiler 2 (ToLustre.m)

4

 Time: 03Dec2018 22:30:26

5

(*

6

Original block name: DiscreteDerivative1_PP/DiscreteDerivative/TSamp

7

*)

8

node TSamp_237_054(u_1 : real;

9

__time_step : real;

10

__nb_step : int;)

11

returns(Out1_1 : real;);

12

var Divide_1 : real;

13

Divide1_1 : real;

14

Ts_1 : real;

15

weightValue_1 : real;

16

let

17

Divide_1 = 1.0 * u_1 / Ts_1;

18

Divide1_1 = 1.0 * Divide_1 / weightValue_1;

19

Ts_1 = 0.010000000000000;

20

weightValue_1 = 1.000000000000000;

21

Out1_1 = Divide1_1;

22

tel

23


24

(*

25

Original block name: DiscreteDerivative1_PP/DiscreteDerivative

26

*)

27

node DiscreteDerivative_161_046(U_1 : real;

28

__time_step : real;

29

__nb_step : int;)

30

returns(Y_1 : real;);

31

var Diff_1 : real;

32

TSamp_1 : real;

33

UD_1 : real;

34

let

35

Diff_1 = 0.0 + TSamp_1  UD_1;

36

TSamp_1 = TSamp_237_054(U_1, __time_step, __nb_step);

37

UD_1 = (3.900000000000000 > (pre TSamp_1));

38

Y_1 = Diff_1;

39

tel

40


41

(*

42

Original block name: DiscreteDerivative1_PP/DiscreteDerivative1/TSamp

43

*)

44

node TSamp_166_261(u_1 : real;

45

__time_step : real;

46

__nb_step : int;)

47

returns(Out1_1 : real;);

48

var Divide_1 : real;

49

Divide1_1 : real;

50

Ts_1 : real;

51

weightValue_1 : real;

52

let

53

Divide_1 = 1.0 * u_1 / Ts_1;

54

Divide1_1 = 1.0 * Divide_1 / weightValue_1;

55

Ts_1 = 0.010000000000000;

56

weightValue_1 = 1.000000000000000;

57

Out1_1 = Divide1_1;

58

tel

59


60

(*

61

Original block name: DiscreteDerivative1_PP/DiscreteDerivative1

62

*)

63

node DiscreteDerivative1_162_049(U_1 : real;

64

__time_step : real;

65

__nb_step : int;)

66

returns(Y_1 : real;);

67

var Diff_1 : real;

68

TSamp_1 : real;

69

UD_1 : real;

70

let

71

Diff_1 = 0.0 + TSamp_1  UD_1;

72

TSamp_1 = TSamp_166_261(U_1, __time_step, __nb_step);

73

UD_1 = (3.900000000000000 > (pre TSamp_1));

74

Y_1 = Diff_1;

75

tel

76


77

(*

78

Original block name: DiscreteDerivative1_PP/ResettableSubsystem/DiscreteDerivative/TSamp

79

*)

80

node TSamp_257_043(u_1 : real;

81

__time_step : real;

82

__nb_step : int;)

83

returns(Out1_1 : real;);

84

var Divide_1 : real;

85

Divide1_1 : real;

86

Ts_1 : real;

87

weightValue_1 : real;

88

let

89

Divide_1 = 1.0 * u_1 / Ts_1;

90

Divide1_1 = 1.0 * Divide_1 / weightValue_1;

91

Ts_1 = 0.010000000000000;

92

weightValue_1 = 0.200000000000000;

93

Out1_1 = Divide1_1;

94

tel

95


96

(*

97

Original block name: DiscreteDerivative1_PP/ResettableSubsystem/DiscreteDerivative

98

*)

99

node DiscreteDerivative_186_038(U_1 : real;

100

__time_step : real;

101

__nb_step : int;)

102

returns(Y_1 : real;);

103

var Diff_1 : real;

104

TSamp_1 : real;

105

UD_1 : real;

106

let

107

Diff_1 = 0.0 + TSamp_1  UD_1;

108

TSamp_1 = TSamp_257_043(U_1, __time_step, __nb_step);

109

UD_1 = (3.900000000000000 > (pre TSamp_1));

110

Y_1 = Diff_1;

111

tel

112


113

(*

114

Original block name: DiscreteDerivative1_PP/ResettableSubsystem/DiscreteDerivative1/TSamp

115

*)

116

node TSamp_191_035(u_1 : real;

117

__time_step : real;

118

__nb_step : int;)

119

returns(Out1_1 : real;);

120

var Divide_1 : real;

121

Divide1_1 : real;

122

Ts_1 : real;

123

weightValue_1 : real;

124

let

125

Divide_1 = 1.0 * u_1 / Ts_1;

126

Divide1_1 = 1.0 * Divide_1 / weightValue_1;

127

Ts_1 = 0.010000000000000;

128

weightValue_1 = 1.000000000000000;

129

Out1_1 = Divide1_1;

130

tel

131


132

(*

133

Original block name: DiscreteDerivative1_PP/ResettableSubsystem/DiscreteDerivative1

134

*)

135

node DiscreteDerivative1_187_037(U_1 : real;

136

__time_step : real;

137

__nb_step : int;)

138

returns(Y_1 : real;);

139

var Diff_1 : real;

140

TSamp_1 : real;

141

UD_1 : real;

142

let

143

Diff_1 = 0.0 + TSamp_1  UD_1;

144

TSamp_1 = TSamp_191_035(U_1, __time_step, __nb_step);

145

UD_1 = (3.900000000000000 > (pre TSamp_1));

146

Y_1 = Diff_1;

147

tel

148


149

(*

150

Original block name: DiscreteDerivative1_PP/ResettableSubsystem

151

*)

152

node ResettableSubsystem_183_039(In1_1 : real;

153

__time_step : real;

154

__nb_step : int;)

155

returns(Out1_1 : real;

156

Out2_1 : real;);

157

var DiscreteDerivative_1 : real;

158

DiscreteDerivative1_1 : real;

159

let

160

DiscreteDerivative_1 = DiscreteDerivative_186_038(In1_1, __time_step, __nb_step);

161

DiscreteDerivative1_1 = DiscreteDerivative1_187_037(In1_1, __time_step, __nb_step);

162

Out1_1 = DiscreteDerivative_1;

163

Out2_1 = DiscreteDerivative1_1;

164

tel

165


166

(*

167

Original block name: DiscreteDerivative1_PP

168

*)

169

node DiscreteDerivative1_PP(In1_1 : real;

170

In2_1 : real;)

171

returns(Out1_1 : real;

172

Out2_1 : real;

173

Out3_1 : real;);

174

var DiscreteDerivative_1 : real;

175

DiscreteDerivative1_1 : real;

176

ResetCond_of_ResettableSubsystem_183_039 : bool;

177

ResettableSubsystem_1 : real;

178

ResettableSubsystem_2 : real;

179

__time_step : real;

180

__nb_step : int;

181

let

182

DiscreteDerivative_1 = DiscreteDerivative_161_046(In1_1, __time_step, __nb_step);

183

DiscreteDerivative1_1 = DiscreteDerivative1_162_049(In1_1, __time_step, __nb_step);

184

ResetCond_of_ResettableSubsystem_183_039 = (false > ((In2_1 > 0.0) and (not (pre (In2_1 > 0.0)))));

185

(ResettableSubsystem_1, ResettableSubsystem_2) = (ResettableSubsystem_183_039(In1_1, __time_step, __nb_step) every ResetCond_of_ResettableSubsystem_183_039);

186

Out1_1 = DiscreteDerivative_1;

187

Out2_1 = ResettableSubsystem_1;

188

Out3_1 = DiscreteDerivative1_1;

189

__time_step = (0.0 > ((pre __time_step) + 0.010000000000000));

190

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

191

tel

192

