DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
dss::obj::Line Class Reference
Inheritance diagram for dss::obj::Line:
[legend]
Collaboration diagram for dss::obj::Line:
[legend]

Classes

struct  Properties
 

Public Member Functions

 Line (APIUtil *util=nullptr, void *ptr_=nullptr)
 Create wrapper directly by a given object handle/pointer.
 
 Line (APIUtil *util, int32_t idx)
 Create a wrapper for an element given by the integer index "idx".
 
 Line (APIUtil *util, char *name)
 Create a wrapper for an element given its name.
 
const char * name ()
 Returns the object's name.
 
Linebegin_edit ()
 Marks an object for edition. More...
 
Lineend_edit (int32_t num_edits=1)
 Finalizes an object edition. More...
 
string bus1 ()
 Name of bus to which first terminal is connected. More...
 
Linebus1 (const string &value)
 
Linebus1 (const char *value)
 
string bus2 ()
 Name of bus to which 2nd terminal is connected. More...
 
Linebus2 (const string &value)
 
Linebus2 (const char *value)
 
string linecode ()
 Name of linecode object describing line impedances. More...
 
Linelinecode (const string &value)
 
Linelinecode (dss::obj::LineCode &value)
 
dss::obj::LineCode linecode_obj ()
 Name of linecode object describing line impedances. More...
 
Linelinecode_obj (dss::obj::LineCode &value)
 
double length ()
 Length of line. More...
 
Linelength (double value)
 
int32_t phases ()
 Number of phases, this line. More...
 
Linephases (int32_t value)
 
double r1 ()
 Positive-sequence Resistance, ohms per unit length. More...
 
Liner1 (double value)
 
double x1 ()
 Positive-sequence Reactance, ohms per unit length. More...
 
Linex1 (double value)
 
double r0 ()
 Zero-sequence Resistance, ohms per unit length. More...
 
Liner0 (double value)
 
double x0 ()
 Zero-sequence Reactance, ohms per unit length. More...
 
Linex0 (double value)
 
double C1 ()
 Positive-sequence capacitance, nf per unit length. More...
 
LineC1 (double value)
 
double C0 ()
 Zero-sequence capacitance, nf per unit length. More...
 
LineC0 (double value)
 
VectorXd rmatrix ()
 Resistance matrix, lower triangle, ohms per unit length. More...
 
Linermatrix (VectorXd &value)
 
VectorXd xmatrix ()
 Reactance matrix, lower triangle, ohms per unit length. More...
 
Linexmatrix (VectorXd &value)
 
VectorXd cmatrix ()
 Nodal Capacitance matrix, lower triangle, nf per unit length.Order of the matrix is the number of phases. More...
 
Linecmatrix (VectorXd &value)
 
bool Switch ()
 {y/n | T/F} Default= no/false. More...
 
LineSwitch (bool value)
 
double Rg ()
 Carson earth return resistance per unit length used to compute impedance values at base frequency. More...
 
LineRg (double value)
 
double Xg ()
 Carson earth return reactance per unit length used to compute impedance values at base frequency. More...
 
LineXg (double value)
 
double rho ()
 Default=100 meter ohms. More...
 
Linerho (double value)
 
string geometry ()
 Geometry code for LineGeometry Object. More...
 
Linegeometry (const string &value)
 
Linegeometry (dss::obj::LineGeometry &value)
 
dss::obj::LineGeometry geometry_obj ()
 Geometry code for LineGeometry Object. More...
 
Linegeometry_obj (dss::obj::LineGeometry &value)
 
DimensionUnits units ()
 Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units. More...
 
Lineunits (int32_t value)
 
Lineunits (DimensionUnits value)
 
Lineunits (const string &value)
 
Lineunits (const char *value)
 
string units_str ()
 Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units. More...
 
Lineunits_str (const string &value)
 Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units. More...
 
string spacing ()
 Reference to a LineSpacing for use in a line constants calculation. More...
 
Linespacing (const string &value)
 
Linespacing (dss::obj::LineSpacing &value)
 
dss::obj::LineSpacing spacing_obj ()
 Reference to a LineSpacing for use in a line constants calculation. More...
 
Linespacing_obj (dss::obj::LineSpacing &value)
 
strings wires ()
 Array of WireData names for use in an overhead line constants calculation. More...
 
Linewires (strings &value)
 
Linewires (std::vector< dss::obj::WireData > &value)
 
