PowerSystems.jl
PowerSystems.jl copied to clipboard
PSS/E Parser - Branch Voltage endpoints
Considering a voltage difference (tolerance) in both ends when parsing branches.
in
function check_endpoint_voltages(line)
is_valid = true
arc = get_arc(line)
if get_base_voltage(get_from(arc)) != get_base_voltage(get_to(arc))
is_valid = false
@error "Voltage endpoints of $(line.name) are different, cannot create Line"
end
return is_valid
end
to
function check_endpoint_voltages(line, tolerance=0.02)
is_valid = true
arc = get_arc(line)
from_voltage = get_base_voltage(get_from(arc))
to_voltage = get_base_voltage(get_to(arc))
percent_difference = abs(from_voltage - to_voltage) / ((from_voltage + to_voltage) / 2)
if percent_difference > tolerance
is_valid = false
@error "Voltage endpoints of $(line.name) have more than $(tolerance*100)% difference, cannot create Line"
end
return is_valid
end
@claytonpbarrows any thoughts on this?