scripts for eletrical related calculation