std::vector< dss::obj::WireDatawires_obj ()
 Array of WireData names for use in an overhead line constants calculation. More...
 
Linewires_obj (std::vector< dss::obj::WireData > &value)
 
EarthModel earthmodel ()
 One of {Carson | FullCarson | Deri}. More...
 
Lineearthmodel (int32_t value)
 
Lineearthmodel (EarthModel value)
 
Lineearthmodel (const string &value)
 
Lineearthmodel (const char *value)
 
string earthmodel_str ()
 One of {Carson | FullCarson | Deri}. More...
 
Lineearthmodel_str (const string &value)
 One of {Carson | FullCarson | Deri}. More...
 
strings cncables ()
 Array of CNData names for use in a cable constants calculation. More...
 
Linecncables (strings &value)
 
Linecncables (std::vector< dss::obj::CNData > &value)
 
std::vector< dss::obj::CNDatacncables_obj ()
 Array of CNData names for use in a cable constants calculation. More...
 
Linecncables_obj (std::vector< dss::obj::CNData > &value)
 
strings tscables ()
 Array of TSData names for use in a cable constants calculation. More...
 
Linetscables (strings &value)
 
Linetscables (std::vector< dss::obj::TSData > &value)
 
std::vector< dss::obj::TSDatatscables_obj ()
 Array of TSData names for use in a cable constants calculation. More...
 
Linetscables_obj (std::vector< dss::obj::TSData > &value)
 
double B1 ()
 Alternate way to specify C1. More...
 
LineB1 (double value)
 
double B0 ()
 Alternate way to specify C0. More...
 
LineB0 (double value)
 
int32_t Seasons ()
 Defines the number of ratings to be defined for the wire, to be used only when defining seasonal ratings using the "Ratings" property. More...
 
LineSeasons (int32_t value)
 
VectorXd Ratings ()
 An array of ratings to be used when the seasonal ratings flag is True. More...
 
LineRatings (VectorXd &value)
 
LineType linetype ()
 Code designating the type of line. More...
 
Linelinetype (int32_t value)
 
Linelinetype (LineType value)
 
Linelinetype (const string &value)
 
Linelinetype (const char *value)
 
string linetype_str ()
 Code designating the type of line. More...
 
Linelinetype_str (const string &value)
 Code designating the type of line. More...
 
double normamps ()
 Normal rated current. More...
 
Linenormamps (double value)
 
double emergamps ()
 Maximum or emerg current. More...
 
Lineemergamps (double value)
 
double faultrate ()
 Failure rate PER UNIT LENGTH per year. More...
 
Linefaultrate (double value)
 
double pctperm ()
 Percent of failures that become permanent. More...
 
Linepctperm (double value)
 
double repair ()
 Hours to repair. More...
 
Linerepair (double value)
 
double basefreq ()
 Base Frequency for ratings. More...
 
Linebasefreq (double value)
 
bool enabled ()
 {Yes|No or True|False} Indicates whether this element is enabled. More...
 
Lineenabled (bool value)
 
Linelike (const string &value)
 Make like another object, e.g. More...
 
Linelike (const char *value)
 Make like another object, e.g. More...
 
- Public Member Functions inherited from dss::obj::DSSObj
 DSSObj (APIUtil *util=nullptr, void *ptr_=nullptr)
 

Static Public Attributes

static const char dss_cls_name [] = "Line"
 
static const int32_t dss_cls_idx = 15
 

Additional Inherited Members

- Public Attributes inherited from dss::obj::DSSObj
APIUtilapi_util
 
void * ptr
 
- Protected Member Functions inherited from dss::obj::DSSObj
void check_for_error ()
 
void set_string (int32_t index, const string &value)
 
void set_string (int32_t index, const char *value)
 
string get_prop_string (int32_t index)
 
complex get_complex (int32_t index)
 
void set_complex (int32_t index, complex value)
 
void set_string_array (int32_t index, strings &value)
 
void set_obj (int32_t index, DSSObj &value)
 
template<typename T >
get_obj (int32_t index)
 
template<typename T = VectorXd>
get_array (int32_t index)
 
template<typename T = VectorXd>
void set_array (int32_t index, T value)
 
- Static Protected Member Functions inherited from dss::obj::DSSObj
template<typename T = VectorXd>
static void set_array (void *ptr, int32_t index, T value)
 
- Protected Attributes inherited from dss::obj::DSSObj
friend DSSBatch
 

Member Function Documentation

◆ B0()

