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::Vsource Class Reference
Inheritance diagram for dss::obj::Vsource:
[legend]
Collaboration diagram for dss::obj::Vsource:
[legend]

Classes

struct  Properties
 

Public Types

enum class  VSourceModel : int32_t { Thevenin = 0 , Ideal = 1 }
 VSource: Model (DSS enumeration for Vsource) More...
 

Public Member Functions

 Vsource (APIUtil *util=nullptr, void *ptr_=nullptr)
 Create wrapper directly by a given object handle/pointer.
 
 Vsource (APIUtil *util, int32_t idx)
 Create a wrapper for an element given by the integer index "idx".
 
 Vsource (APIUtil *util, char *name)
 Create a wrapper for an element given its name.
 
const char * name ()
 Returns the object's name.
 
Vsourcebegin_edit ()
 Marks an object for edition. More...
 
Vsourceend_edit (int32_t num_edits=1)
 Finalizes an object edition. More...
 
string bus1 ()
 Name of bus to which the main terminal (1) is connected. More...
 
Vsourcebus1 (const string &value)
 
Vsourcebus1 (const char *value)
 
double basekv ()
 Base Source kV, usually phase-phase (L-L) unless you are making a positive-sequence model or 1-phase modelin which case, it will be phase-neutral (L-N) kV. More...
 
Vsourcebasekv (double value)
 
double pu ()
 Per unit of the base voltage that the source is actually operating at. More...
 
Vsourcepu (double value)
 
double angle ()
 Phase angle in degrees of first phase: e.g.,Angle=10.3. More...
 
Vsourceangle (double value)
 
double frequency ()
 Source frequency. More...
 
Vsourcefrequency (double value)
 
int32_t phases ()
 Number of phases. More...
 
Vsourcephases (int32_t value)
 
double MVAsc3 ()
 MVA Short circuit, 3-phase fault. More...
 
VsourceMVAsc3 (double value)
 
double MVAsc1 ()
 MVA Short Circuit, 1-phase fault. More...
 
VsourceMVAsc1 (double value)
 
double x1r1 ()
 Positive-sequence X/R ratio. More...
 
Vsourcex1r1 (double value)
 
double x0r0 ()
 Zero-sequence X/R ratio.Default = 3. More...
 
Vsourcex0r0 (double value)
 
double Isc3 ()
 Alternate method of defining the source impedance. More...
 
VsourceIsc3 (double value)
 
double Isc1 ()
 Alternate method of defining the source impedance. More...
 
VsourceIsc1 (double value)
 
double R1 ()
 Alternate method of defining the source impedance. More...
 
VsourceR1 (double value)
 
double X1 ()
 Alternate method of defining the source impedance. More...
 
VsourceX1 (double value)
 
double R0 ()
 Alternate method of defining the source impedance. More...
 
VsourceR0 (double value)
 
double X0 ()
 Alternate method of defining the source impedance. More...
 
VsourceX0 (double value)
 
ScanType scantype ()
 {pos*| zero | none} Maintain specified sequence for harmonic solution. More...
 
Vsourcescantype (int32_t value)
 
Vsourcescantype (ScanType value)
 
Vsourcescantype (const string &value)
 
Vsourcescantype (const char *value)
 
string scantype_str ()
 {pos*| zero | none} Maintain specified sequence for harmonic solution. More...
 
Vsourcescantype_str (const string &value)
 {pos*| zero | none} Maintain specified sequence for harmonic solution. More...
 
