This program was originally written in Fortran in 1989 by David R. Brown and the American Public Power Association.
The following sources provided data on the electrical properties of different conductors:
IF SHIELDS ARE SEGMENTED (INSULATED) TO PREVENT 60 HZ SHIELD WIRE CURRENTS, SHIELD WIRE CURRENTS SHOULD BE SET TO ZERO.
{nins : shield currents ? TO INCLUDE SHIELD CURRENTS, TYPE A 1. TO SET SHIELD CURRENTS TO ZERO, TYPE A 2.}
{xlngth: LINE LENGTH IN MILES}
THE SWITCHING SURGE PROGRAM SIMULATES LINE RECLOSING ASSUMING TRAPPED CHARGE ON THE LINE. THE SYSTEM TO WHICH THE LINE WILL BE CONNECTED IS MODELLED ON THE BASIS OF THE SYSTEM THREE-PHASE FAULT CURRENT.
{fltcurr: THREE-PHASE FAULT CURRENT FOR THE SYSTEM IN AMPERES }
{nres : SIMULATION OF INSERTION RESISTORS ? TO USE INSERTION RESISTORS TYPE A 1. TO OMIT RESISTORS TYPE A 2.}
Omit insertion resistance and resistor insertion time if you chose to omit resistors
{rins: insertion resistance(OHMS)}
{tins: resistor insertion time (ms) ? INSERTION TIME IS THE TIME THAT THE INSERTION RESISTORS ARE IN THE CIRCUIT.}
# Click the Blue Plane to preview this as a CrossCompute tool
conductor_table_path = 'conductors.csv'
phase_table_path = 'phases.csv'
shield_table_path = 'shields.csv'
span_table_path = 'spans.csv'
nins = 1
nres = 1
rins = 400
tins = 10
xlngth = 70
fltcurr = 10
target_folder = '/tmp'
nins = 1 if int(nins) == 1 else 2
nres = 1 if int(nres) == 1 else 2
from os.path import join
output_text_path = join(target_folder, 'ssrg.log')
target_text_path = join(target_folder, 'ssrg.txt')
from macros import transmogrify_conductors
conductor_text_path = transmogrify_conductors(join(
target_folder, 'conductors.dat'), conductor_table_path)
from macros import transmogrify_pylons
pylon_text_path = transmogrify_pylons(join(
target_folder, 'pylons.dat',
), phase_table_path, shield_table_path, span_table_path)
from subprocess import run
executable = 'ssrg.out'
script = 'ssrg.f'
output_text = run([
'gfortran',
'-o',
executable,
script,])
from os.path import expanduser
from subprocess import check_output, STDOUT
output_text = check_output([
join('.', executable),
conductor_text_path,
pylon_text_path,
expanduser(target_text_path),
str(nins),
str(nres),
str(rins),
str(tins),
str(xlngth),
str(fltcurr),
], stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
output_file.write(output_text)
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)