1 # CompoundFunctions.LACE
 
   2 # collection of compound functions which can be realized with THAT
 
   5 define openamp (weight*: variable-1, …) -> output
 
   6   isum (weight*: variable-1, …) -> output
 
  10 define idivide (numerator, denominator) -> -quotient
 
  11   openamp (numerator, product) -> -quotient
 
  12   multiply (-quotient, denominator) -> product
 
  14 # Integration extension
 
  15 define iintegrate (weight*: variable-1, …, ic: variable-IC, limit: gt0) -> variable-n
 
  16   iintegrate (weight*: variable-1, …) -> variable-n
 
  17     diode (cat:variable-n) -> DA
 
  19 # diode and connect used to limit the result to values >0
 
  21 # Building an additional integrator with the help of an openamp
 
  22 define iintegrate.additional (variable) -> integral
 
  23    openamp variable -> integral
 
  25    capacitor.100nF (integral) -> cp
 
  26 # NB: The 100 nF capacitor is available on a THAT. This capacitance corresponds to those of the SLOW settings. In order to use the standard time constant an external 1 nF capacitor has to be used.
 
  29 define isum (weight*: variable-1, …, /divisor) -> -result
 
  30   isum (weight*: variable-1, …) -> -result
 
  31   connect (-result, …) -> IN