MODEL Flash
comment--------------------------------------
| Front of wave flashover characteristic    |
| of the HV insulator.                      | 
| Input: Voltage accross the insulator.     | 
| Output: Close command for the TACS switch |
-----------------------------------endcomment 
INPUT UP, UN
OUTPUT CLOSE 
DATA UINF {DFLT:650e3}, UO {DFLT: 1650e3}, TAU {DFLT:8.e-7}, UINI {DFLT:1E5}
VAR CLOSE, TT, U, FLASH
INIT
  CLOSE:=0
  TT:=0
  FLASH:=INF
ENDINIT
EXEC
  U:= ABS(UP-UN)
  IF (U>UINI) THEN 
    TT:=TT+timestep                          
    FLASH:=(UINF + (UO-UINF)*(EXP(-TT/TAU)))
    IF (U>FLASH) THEN CLOSE:=1 ENDIF           
  ENDIF
ENDEXEC
ENDMODEL