double dss::obj::Line::B0 ( )
inline

Alternate way to specify C0.

MicroS per unit length

DSS property name: B0, DSS property index: 27

◆ B1()

double dss::obj::Line::B1 ( )
inline

Alternate way to specify C1.

MicroS per unit length

DSS property name: B1, DSS property index: 26

◆ basefreq()

double dss::obj::Line::basefreq ( )
inline

Base Frequency for ratings.

DSS property name: basefreq, DSS property index: 36

◆ begin_edit()

Line & dss::obj::Line::begin_edit ( )
inline

Marks an object for edition.

Until end_edit is called, some actions are postponed.

◆ bus1()

string dss::obj::Line::bus1 ( )
inline

Name of bus to which first terminal is connected.

Example: bus1=busname (assumes all terminals connected in normal phase order) bus1=busname.3.1.2.0 (specify terminal to node connections explicitly)

DSS property name: bus1, DSS property index: 1

◆ bus2()

string dss::obj::Line::bus2 ( )
inline

Name of bus to which 2nd terminal is connected.

DSS property name: bus2, DSS property index: 2

◆ C0()

double dss::obj::Line::C0 ( )
inline

Zero-sequence capacitance, nf per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.See also B0.

DSS property name: C0, DSS property index: 11

◆ C1()

double dss::obj::Line::C1 ( )
inline

Positive-sequence capacitance, nf per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Cmatrix and B1.

DSS property name: C1, DSS property index: 10

◆ cmatrix()

VectorXd dss::obj::Line::cmatrix ( )
inline

Nodal Capacitance matrix, lower triangle, nf per unit length.Order of the matrix is the number of phases.

May be used to specify the shunt capacitance of any line configuration. Using any of Rmatrix, Xmatrix, Cmatrix forces program to use the matrix values for line impedance definition. For balanced line models, you may use the standard symmetrical component data definition instead.

DSS property name: cmatrix, DSS property index: 14

◆ cncables()

strings dss::obj::Line::cncables ( )
inline

Array of CNData names for use in a cable constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, using "nphases" cncables. You may later specify "nconds-nphases" wires for separate neutrals

DSS property name: cncables, DSS property index: 24

◆ cncables_obj()

std::vector< dss::obj::CNData > dss::obj::Line::cncables_obj ( )
inline

Array of CNData names for use in a cable constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, using "nphases" cncables. You may later specify "nconds-nphases" wires for separate neutrals

DSS property name: cncables, DSS property index: 24

◆ earthmodel()

EarthModel dss::obj::Line::earthmodel ( )
inline

One of {Carson | FullCarson | Deri}.

Default is the global value established with the Set EarthModel command. See the Options Help on EarthModel option. This is used to override the global value for this line. This option applies only when the "geometry" property is used.

DSS property name: EarthModel, DSS property index: 23

◆ earthmodel_str() [1/2]

string dss::obj::Line::earthmodel_str ( )
inline

One of {Carson | FullCarson | Deri}.

Default is the global value established with the Set EarthModel command. See the Options Help on EarthModel option. This is used to override the global value for this line. This option applies only when the "geometry" property is used.

DSS property name: EarthModel, DSS property index: 23

◆ earthmodel_str() [2/2]

Line & dss::obj::Line::earthmodel_str ( const string &  value)
inline

One of {Carson | FullCarson | Deri}.

Default is the global value established with the Set EarthModel command. See the Options Help on EarthModel option. This is used to override the global value for this line. This option applies only when the "geometry" property is used.

DSS property name: EarthModel, DSS property index: 23

◆ emergamps()

double dss::obj::Line::emergamps ( )
inline

Maximum or emerg current.

DSS property name: emergamps, DSS property index: 32

◆ enabled()

bool dss::obj::Line::enabled ( )
inline

{Yes|No or True|False} Indicates whether this element is enabled.

DSS property name: enabled, DSS property index: 37

◆ end_edit()

Line & dss::obj::Line::end_edit ( int32_t  num_edits = 1)
inline

Finalizes an object edition.

This will result more compelx side-effects like Yprim and other internal data recalculation, for example.

◆ faultrate()

double dss::obj::Line::faultrate ( )
inline

Failure rate PER UNIT LENGTH per year.

Length must be same units as LENGTH property. Default is 0.1 fault per unit length per year.

DSS property name: faultrate, DSS property index: 33

◆ geometry()

string dss::obj::Line::geometry ( )
inline

