DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
|
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. | |
Vsource & | begin_edit () |
Marks an object for edition. More... | |
Vsource & | end_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... | |
Vsource & | bus1 (const string &value) |
Vsource & | bus1 (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... | |
Vsource & | basekv (double value) |
double | pu () |
Per unit of the base voltage that the source is actually operating at. More... | |
Vsource & | pu (double value) |
double | angle () |
Phase angle in degrees of first phase: e.g.,Angle=10.3. More... | |
Vsource & | angle (double value) |
double | frequency () |
Source frequency. More... | |
Vsource & | frequency (double value) |
int32_t | phases () |
Number of phases. More... | |
Vsource & | phases (int32_t value) |
double | MVAsc3 () |
MVA Short circuit, 3-phase fault. More... | |
Vsource & | MVAsc3 (double value) |
double | MVAsc1 () |
MVA Short Circuit, 1-phase fault. More... | |
Vsource & | MVAsc1 (double value) |
double | x1r1 () |
Positive-sequence X/R ratio. More... | |
Vsource & | x1r1 (double value) |
double | x0r0 () |
Zero-sequence X/R ratio.Default = 3. More... | |
Vsource & | x0r0 (double value) |
double | Isc3 () |
Alternate method of defining the source impedance. More... | |
Vsource & | Isc3 (double value) |
double | Isc1 () |
Alternate method of defining the source impedance. More... | |
Vsource & | Isc1 (double value) |
double | R1 () |
Alternate method of defining the source impedance. More... | |
Vsource & | R1 (double value) |
double | X1 () |
Alternate method of defining the source impedance. More... | |
Vsource & | X1 (double value) |
double | R0 () |
Alternate method of defining the source impedance. More... | |
Vsource & | R0 (double value) |
double | X0 () |
Alternate method of defining the source impedance. More... | |
Vsource & | X0 (double value) |
ScanType | scantype () |
{pos*| zero | none} Maintain specified sequence for harmonic solution. More... | |
Vsource & | scantype (int32_t value) |
Vsource & | scantype (ScanType value) |
Vsource & | scantype (const string &value) |
Vsource & | scantype (const char *value) |
string | scantype_str () |
{pos*| zero | none} Maintain specified sequence for harmonic solution. More... | |
Vsource & | scantype_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... | |
Vsource & | Sequence (int32_t value) |
Vsource & | Sequence (SequenceType value) |
Vsource & | Sequence (const string &value) |
Vsource & | Sequence (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... | |
Vsource & | Sequence_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... | |
Vsource & | bus2 (const string &value) |
Vsource & | bus2 (const char *value) |
complex | Z1 () |
Positive-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More... | |
Vsource & | Z1 (complex value) |
complex | Z0 () |
Zero-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More... | |
Vsource & | Z0 (complex value) |
complex | Z2 () |
Negative-sequence equivalent source impedance, ohms, as a 2-element array representing a complex number. More... | |
Vsource & | Z2 (complex value) |
complex | puZ1 () |
2-element array: e.g., [1 2]. More... | |
Vsource & | puZ1 (complex value) |
complex | puZ0 () |
2-element array: e.g., [1 2]. More... | |
Vsource & | puZ0 (complex value) |
complex | puZ2 () |
2-element array: e.g., [1 2]. More... | |
Vsource & | puZ2 (complex value) |
double | baseMVA () |
Default value is 100. More... | |
Vsource & | baseMVA (double value) |
string | Yearly () |
LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations. More... | |
Vsource & | Yearly (const string &value) |
Vsource & | Yearly (dss::obj::LoadShape &value) |
dss::obj::LoadShape | Yearly_obj () |
LOADSHAPE object to use for the per-unit voltage for YEARLY-mode simulations. More... | |
Vsource & | Yearly_obj (dss::obj::LoadShape &value) |
string | Daily () |
LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations. More... | |
Vsource & | Daily (const string &value) |
Vsource & | Daily (dss::obj::LoadShape &value) |
dss::obj::LoadShape | Daily_obj () |
LOADSHAPE object to use for the per-unit voltage for DAILY-mode simulations. More... | |
Vsource & | Daily_obj (dss::obj::LoadShape &value) |
string | Duty () |
LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations. More... | |
Vsource & | Duty (const string &value) |
Vsource & | Duty (dss::obj::LoadShape &value) |
dss::obj::LoadShape | Duty_obj () |
LOADSHAPE object to use for the per-unit voltage for DUTYCYCLE-mode simulations. More... | |
Vsource & | Duty_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... | |
Vsource & | Model (int32_t value) |
Vsource & | Model (VSourceModel value) |
Vsource & | Model (const string &value) |
Vsource & | Model (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... | |
Vsource & | Model_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... | |
Vsource & | puZideal (complex value) |
string | spectrum () |
Name of harmonic spectrum for this source. More... | |
Vsource & | spectrum (const string &value) |
Vsource & | spectrum (dss::obj::Spectrum &value) |
dss::obj::Spectrum | spectrum_obj () |
Name of harmonic spectrum for this source. More... | |
Vsource & | spectrum_obj (dss::obj::Spectrum &value) |
double | basefreq () |
Base Frequency for ratings. More... | |
Vsource & | basefreq (double value) |
bool | enabled () |
{Yes|No or True|False} Indicates whether this element is enabled. More... | |
Vsource & | enabled (bool value) |
Vsource & | like (const string &value) |
Make like another object, e.g. More... | |
Vsource & | like (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 | |
APIUtil * | api_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 > | |
T | get_obj (int32_t index) |
template<typename T = VectorXd> | |
T | 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 |
|
strong |
VSource: Model (DSS enumeration for Vsource)
Enumerator | |
---|---|
Thevenin | Thevenin. |
Ideal | Ideal. |
|
inline |
Phase angle in degrees of first phase: e.g.,Angle=10.3.
DSS property name: angle, DSS property index: 4
|
inline |
Base Frequency for ratings.
DSS property name: basefreq, DSS property index: 33
|
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
|
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
|
inline |
Marks an object for edition.
Until end_edit
is called, some actions are postponed.
|
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
|
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
|
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
|
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
|
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
|
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
|
inline |
{Yes|No or True|False} Indicates whether this element is enabled.
DSS property name: enabled, DSS property index: 34
|
inline |
Finalizes an object edition.
This will result more compelx side-effects like Yprim and other internal data recalculation, for example.
|
inline |
Source frequency.
Defaults to system default base frequency.
DSS property name: frequency, DSS property index: 5
|
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
|
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
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 35
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 35
|
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
|
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
|
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
|
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
|
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
|
inline |
Number of phases.
Defaults to 3.
DSS property name: phases, DSS property index: 6
|
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
|
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
|
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
|
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
|
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
|
inline |
Alternate method of defining the source impedance.
Zero-sequence resistance, ohms. Default is 1.9.
DSS property name: R0, DSS property index: 15
|
inline |
Alternate method of defining the source impedance.
Positive-sequence resistance, ohms. Default is 1.65.
DSS property name: R1, DSS property index: 13
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
inline |
Alternate method of defining the source impedance.
Zero-sequence reactance, ohms. Default is 5.7.
DSS property name: X0, DSS property index: 16
|
inline |
Zero-sequence X/R ratio.Default = 3.
DSS property name: x0r0, DSS property index: 10
|
inline |
Alternate method of defining the source impedance.
Positive-sequence reactance, ohms. Default is 6.6.
DSS property name: X1, DSS property index: 14
|
inline |
Positive-sequence X/R ratio.
Default = 4.
DSS property name: x1r1, DSS property index: 9
|
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
|
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
|
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
|
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
|
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