SequenceType Sequence ()
 {pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes. More...
 
VsourceSequence (int32_t value)
 
VsourceSequence (SequenceType value)
 
VsourceSequence (const string &value)
 
VsourceSequence (const char *value)
 
string Sequence_str ()
 {pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes. More...
 
VsourceSequence_str (const string &value)
 {pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes. More...
 
string bus2 ()
 Name of bus to which 2nd terminal is connected. More...
 
Vsourcebus2 (const string &value)
 
Vsourcebus2 (const char *value)
 
complex Z1 ()
 Positive-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More...
 
VsourceZ1 (complex value)
 
complex Z0 ()
 Zero-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More...
 
VsourceZ0 (complex value)
 
complex Z2 ()
 Negative-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More...
 
VsourceZ2 (complex value)
 
complex puZ1 ()
 2-element array: e.g., [1 2]. More...
 
VsourcepuZ1 (complex value)
 
complex puZ0 ()
 2-element array: e.g., [1 2]. More...
 
VsourcepuZ0 (complex value)
 
complex puZ2 ()
 2-element array: e.g., [1 2]. More...
 
VsourcepuZ2 (complex value)
 
double baseMVA ()
 Default value is 100. More...
 
VsourcebaseMVA (double value)
 
string Yearly ()
 LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations. More...
 
VsourceYearly (const string &value)
 
VsourceYearly (dss::obj::LoadShape &value)
 
dss::obj::LoadShape Yearly_obj ()
 LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations. More...
 
VsourceYearly_obj (dss::obj::LoadShape &value)
 
string Daily ()
 LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations. More...
 
VsourceDaily (const string &value)
 
VsourceDaily (dss::obj::LoadShape &value)
 
dss::obj::LoadShape Daily_obj ()
 LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations. More...
 
VsourceDaily_obj (dss::obj::LoadShape &value)
 
string Duty ()
 LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations. More...
 
VsourceDuty (const string &value)
 
VsourceDuty (dss::obj::LoadShape &value)
 
dss::obj::LoadShape Duty_obj ()
 LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations. More...
 
VsourceDuty_obj (dss::obj::LoadShape &value)
 
VSourceModel Model ()
 {Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source. More...
 
VsourceModel (int32_t value)
 
VsourceModel (VSourceModel value)
 
VsourceModel (const string &value)
 
VsourceModel (const char *value)
 
string Model_str ()
 {Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source. More...
 
VsourceModel_str (const string &value)
 {Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source. More...
 
complex puZideal ()
 2-element array: e.g., [1 2]. More...
 
VsourcepuZideal (complex value)
 
string spectrum ()
 Name of harmonic spectrum for this source. More...
 
Vsourcespectrum (const string &value)
 
Vsourcespectrum (dss::obj::Spectrum &value)
 
dss::obj::Spectrum spectrum_obj ()
 Name of harmonic spectrum for this source. More...
 
Vsourcespectrum_obj (dss::obj::Spectrum &value)
 
double basefreq ()
 Base Frequency for ratings. More...
 
Vsourcebasefreq (double value)
 
bool enabled ()
 {Yes|No or True|False} Indicates whether this element is enabled. More...
 
Vsourceenabled (bool value)
 
Vsourcelike (const string &value)
 Make like another object, e.g. More...
 
Vsourcelike (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 [] = "Vsource"
 
static const int32_t dss_cls_idx = 16
 

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 Enumeration Documentation

◆ VSourceModel

enum class dss::obj::Vsource::VSourceModel : int32_t
strong

VSource: Model (DSS enumeration for Vsource)

Enumerator
Thevenin 

Thevenin.

Ideal 

Ideal.

Member Function Documentation

◆ angle()

double dss::obj::Vsource::angle ( )
inline

Phase angle in degrees of first phase: e.g.,Angle=10.3.

DSS property name: angle, DSS property index: 4

◆ basefreq()

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

Base Frequency for ratings.

DSS property name: basefreq, DSS property index: 33

◆ basekv()

double dss::obj::Vsource::basekv ( )
inline

Base Source kV, usually phase-phase (L-L) unless you are making a positive-sequence model or 1-phase modelin which case, it will be phase-neutral (L-N) kV.

DSS property name: basekv, DSS property index: 2

◆ baseMVA()

double dss::obj::Vsource::baseMVA ( )
inline

Default value is 100.

Base used to convert values specifiied with puZ1, puZ0, and puZ2 properties to ohms on kV base specified by BasekV property.

DSS property name: baseMVA, DSS property index: 26

◆ begin_edit()

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

Marks an object for edition.

Until end_edit is called, some actions are postponed.

◆ bus1()

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

Name of bus to which the main terminal (1) is connected.

bus1=busname bus1=busname.1.2.3

The VSOURCE object is a two-terminal voltage source (thevenin equivalent). Bus2 defaults to Bus1 with all phases connected to ground (node 0) unless previously specified. This is a Yg connection. If you want something different, define the Bus2 property ezplicitly.

DSS property name: bus1, DSS property index: 1

◆ bus2()

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

Name of bus to which 2nd terminal is connected.

bus2=busname bus2=busname.1.2.3

Default is Bus1.0.0.0 (grounded wye connection)

DSS property name: bus2, DSS property index: 19

◆ Daily()

string dss::obj::Vsource::Daily ( )
inline

LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Sets Yearly curve if it is not already defined. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Daily, DSS property index: 28

◆ Daily_obj()

dss::obj::LoadShape dss::obj::Vsource::Daily_obj ( )
inline

LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Sets Yearly curve if it is not already defined. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Daily, DSS property index: 28

◆ Duty()

string dss::obj::Vsource::Duty ( )
inline

LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Defaults to Daily load shape when Daily is defined. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Duty, DSS property index: 29

◆ Duty_obj()

dss::obj::LoadShape dss::obj::Vsource::Duty_obj ( )
inline

LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Defaults to Daily load shape when Daily is defined. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Duty, DSS property index: 29

◆ enabled()

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

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

DSS property name: enabled, DSS property index: 34

◆ end_edit()

Vsource & dss::obj::Vsource::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.

◆ frequency()

double dss::obj::Vsource::frequency ( )
inline

Source frequency.

Defaults to system default base frequency.

DSS property name: frequency, DSS property index: 5

◆ Isc1()

double dss::obj::Vsource::Isc1 ( )
inline

Alternate method of defining the source impedance.

single-phase short circuit current, amps. Default is 10500.

DSS property name: Isc1, DSS property index: 12

◆ Isc3()

double dss::obj::Vsource::Isc3 ( )
inline

Alternate method of defining the source impedance.

3-phase short circuit current, amps. Default is 10000.

DSS property name: Isc3, DSS property index: 11

◆ like() [1/2]

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

Make like another object, e.g.

:

New Capacitor.C2 like=c1 ...

DSS property name: like, DSS property index: 35

◆ like() [2/2]

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

Make like another object, e.g.

:

New Capacitor.C2 like=c1 ...

DSS property name: like, DSS property index: 35

◆ Model()

VSourceModel dss::obj::Vsource::Model ( )
inline

{Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source.

If Thevenin, the Vsource uses the impedances defined for all calculations. If "Ideal", the model uses a small impedance on the diagonal of the impedance matrix for the fundamental base frequency power flow only. Then switches to actual Thevenin model for other frequencies.

DSS property name: Model, DSS property index: 30

◆ Model_str() [1/2]

string dss::obj::Vsource::Model_str ( )
inline

{Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source.

If Thevenin, the Vsource uses the impedances defined for all calculations. If "Ideal", the model uses a small impedance on the diagonal of the impedance matrix for the fundamental base frequency power flow only. Then switches to actual Thevenin model for other frequencies.

DSS property name: Model, DSS property index: 30

◆ Model_str() [2/2]

Vsource & dss::obj::Vsource::Model_str ( const string &  value)
inline

{Thevenin* | Ideal} Specifies whether the Vsource is to be considered a Thevenin short circuit model or a quasi-ideal voltage source.

If Thevenin, the Vsource uses the impedances defined for all calculations. If "Ideal", the model uses a small impedance on the diagonal of the impedance matrix for the fundamental base frequency power flow only. Then switches to actual Thevenin model for other frequencies.

DSS property name: Model, DSS property index: 30

◆ MVAsc1()

double dss::obj::Vsource::MVAsc1 ( )
inline

MVA Short Circuit, 1-phase fault.

Default = 2100. The "single-phase impedance", Zs, is determined by squaring the base kV and dividing by this value. Then Z0 is determined by Z0 = 3Zs - 2Z1. For 1-phase sources, Zs is used directly. Use X0R0 to define X/R ratio for 1-phase source.

DSS property name: MVAsc1, DSS property index: 8

◆ MVAsc3()

double dss::obj::Vsource::MVAsc3 ( )
inline

MVA Short circuit, 3-phase fault.

Default = 2000. Z1 is determined by squaring the base kv and dividing by this value. For single-phase source, this value is not used.

DSS property name: MVAsc3, DSS property index: 7

◆ phases()

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

Number of phases.

Defaults to 3.

DSS property name: phases, DSS property index: 6

◆ pu()

double dss::obj::Vsource::pu ( )
inline

Per unit of the base voltage that the source is actually operating at.

"pu=1.05"

DSS property name: pu, DSS property index: 3

◆ puZ0()

complex dss::obj::Vsource::puZ0 ( )
inline

2-element array: e.g., [1 2].

An alternate way to specify Z0. See Z0 property. Per-unit zero-sequence impedance on base of Vsource BasekV and BaseMVA.

DSS property name: puZ0, DSS property index: 24

◆ puZ1()

complex dss::obj::Vsource::puZ1 ( )
inline

2-element array: e.g., [1 2].

An alternate way to specify Z1. See Z1 property. Per-unit positive-sequence impedance on base of Vsource BasekV and BaseMVA.

DSS property name: puZ1, DSS property index: 23

◆ puZ2()

complex dss::obj::Vsource::puZ2 ( )
inline

2-element array: e.g., [1 2].

An alternate way to specify Z2. See Z2 property. Per-unit negative-sequence impedance on base of Vsource BasekV and BaseMVA.

DSS property name: puZ2, DSS property index: 25

◆ puZideal()

complex dss::obj::Vsource::puZideal ( )
inline

2-element array: e.g., [1 2].

The pu impedance to use for the quasi-ideal voltage source model. Should be a very small impedances. Default is [1e-6, 0.001]. Per-unit impedance on base of Vsource BasekV and BaseMVA. If too small, solution may not work. Be sure to check the voltage values and powers.

DSS property name: puZideal, DSS property index: 31

◆ R0()

double dss::obj::Vsource::R0 ( )
inline

Alternate method of defining the source impedance.

Zero-sequence resistance, ohms. Default is 1.9.

DSS property name: R0, DSS property index: 15

◆ R1()

double dss::obj::Vsource::R1 ( )
inline

Alternate method of defining the source impedance.

Positive-sequence resistance, ohms. Default is 1.65.

DSS property name: R1, DSS property index: 13

◆ scantype()

ScanType dss::obj::Vsource::scantype ( )
inline

{pos*| zero | none} Maintain specified sequence for harmonic solution.

Default is positive sequence. Otherwise, angle between phases rotates with harmonic.

DSS property name: ScanType, DSS property index: 17

◆ scantype_str() [1/2]

string dss::obj::Vsource::scantype_str ( )
inline

{pos*| zero | none} Maintain specified sequence for harmonic solution.

Default is positive sequence. Otherwise, angle between phases rotates with harmonic.

DSS property name: ScanType, DSS property index: 17

◆ scantype_str() [2/2]

Vsource & dss::obj::Vsource::scantype_str ( const string &  value)
inline

{pos*| zero | none} Maintain specified sequence for harmonic solution.

Default is positive sequence. Otherwise, angle between phases rotates with harmonic.

DSS property name: ScanType, DSS property index: 17

◆ Sequence()

SequenceType dss::obj::Vsource::Sequence ( )
inline

{pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes.

Default is positive sequence.

DSS property name: Sequence, DSS property index: 18

◆ Sequence_str() [1/2]

string dss::obj::Vsource::Sequence_str ( )
inline

{pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes.

Default is positive sequence.

DSS property name: Sequence, DSS property index: 18

◆ Sequence_str() [2/2]

Vsource & dss::obj::Vsource::Sequence_str ( const string &  value)
inline

{pos*| neg | zero} Set the phase angles for the specified symmetrical component sequence for non-harmonic solution modes.

Default is positive sequence.

DSS property name: Sequence, DSS property index: 18

◆ spectrum()

string dss::obj::Vsource::spectrum ( )
inline

Name of harmonic spectrum for this source.

Default is "defaultvsource", which is defined when the DSS starts.

DSS property name: spectrum, DSS property index: 32

◆ spectrum_obj()

dss::obj::Spectrum dss::obj::Vsource::spectrum_obj ( )
inline

Name of harmonic spectrum for this source.

Default is "defaultvsource", which is defined when the DSS starts.

DSS property name: spectrum, DSS property index: 32

◆ X0()

double dss::obj::Vsource::X0 ( )
inline

Alternate method of defining the source impedance.

Zero-sequence reactance, ohms. Default is 5.7.

DSS property name: X0, DSS property index: 16

◆ x0r0()

double dss::obj::Vsource::x0r0 ( )
inline

Zero-sequence X/R ratio.Default = 3.

DSS property name: x0r0, DSS property index: 10

◆ X1()

double dss::obj::Vsource::X1 ( )
inline

Alternate method of defining the source impedance.

Positive-sequence reactance, ohms. Default is 6.6.

DSS property name: X1, DSS property index: 14

◆ x1r1()

double dss::obj::Vsource::x1r1 ( )
inline

Positive-sequence X/R ratio.

Default = 4.

DSS property name: x1r1, DSS property index: 9

◆ Yearly()

string dss::obj::Vsource::Yearly ( )
inline

LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Is set to the Daily load shape when Daily is defined. The daily load shape is repeated in this case. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Yearly, DSS property index: 27

◆ Yearly_obj()

dss::obj::LoadShape dss::obj::Vsource::Yearly_obj ( )
inline

LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations.

Set the Mult property of the LOADSHAPE to the pu curve. Qmult is not used. If UseActual=Yes then the Mult curve should be actual L-N kV.

Must be previously defined as a LOADSHAPE object.

Is set to the Daily load shape when Daily is defined. The daily load shape is repeated in this case. Set to NONE to reset to no loadahape for Yearly mode. The default is no variation.

DSS property name: Yearly, DSS property index: 27

◆ Z0()

complex dss::obj::Vsource::Z0 ( )
inline

Zero-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number.

Example:

Z0=[3, 4] ! represents 3 + j4

Used to define the impedance matrix of the VSOURCE if Z1 is also specified.

Note: Z0 defaults to Z1 if it is not specifically defined.

DSS property name: Z0, DSS property index: 21

◆ Z1()

complex dss::obj::Vsource::Z1 ( )
inline

Positive-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number.

Example:

Z1=[1, 2] ! represents 1 + j2

If defined, Z1, Z2, and Z0 are used to define the impedance matrix of the VSOURCE. Z1 MUST BE DEFINED TO USE THIS OPTION FOR DEFINING THE MATRIX.

Side Effect: Sets Z2 and Z0 to same values unless they were previously defined.

DSS property name: Z1, DSS property index: 20

◆ Z2()

complex dss::obj::Vsource::Z2 ( )
inline

Negative-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number.

Example:

Z2=[1, 2] ! represents 1 + j2

Used to define the impedance matrix of the VSOURCE if Z1 is also specified.

Note: Z2 defaults to Z1 if it is not specifically defined. If Z2 is not equal to Z1, the impedance matrix is asymmetrical.

DSS property name: Z2, DSS property index: 22


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