Geometry code for LineGeometry Object.

Supercedes any previous definition of line impedance. Line constants are computed for each frequency change or rho change. CAUTION: may alter number of phases. You cannot subsequently change the number of phases unless you change how the line impedance is defined.

DSS property name: geometry, DSS property index: 19

◆ geometry_obj()

dss::obj::LineGeometry dss::obj::Line::geometry_obj ( )
inline

Geometry code for LineGeometry Object.

Supercedes any previous definition of line impedance. Line constants are computed for each frequency change or rho change. CAUTION: may alter number of phases. You cannot subsequently change the number of phases unless you change how the line impedance is defined.

DSS property name: geometry, DSS property index: 19

◆ length()

double dss::obj::Line::length ( )
inline

Length of line.

Default is 1.0. If units do not match the impedance data, specify "units" property.

DSS property name: length, DSS property index: 4

◆ like() [1/2]

Line & dss::obj::Line::like ( const char *  value)
inline

Make like another object, e.g.

:

New Capacitor.C2 like=c1 ...

DSS property name: like, DSS property index: 38

◆ like() [2/2]

Line & dss::obj::Line::like ( const string &  value)
inline

Make like another object, e.g.

:

New Capacitor.C2 like=c1 ...

DSS property name: like, DSS property index: 38

◆ linecode()

string dss::obj::Line::linecode ( )
inline

Name of linecode object describing line impedances.

If you use a line code, you do not need to specify the impedances here. The line code must have been PREVIOUSLY defined. The values specified last will prevail over those specified earlier (left-to-right sequence of properties). You can subsequently change the number of phases if symmetrical component quantities are specified.If no line code or impedance data are specified, the line object defaults to 336 MCM ACSR on 4 ft spacing.

DSS property name: linecode, DSS property index: 3

◆ linecode_obj()

dss::obj::LineCode dss::obj::Line::linecode_obj ( )
inline

Name of linecode object describing line impedances.

If you use a line code, you do not need to specify the impedances here. The line code must have been PREVIOUSLY defined. The values specified last will prevail over those specified earlier (left-to-right sequence of properties). You can subsequently change the number of phases if symmetrical component quantities are specified.If no line code or impedance data are specified, the line object defaults to 336 MCM ACSR on 4 ft spacing.

DSS property name: linecode, DSS property index: 3

◆ linetype()

LineType dss::obj::Line::linetype ( )
inline

Code designating the type of line.

One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW

OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.

DSS property name: LineType, DSS property index: 30

◆ linetype_str() [1/2]

string dss::obj::Line::linetype_str ( )
inline

Code designating the type of line.

One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW

OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.

DSS property name: LineType, DSS property index: 30

◆ linetype_str() [2/2]

Line & dss::obj::Line::linetype_str ( const string &  value)
inline

Code designating the type of line.

One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW

OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.

DSS property name: LineType, DSS property index: 30

◆ normamps()

double dss::obj::Line::normamps ( )
inline

Normal rated current.

DSS property name: normamps, DSS property index: 31

◆ pctperm()

double dss::obj::Line::pctperm ( )
inline

Percent of failures that become permanent.

Default is 20.

DSS property name: pctperm, DSS property index: 34

◆ phases()

int32_t dss::obj::Line::phases ( )
inline

Number of phases, this line.

DSS property name: phases, DSS property index: 5

◆ r0()

double dss::obj::Line::r0 ( )
inline

Zero-sequence Resistance, ohms per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.

DSS property name: r0, DSS property index: 8

◆ r1()

double dss::obj::Line::r1 ( )
inline

Positive-sequence Resistance, ohms per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Rmatrix.

DSS property name: r1, DSS property index: 6

◆ Ratings()

VectorXd dss::obj::Line::Ratings ( )
inline

An array of ratings to be used when the seasonal ratings flag is True.

It can be used to insert multiple ratings to change during a QSTS simulation to evaluate different ratings in lines.

DSS property name: Ratings, DSS property index: 29

◆ repair()

double dss::obj::Line::repair ( )
inline

Hours to repair.

Default is 3 hr.

DSS property name: repair, DSS property index: 35

◆ Rg()

double dss::obj::Line::Rg ( )
inline

Carson earth return resistance per unit length used to compute impedance values at base frequency.

Default is 0.01805 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.

DSS property name: Rg, DSS property index: 16

◆ rho()

double dss::obj::Line::rho ( )
inline

Default=100 meter ohms.

