CSPAN CALCULATES INITIAL AND FINAL SAGS/TENSIONS FOR UP TO 10 USER SPECIFIED CONDITIONS. EACH CONDITION IS DESCRIBED BY LINE TEMPERATURE AND LINE LOADING (ICE BUILD-UP, WIND, AND NESC CONSTANT). CALCULATIONS ARE INITIALLY BASED ON THE RULING SPAN LENGTH AS DEFINED IN THE PROGRAM DOCUMENTATION. A NUMBER OF PROGRAM USER OPTIONS MAY THEN BE SELECTED:
THE PROGRAM STARTS BY PROMPTING THE USER FOR DESIRED INITIAL SAG (OR MAX END-OF-LINE TENSION) FOR A USER SPECIFIED SET OF CONDITIONS. THIS SPECIFICATION IS REFERRED TO, IN WHAT FOLLOWS, AS THE BASE CASE. AS AN EXAMPLE, YOU MIGHT SPECIFY A MAX INITIAL TENSION OF 30% OF RATED CONDUCTOR STRENGTH ASSUMING 0.5 INCH ICE BUILD-UP AND A 4 LB/SQ FT WIND FORCE. THE PROGRAM THEN CALCULATES INITIAL AND FINAL SAGS/TENSIONS FOR ALL OF THE TEMPERATURE/LOADING CONDITIONS YOU HAVE DEFINED. OUTPUT IS PRINTED FIRST TO THE SCREEN. AFTER REVIEWING THE SCREEN YOU MAY SELECT VARIOUS OPTIONS. THE PROGRAM PROVIDES PROMPTS TO ASSIST YOU IN SELECTING THE VARIOUS OPTIONS.
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:
{sbc: RULING SPAN LENGTH IN FEET. ? SEE DOCUMENTATION FOR DEFINITION OF RULING SPAN.}
{cases_table ? First line is base case, ADDITIONAL CONDITIONS YOU WISH TO CONSIDER ARE REFERRED TO AS NEW CASES. YOU MAY ENTER UP TO 10 NEW CASES. ENTER THE CONDUCTOR TEMPERATURE IN DEGREES F. ENTER THE RADIAL THICKNESS OF ICE BUILDUP IN INCHES (TYPICALLY, 0 TO 0.5). ENTER HORIZONTAL WIND PRESSURE IN LBS/SQ FT (TYPICALLY, 0 TO 9 LBS/SQ FT). ENTER NESC K CONSTANT IN LB/FT (TYPICALLY, 0.00 TO 0.31 LB/FT). REMEMBER TO INCLUDE CASES WHICH RESULT IN RELATIVELY HIGH TENSION. THE MAX TENSION OCCURRING FOR YOUR LIST OF CASES IS IMPORTANT IN DETERMINING FINAL SAGS/TENSIONS. CONDUCTOR CREEP IS CONSIDERED AS DESCRIBED IN THE PROGRAM DOCUMENTATION. EACH NEW CASE IS DEFINED BY A LOADING CONDITION (ICE/WIND/NESC CONSTANT) AND CONDUCTOR TEMPERATURE.}
{ntsg ? INITIAL SAG OR INITIAL MAX (END OF SPAN) TENSION IS SUFFICIENT TO COMPLETE THE DESCRIPTION'OF THE BASE CASE. TO ENTER INITIAL SAG, TYPE: 1 TO ENTER INITIAL MAX TENSION, TYPE: 2}
{val: Inital Sag or Initial Max Tension ? IF PREV VALUE ENTERED WAS 1, THEN ENTER THE INITIAL SAG IN FEET. OTHERWISE ENTER MAX TENSION AS PERCENTAGE OF RATED STRENGTH.}
# Click the Blue Plane to preview this as a CrossCompute tool
conductor_table_path = 'conductors.csv'
aux1_table_path = 'aux1.csv'
aux3_table_path = 'aux3.csv'
aux4_table_path = 'aux4.csv'
phase_table_path = 'phases.csv'
shield_table_path = 'shields.csv'
span_table_path = 'spans.csv'
sbc = 1
cases_table_path = 'cases.csv'
ntsg = 1
val = 10
target_folder = '/tmp'
ntsg = 1 if int(ntsg) == 1 else 2
from pandas import read_csv
df = read_csv(cases_table_path)
df
ncases = len(df) - 1
if ncases < 1:
raise Exception('not enough cases')
elif ncases > 10:
raise Exception('too much cases')
from os.path import join
output_text_path = join(target_folder, 'cspan.log')
target_text_path = join(target_folder, 'cspan.txt')
plot_text_path = join(target_folder, 'cspan_plot.txt')
from macros import transmogrify_conductors
conductor_text_path = join(
target_folder, 'conductors.dat')
_ = transmogrify_conductors(conductor_text_path, conductor_table_path)
from macros import transmogrify_aux1
aux1_text_path = join(
target_folder, 'aux1.dat')
_ = transmogrify_aux1(aux1_text_path, aux1_table_path)
from macros import transmogrify_aux3
aux3_text_path = join(
target_folder, 'aux3.dat')
_ = transmogrify_aux3(aux3_text_path, aux3_table_path)
from macros import transmogrify_aux4
aux4_text_path = join(
target_folder, 'aux4.dat')
_ = transmogrify_aux4(aux4_text_path, aux4_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 = 'cspan.out'
script = 'cspan.f'
output_text = run([
'gfortran',
'-o',
executable,
script,])
from itertools import chain
from os.path import expanduser
cmd = list(chain([
join('.', executable),
conductor_text_path,
aux1_text_path,
aux3_text_path,
aux4_text_path,
pylon_text_path,
expanduser(target_text_path),
expanduser(plot_text_path),
sbc,
ncases,
], *zip(df.tnew, df.rice, df.wpr, df.ck), [ntsg, val]))
cmd = [str(x) for x in cmd]
from subprocess import check_output, STDOUT
output_text = check_output(cmd, 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)
print('plot_text_path = ' + plot_text_path)