Package: carsons
carsonsThis is an implementation of Carson's Equations, a mathematical model
for deriving the equivalent impedance of an AC transmission or
distribution line.Implementationcarsonsis developed using python 3.6 support for unicode characters
like π, ƒ, ρ, μ, ω etc. This feature allows us to avoid translating the
problem into a more typical programming syntax, so the code is dense and
can easily be compared to published formulations of the problem.For example, we implement the kron reduction, a matrix decomposition
step, using unicode notation to indicate the slightly different meaning
of impedance values before and after a kron reduction:defperform_kron_reduction(z_primitive):Ẑpp,Ẑpn=z_primitive[0:3,0:3],z_primitive[0:3,3:]Ẑnp,Ẑnn=z_primitive[3:,0:3],z_primitive[3:,3:]Z_abc=Ẑpp-Ẑpn@inv(Ẑnn)@ẐnpreturnZ_abcTake a look at thesource
codeto see more cool unicode tricks!Installation~/$pipinstallcarsonsUsageCarsons model requires a line model object that maps each phase to
properties of the conductor for that phase.fromcarsonsimportCarsonsEquations,calculate_impedanceclassLine:geometric_mean_radius:{'A':geometric_mean_radius_Ainmeters...}resistance:{'A':per-lengthresistanceofconductorAinohms/meters...}wire_positions:{'A':(x,y)cross-sectionalpositionoftheconductorinmeters...}phases:{'A',...}# map of phases 'A', 'B', 'C' and 'N<>' which are described in the# gmr, r and phase_positions attributesline_impedance=calculate_impedance(CarsonsEquations(Line()))The model supports any combination of ABC phasings (for example BC, BCN
etc...) including systems with multiple neutral cables; any phases that
are not present in the model will have zeros in the columns and rows
corresponding to that phase.Multiple neutrals are supported, as long as they have unique labels
starting withN(e.g.Neutral1,Neutral2).Intermediate results such as primitive impedance matrix are also
available.z_primitive=CarsonsEquations(Line()).build_z_primitive()For examples of how to use the model, see theoverhead wire
tests.carsonsis tested against several cable configurations from theIEEE
test feeders, as well as
examples from  EPRI'sOpenDSS documentation.Concentric Neutral Cablecarsonsalso supports modelling of concentric neutral cables of any
phasings. Its usage is very similar to the example above, only requiring
a few more parameters about the neutral conductors in the line model
object.fromcarsonsimport(ConcentricNeutralCarsonsEquations,calculate_impedance)classCable:resistance:{'A':per-lengthresistanceofconductorAinohm/meters...}geometric_mean_radius:{'A':geometricmeanradiusofconductorAinmeters...}wire_positions:{'A':(x,y)cross-sectionalpositionofconductorAinmeters...}phases:{'A','NA',...}neutral_strand_gmr:{'NA':neutralstrandgmrofphaseAinmeters...}neutral_strand_resistance:{'NA':neutralstrandresistanceofphaseAinohm/meters...}neutral_strand_diameter:{'NA':neutralstranddiameterofphaseAinmeters...}diameter_over_neutral:{'NA':diameteroverneutralofphaseAinmeters...}neutral_strand_count:{'NA':neutralstrandcountofphaseA...}cable_impedance=calculate_impedance(ConcentricNeutralCarsonsEquations(Cable()))For examples of how to use the model, see theconcentric cable
tests.Multi-Conductor Cablecarsonsalso supports modelling of phased duplex, triplex, quadruplex cables and triplex secondary.
It only requires a few more parameters to describe cable's geometry.fromcarsonsimport(MultiConductorCarsonsEquations,calculate_impedance)classCable:resistance:{'A':per-lengthresistanceofconductorAinohm/meters...}geometric_mean_radius:{'A':geometricmeanradiusofconductorAinmeters...}wire_positions:{'A':(x,y)cross-sectionalpositionofconductorAinmeters...}outside_radius:{'A':outsideradiusofconductorA,includinginsulationandjacketthickness...}insulation_thickness:{'A':insulationthicknessofconductorA...}phases:{'A',...}cable_impedance=calculate_impedance(MultiConductorCarsonsEquations(Cable()))To model a triplex secondary cable, the inputs should be keyed on secondary conductorsS1andS2. The impedance result
is a 2 x 2 matrix.classCable:resistance:{'S1':per-lengthresistanceofconductorS1inohm/meters...}geometric_mean_radius:{'S1':geometricmeanradiusofconductorS1inmeters...}wire_positions:{'S1':(x,y)cross-sectionalpositionofconductorS1inmeters...}outside_radius:{'S1':outsideradiusofconductorS1,includinginsulationandjacketthickness...}insulation_thickness:{'S1':insulationthicknessofconductorS1...}phases:{'S1',...}For examples of how to use the model, see themulti-conductor cable
tests.Tape Shield Cablecarsonsalso supports modelling of tape shield cables of any
phasings. Its usage is very similar to the example above, only requiring
a few more parameters about the tape shield conductors in the line model
object.fromcarsonsimport(TapeShieldedCableCarsonsEquations,calculate_impedance)classCable:resistance:{'A':per-lengthresistanceofconductorAinohm/meters...}geometric_mean_radius:{'A':geometricmeanradiusofconductorAinmeters...}wire_positions:{'A':(x,y)cross-sectionalpositionofconductorAinmeters...}phases:{'A',...}tape_shield_thickness:{'A':thicknessoftapeshieldconductoronphaseAcableinmeters...}tape_shield_outer_diameter:{'A':outerdiameteroftapeshieldconductoronphaseAcableinmeters...}cable_impedance=calculate_impedance(TapeShieldedCableCarsonsEquations(Cable()))For examples of how to use the model, see thetape shielded cable
tests.Problem DescriptionCarsons equations model an AC transmission or distribution line into an
equivalent set of phase-phase impedances, which can be used to model the
line in a power flow analysis.For example, say we have a 4-wire system on a utility pole, withA,B,Cphase conductors as well as a neutral cable N. We know that
when conductors carry electrical current, they exhibit a magnetic field
--- so its pretty easy to imagine that, e.g., the magnetic field
produced byAwould interact with theB,C, andNconductors.B
                          O
                          |
                          |
              A        N  |       C
                O        O|         O
                ----------|-----------
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
                          |
    ==============[Ground]============================
    /     /     /     /     /     /     /     /     /
         /     /     /     /     /     /     /
              /     /     /     /     /
 
 
 
 
 
 
 
 
 
 
                 A*       N*          C*
                   0        0           0
 
                           B*
                             0

Figure: Cross-section of a 4-wire distribution line, with
        ground return.However, each conductor also has a ground return path (or 'image') ---
shown asA*,B*,C*, andN*in the figure above --- which is a
magnetically induced current path in the ground. When A produces a
magnetic field, that fieldalsointeracts withB*,C*,N*,andA*. Carsons equations model all these interactions and reduce them to
an equivalent impedance matrix that makes it much easier to model this
system.In additioncarsonsimplements the kron reduction, a conversion that
approximates the impedances caused by neutral cables by incorporating
them into the impedances for phaseA,B, andC. Since most AC and
DC powerflow formulations don't model the neutral cable, this is a
valuable simplification.ReferencesThe following works were used to produce this formulation:Leonard L. Grigsby -- Electrical Power Generation, Transmission and
DistributionWilliam H. Kersting -- Distribution System Modelling and Analysis
2eWilliam H. Kersting, Distribution System Analysis Subcommittee --
Radial Distribution Test
FeedersTimothy Vismore -- The Vismor
MilieuDaniel Van Dommelen, Albert Van Ranst, Robert Poncelet -- GIC
Influence on Power Systems calculated by Carson's
methodAndrea Ballanti, Roger Dugan -- Cable Modelling in OpenDSS