# Calculate differential (slope) and integral of ch1
# Berechne Ableitung (Steigung) und Integral von ch1

#lower boundary in Y-domain for finite integral
constA= 0.1;
#upper boundary in Y-domain for finite integral
constB= 0.1;

#upper boundary in time / X-domain for finite integral, whereby real time= constN/FREQ [s]
constN= 100;

# x1: differential
x1= (ch1-ch1L)*FREQ;

# x2: intermediate value for integral
x2= ch1/FREQ;

# x3: infinite integral
x3= SUM1(x2,0);

# x4: integral over Y-boundaries
IF(ch1>constA){x4=SUM2(x2, 0)};
ELIF(ch1<=constB){RESET(2)};
ENDIF;

x5: integral over limited time
x5=SUM3(x2,constN);