Earth resitivity used to compute earth correction factor. Overrides Line geometry definition if specified.

DSS property name: rho, DSS property index: 18

◆ rmatrix()

VectorXd dss::obj::Line::rmatrix ( )
inline

Resistance matrix, lower triangle, ohms per unit length.

Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. Using any of Rmatrix, Xmatrix, Cmatrix forces program to use the matrix values for line impedance definition. For balanced line models, you may use the standard symmetrical component data definition instead.

DSS property name: rmatrix, DSS property index: 12

◆ Seasons()

int32_t dss::obj::Line::Seasons ( )
inline

Defines the number of ratings to be defined for the wire, to be used only when defining seasonal ratings using the "Ratings" property.

DSS property name: Seasons, DSS property index: 28

◆ spacing()

string dss::obj::Line::spacing ( )
inline

Reference to a LineSpacing for use in a line constants calculation.

Must be used in conjunction with the Wires property. Specify this before the wires property.

DSS property name: spacing, DSS property index: 21

◆ spacing_obj()

dss::obj::LineSpacing dss::obj::Line::spacing_obj ( )
inline

Reference to a LineSpacing for use in a line constants calculation.

Must be used in conjunction with the Wires property. Specify this before the wires property.

DSS property name: spacing, DSS property index: 21

◆ Switch()

bool dss::obj::Line::Switch ( )
inline

{y/n | T/F} Default= no/false.

Designates this line as a switch for graphics and algorithmic purposes. SIDE EFFECT: Sets r1 = 1.0; x1 = 1.0; r0 = 1.0; x0 = 1.0; c1 = 1.1 ; c0 = 1.0; length = 0.001; You must reset if you want something different.

DSS property name: Switch, DSS property index: 15

◆ tscables()

strings dss::obj::Line::tscables ( )
inline

Array of TSData names for use in a cable constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, using "nphases" tscables. You may later specify "nconds-nphases" wires for separate neutrals

DSS property name: tscables, DSS property index: 25

◆ tscables_obj()

std::vector< dss::obj::TSData > dss::obj::Line::tscables_obj ( )
inline

Array of TSData names for use in a cable constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, using "nphases" tscables. You may later specify "nconds-nphases" wires for separate neutrals

DSS property name: tscables, DSS property index: 25

◆ units()

DimensionUnits dss::obj::Line::units ( )
inline

Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units.

DSS property name: units, DSS property index: 20

◆ units_str() [1/2]

string dss::obj::Line::units_str ( )
inline

Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units.

DSS property name: units, DSS property index: 20

◆ units_str() [2/2]

Line & dss::obj::Line::units_str ( const string &  value)
inline

Length Units = {none | mi|kft|km|m|Ft|in|cm } Default is None - assumes length units match impedance units.

DSS property name: units, DSS property index: 20

◆ wires()

strings dss::obj::Line::wires ( )
inline

Array of WireData names for use in an overhead line constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, and "ncond" wires. May also be used to specify bare neutrals with cables, using "ncond-nphase" wires.

DSS property name: wires, DSS property index: 22

◆ wires_obj()

std::vector< dss::obj::WireData > dss::obj::Line::wires_obj ( )
inline

Array of WireData names for use in an overhead line constants calculation.

Must be used in conjunction with the Spacing property. Specify the Spacing first, and "ncond" wires. May also be used to specify bare neutrals with cables, using "ncond-nphase" wires.

DSS property name: wires, DSS property index: 22

◆ x0()

double dss::obj::Line::x0 ( )
inline

Zero-sequence Reactance, ohms per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.

DSS property name: x0, DSS property index: 9

◆ x1()

double dss::obj::Line::x1 ( )
inline

Positive-sequence Reactance, ohms per unit length.

Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Xmatrix

DSS property name: x1, DSS property index: 7

◆ Xg()

double dss::obj::Line::Xg ( )
inline

Carson earth return reactance per unit length used to compute impedance values at base frequency.

For making better frequency adjustments. Default is 0.155081 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.

DSS property name: Xg, DSS property index: 17

◆ xmatrix()

VectorXd dss::obj::Line::xmatrix ( )
inline

Reactance matrix, lower triangle, ohms per unit length.

Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. Using any of Rmatrix, Xmatrix, Cmatrix forces program to use the matrix values for line impedance definition. For balanced line models, you may use the standard symmetrical component data definition instead.

DSS property name: xmatrix, DSS property index: 13


The documentation for this class was generated from the following file: