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 | LoadModel : int32_t { ConstantPQ = 1 , ConstantZ = 2 , Motor = 3 , CVR = 4 , ConstantI = 5 , ConstantP_fixedQ = 6 , ConstantP_fixedX = 7 , ZIPV = 8 } |
Load: Model (DSS enumeration for Load) More... | |
enum class | LoadStatus : int32_t { Variable = 0 , Fixed = 1 , Exempt = 2 } |
Load: Status (DSS enumeration for Load) More... | |
Public Member Functions | |
Load (APIUtil *util=nullptr, void *ptr_=nullptr) | |
Create wrapper directly by a given object handle/pointer. | |
Load (APIUtil *util, int32_t idx) | |
Create a wrapper for an element given by the integer index "idx". | |
Load (APIUtil *util, char *name) | |
Create a wrapper for an element given its name. | |
const char * | name () |
Returns the object's name. | |
Load & | begin_edit () |
Marks an object for edition. More... | |
Load & | end_edit (int32_t num_edits=1) |
Finalizes an object edition. More... | |
int32_t | phases () |
Number of Phases, this load. More... | |
Load & | phases (int32_t value) |
string | bus1 () |
Bus to which the load is connected. More... | |
Load & | bus1 (const string &value) |
Load & | bus1 (const char *value) |
double | kV () |
Nominal rated (1.0 per unit) voltage, kV, for load. More... | |
Load & | kV (double value) |
double | kW () |
Total base kW for the load. More... | |
Load & | kW (double value) |
double | pf () |
Load power factor. More... | |
Load & | pf (double value) |
LoadModel | model () |
Integer code for the model to use for load variation with voltage. More... | |
Load & | model (int32_t value) |
Load & | model (LoadModel value) |
string | yearly () |
LOADSHAPE object to use for yearly simulations. More... | |
Load & | yearly (const string &value) |
Load & | yearly (dss::obj::LoadShape &value) |
dss::obj::LoadShape | yearly_obj () |
LOADSHAPE object to use for yearly simulations. More... | |
Load & | yearly_obj (dss::obj::LoadShape &value) |
string | daily () |
LOADSHAPE object to use for daily simulations. More... | |
Load & | daily (const string &value) |
Load & | daily (dss::obj::LoadShape &value) |
dss::obj::LoadShape | daily_obj () |
LOADSHAPE object to use for daily simulations. More... | |
Load & | daily_obj (dss::obj::LoadShape &value) |
string | duty () |
LOADSHAPE object to use for duty cycle simulations. More... | |
Load & | duty (const string &value) |
Load & | duty (dss::obj::LoadShape &value) |
dss::obj::LoadShape | duty_obj () |
LOADSHAPE object to use for duty cycle simulations. More... | |
Load & | duty_obj (dss::obj::LoadShape &value) |
string | growth () |
Characteristic to use for growth factors by years. More... | |
Load & | growth (const string &value) |
Load & | growth (dss::obj::GrowthShape &value) |
dss::obj::GrowthShape | growth_obj () |
Characteristic to use for growth factors by years. More... | |
Load & | growth_obj (dss::obj::GrowthShape &value) |
Connection | conn () |
={wye or LN | delta or LL}. More... | |
Load & | conn (int32_t value) |
Load & | conn (Connection value) |
Load & | conn (const string &value) |
Load & | conn (const char *value) |
string | conn_str () |
={wye or LN | delta or LL}. More... | |
Load & | conn_str (const string &value) |
={wye or LN | delta or LL}. More... | |
double | kvar () |
Specify the base kvar for specifying load as kW & kvar. More... | |
Load & | kvar (double value) |
double | Rneut () |
Default is -1. More... | |
Load & | Rneut (double value) |
double | Xneut () |
Neutral reactance of wye(star)-connected load in actual ohms. More... | |
Load & | Xneut (double value) |
LoadStatus | status () |
={Variable | Fixed | Exempt}. More... | |
Load & | status (int32_t value) |
Load & | status (LoadStatus value) |
Load & | status (const string &value) |
Load & | status (const char *value) |
string | status_str () |
={Variable | Fixed | Exempt}. More... | |
Load & | status_str (const string &value) |
={Variable | Fixed | Exempt}. More... | |
int32_t | cls () |
An arbitrary integer number representing the class of load so that load values may be segregated by load value. More... | |
Load & | cls (int32_t value) |
double | Vminpu () |
Default = 0.95. More... | |
Load & | Vminpu (double value) |
double | Vmaxpu () |
Default = 1.05. More... | |
Load & | Vmaxpu (double value) |
double | Vminnorm () |
Minimum per unit voltage for load EEN evaluations, Normal limit. More... | |
Load & | Vminnorm (double value) |
double | Vminemerg () |
Minimum per unit voltage for load UE evaluations, Emergency limit. More... | |
Load & | Vminemerg (double value) |
double | xfkVA () |
Default = 0.0. More... | |
Load & | xfkVA (double value) |
double | allocationfactor () |
Default = 0.5. More... | |
Load & | allocationfactor (double value) |
double | kVA () |
Specify base Load in kVA (and power factor) More... | |
Load & | kVA (double value) |
double | pctmean () |
Percent mean value for load to use for monte carlo studies if no loadshape is assigned to this load. More... | |
Load & | pctmean (double value) |
double | pctstddev () |
Percent Std deviation value for load to use for monte carlo studies if no loadshape is assigned to this load. More... | |
Load & | pctstddev (double value) |
double | CVRwatts () |
Percent reduction in active power (watts) per 1% reduction in voltage from 100% rated. More... | |
Load & | CVRwatts (double value) |
double | CVRvars () |
Percent reduction in reactive power (vars) per 1% reduction in voltage from 100% rated. More... | |
Load & | CVRvars (double value) |
double | kwh () |
kWh billed for this period. More... | |
Load & | kwh (double value) |
double | kwhdays () |
Length of kWh billing period in days (24 hr days). More... | |
Load & | kwhdays (double value) |
double | Cfactor () |
Factor relating average kW to peak kW. More... | |
Load & | Cfactor (double value) |
string | CVRcurve () |
Default is NONE. More... | |
Load & | CVRcurve (const string &value) |
Load & | CVRcurve (dss::obj::LoadShape &value) |
dss::obj::LoadShape | CVRcurve_obj () |
Default is NONE. More... | |
Load & | CVRcurve_obj (dss::obj::LoadShape &value) |
int32_t | NumCust () |
Number of customers, this load. More... | |
Load & | NumCust (int32_t value) |
VectorXd | ZIPV () |
Array of 7 coefficients: More... | |
Load & | ZIPV (VectorXd &value) |
double | pctSeriesRL () |
Percent of load that is series R-L for Harmonic studies. More... | |
Load & | pctSeriesRL (double value) |
double | RelWeight () |
Relative weighting factor for reliability calcs. More... | |
Load & | RelWeight (double value) |
double | Vlowpu () |
Default = 0.50. More... | |
Load & | Vlowpu (double value) |
double | puXharm () |
Special reactance, pu (based on kVA, kV properties), for the series impedance branch in the load model for HARMONICS analysis. More... | |
Load & | puXharm (double value) |
double | XRharm () |
X/R ratio of the special harmonics mode reactance specified by the puXHARM property at fundamental frequency. More... | |
Load & | XRharm (double value) |
string | spectrum () |
Name of harmonic current spectrum for this load. More... | |
Load & | spectrum (const string &value) |
Load & | spectrum (dss::obj::Spectrum &value) |
dss::obj::Spectrum | spectrum_obj () |
Name of harmonic current spectrum for this load. More... | |
Load & | spectrum_obj (dss::obj::Spectrum &value) |
double | basefreq () |
Base Frequency for ratings. More... | |
Load & | basefreq (double value) |
bool | enabled () |
{Yes|No or True|False} Indicates whether this element is enabled. More... | |
Load & | enabled (bool value) |
Load & | like (const string &value) |
Make like another object, e.g. More... | |
Load & | 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 [] = "Load" |
static const int32_t | dss_cls_idx = 19 |
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 |
|
strong |
|
inline |
Default = 0.5.
Allocation factor for allocating loads based on connected kVA at a bus. Side effect: kW, PF, and kvar are modified by multiplying this factor times the XFKVA (if > 0).
DSS property name: allocationfactor, DSS property index: 22
|
inline |
Base Frequency for ratings.
DSS property name: basefreq, DSS property index: 40
|
inline |
Marks an object for edition.
Until end_edit
is called, some actions are postponed.
|
inline |
Bus to which the load is connected.
May include specific node specification.
DSS property name: bus1, DSS property index: 2
|
inline |
Factor relating average kW to peak kW.
Default is 4.0. See kWh and kWhdays. See kVA.
DSS property name: Cfactor, DSS property index: 30
|
inline |
An arbitrary integer number representing the class of load so that load values may be segregated by load value.
Default is 1; not used internally.
DSS property name: class, DSS property index: 16
|
inline |
={wye or LN | delta or LL}.
Default is wye.
DSS property name: conn, DSS property index: 11
|
inline |
={wye or LN | delta or LL}.
Default is wye.
DSS property name: conn, DSS property index: 11
|
inline |
={wye or LN | delta or LL}.
Default is wye.
DSS property name: conn, DSS property index: 11
|
inline |
Default is NONE.
Curve describing both watt and var factors as a function of time. Refers to a LoadShape object with both Mult and Qmult defined. Define a Loadshape to agree with yearly or daily curve according to the type of analysis being done. If NONE, the CVRwatts and CVRvars factors are used and assumed constant.
DSS property name: CVRcurve, DSS property index: 31
|
inline |
Default is NONE.
Curve describing both watt and var factors as a function of time. Refers to a LoadShape object with both Mult and Qmult defined. Define a Loadshape to agree with yearly or daily curve according to the type of analysis being done. If NONE, the CVRwatts and CVRvars factors are used and assumed constant.
DSS property name: CVRcurve, DSS property index: 31
|
inline |
Percent reduction in reactive power (vars) per 1% reduction in voltage from 100% rated.
Default=2. Typical values range from 2 to 3. Applies to Model=4 only. Intended to represent conservation voltage reduction or voltage optimization measures.
DSS property name: CVRvars, DSS property index: 27
|
inline |
Percent reduction in active power (watts) per 1% reduction in voltage from 100% rated.
Default=1. Typical values range from 0.4 to 0.8. Applies to Model=4 only. Intended to represent conservation voltage reduction or voltage optimization measures.
DSS property name: CVRwatts, DSS property index: 26
|
inline |
LOADSHAPE object to use for daily simulations.
Must be previously defined as a Loadshape object of 24 hrs, typically. Set Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. Default is no variation (constant) if not defined. Side effect: Sets Yearly load shape if not already defined.
DSS property name: daily, DSS property index: 8
|
inline |
LOADSHAPE object to use for daily simulations.
Must be previously defined as a Loadshape object of 24 hrs, typically. Set Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. Default is no variation (constant) if not defined. Side effect: Sets Yearly load shape if not already defined.
DSS property name: daily, DSS property index: 8
|
inline |
LOADSHAPE object to use for duty cycle simulations.
Must be previously defined as a Loadshape object. Typically would have time intervals less than 1 hr. Designate the number of points to solve using the Set Number=xxxx command. If there are fewer points in the actual shape, the shape is assumed to repeat.Set to NONE to reset to no loadahape. Set Status=Fixed to ignore Loadshape designation. Defaults to Daily curve If not specified.
DSS property name: duty, DSS property index: 9
|
inline |
LOADSHAPE object to use for duty cycle simulations.
Must be previously defined as a Loadshape object. Typically would have time intervals less than 1 hr. Designate the number of points to solve using the Set Number=xxxx command. If there are fewer points in the actual shape, the shape is assumed to repeat.Set to NONE to reset to no loadahape. Set Status=Fixed to ignore Loadshape designation. Defaults to Daily curve If not specified.
DSS property name: duty, DSS property index: 9
|
inline |
{Yes|No or True|False} Indicates whether this element is enabled.
DSS property name: enabled, DSS property index: 41
|
inline |
Finalizes an object edition.
This will result more compelx side-effects like Yprim and other internal data recalculation, for example.
|
inline |
Characteristic to use for growth factors by years.
Must be previously defined as a Growthshape object. Defaults to circuit default growth factor (see Set Growth command).
DSS property name: growth, DSS property index: 10
|
inline |
Characteristic to use for growth factors by years.
Must be previously defined as a Growthshape object. Defaults to circuit default growth factor (see Set Growth command).
DSS property name: growth, DSS property index: 10
|
inline |
Nominal rated (1.0 per unit) voltage, kV, for load.
For 2- and 3-phase loads, specify phase-phase kV. Otherwise, specify actual kV across each branch of the load. If wye (star), specify phase-neutral kV. If delta or phase-phase connected, specify phase-phase kV.
DSS property name: kV, DSS property index: 3
|
inline |
Specify base Load in kVA (and power factor)
Legal ways to define base load: kW, PF kW, kvar kVA, PF XFKVA * Allocationfactor, PF kWh/(kWhdays*24) * Cfactor, PF
DSS property name: kVA, DSS property index: 23
|
inline |
Specify the base kvar for specifying load as kW & kvar.
Assumes kW has been already defined. Alternative to specifying the power factor. Side effect: the power factor and kVA is altered to agree.
DSS property name: kvar, DSS property index: 12
|
inline |
Total base kW for the load.
Normally, you would enter the maximum kW for the load for the first year and allow it to be adjusted by the load shapes, growth shapes, and global load multiplier.
Legal ways to define base load: kW, PF kW, kvar kVA, PF XFKVA * Allocationfactor, PF kWh/(kWhdays*24) * Cfactor, PF
DSS property name: kW, DSS property index: 4
|
inline |
kWh billed for this period.
Default is 0. See help on kVA and Cfactor and kWhDays.
DSS property name: kwh, DSS property index: 28
|
inline |
Length of kWh billing period in days (24 hr days).
Default is 30. Average demand is computed using this value.
DSS property name: kwhdays, DSS property index: 29
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 42
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 42
|
inline |
Integer code for the model to use for load variation with voltage.
Valid values are:
1:Standard constant P+jQ load. (Default) 2:Constant impedance load. 3:Const P, Quadratic Q (like a motor). 4:Nominal Linear P, Quadratic Q (feeder mix). Use this with CVRfactor. 5:Constant Current Magnitude 6:Const P, Fixed Q 7:Const P, Fixed Impedance Q 8:ZIPV (7 values)
For Types 6 and 7, only the P is modified by load multipliers.
DSS property name: model, DSS property index: 6
|
inline |
Number of customers, this load.
Default is 1.
DSS property name: NumCust, DSS property index: 32
|
inline |
Percent mean value for load to use for monte carlo studies if no loadshape is assigned to this load.
Default is 50.
DSS property name: mean, DSS property index: 24
|
inline |
Percent of load that is series R-L for Harmonic studies.
Default is 50. Remainder is assumed to be parallel R and L. This can have a significant impact on the amount of damping observed in Harmonics solutions.
DSS property name: SeriesRL, DSS property index: 34
|
inline |
Percent Std deviation value for load to use for monte carlo studies if no loadshape is assigned to this load.
Default is 10.
DSS property name: stddev, DSS property index: 25
|
inline |
Load power factor.
Enter negative for leading powerfactor (when kW and kvar have opposite signs.)
DSS property name: pf, DSS property index: 5
|
inline |
Number of Phases, this load.
Load is evenly divided among phases.
DSS property name: phases, DSS property index: 1
|
inline |
Special reactance, pu (based on kVA, kV properties), for the series impedance branch in the load model for HARMONICS analysis.
Generally used to represent motor load blocked rotor reactance. If not specified (that is, set =0, the default value), the series branch is computed from the percentage of the nominal load at fundamental frequency specified by the SERIESRL property.
Applies to load model in HARMONICS mode only.
A typical value would be approximately 0.20 pu based on kVA * SeriesRL / 100.0.
DSS property name: puXharm, DSS property index: 37
|
inline |
Relative weighting factor for reliability calcs.
Default = 1. Used to designate high priority loads such as hospitals, etc.
Is multiplied by number of customers and load kW during reliability calcs.
DSS property name: RelWeight, DSS property index: 35
|
inline |
Default is -1.
Neutral resistance of wye (star)-connected load in actual ohms. If entered as a negative value, the neutral can be open, or floating, or it can be connected to node 0 (ground), which is the usual default. If >=0 be sure to explicitly specify the node connection for the neutral, or last, conductor. Otherwise, the neutral impedance will be shorted to ground.
DSS property name: Rneut, DSS property index: 13
|
inline |
Name of harmonic current spectrum for this load.
Default is "defaultload", which is defined when the DSS starts.
DSS property name: spectrum, DSS property index: 39
|
inline |
Name of harmonic current spectrum for this load.
Default is "defaultload", which is defined when the DSS starts.
DSS property name: spectrum, DSS property index: 39
|
inline |
={Variable | Fixed | Exempt}.
Default is variable. If Fixed, no load multipliers apply; however, growth multipliers do apply. All multipliers apply to Variable loads. Exempt loads are not modified by the global load multiplier, such as in load duration curves, etc. Daily multipliers do apply, so setting this property to Exempt is a good way to represent industrial load that stays the same day-after-day for the period study.
DSS property name: status, DSS property index: 15
|
inline |
={Variable | Fixed | Exempt}.
Default is variable. If Fixed, no load multipliers apply; however, growth multipliers do apply. All multipliers apply to Variable loads. Exempt loads are not modified by the global load multiplier, such as in load duration curves, etc. Daily multipliers do apply, so setting this property to Exempt is a good way to represent industrial load that stays the same day-after-day for the period study.
DSS property name: status, DSS property index: 15
|
inline |
={Variable | Fixed | Exempt}.
Default is variable. If Fixed, no load multipliers apply; however, growth multipliers do apply. All multipliers apply to Variable loads. Exempt loads are not modified by the global load multiplier, such as in load duration curves, etc. Daily multipliers do apply, so setting this property to Exempt is a good way to represent industrial load that stays the same day-after-day for the period study.
DSS property name: status, DSS property index: 15
|
inline |
Default = 0.50.
Per unit voltage at which the model switches to same as constant Z model (model=2). This allows more consistent convergence at very low voltaes due to opening switches or solving for fault situations.
DSS property name: Vlowpu, DSS property index: 36
|
inline |
Default = 1.05.
Maximum per unit voltage for which the MODEL is assumed to apply. Above this value, the load model reverts to a constant impedance model.
DSS property name: Vmaxpu, DSS property index: 18
|
inline |
Minimum per unit voltage for load UE evaluations, Emergency limit.
Default = 0, which defaults to system "vminemerg" property (see Set Command under Executive). If this property is specified, it ALWAYS overrides the system specification. This allows you to have different criteria for different loads. Set to zero to revert to the default system value.
DSS property name: Vminemerg, DSS property index: 20
|
inline |
Minimum per unit voltage for load EEN evaluations, Normal limit.
Default = 0, which defaults to system "vminnorm" property (see Set Command under Executive). If this property is specified, it ALWAYS overrides the system specification. This allows you to have different criteria for different loads. Set to zero to revert to the default system value.
DSS property name: Vminnorm, DSS property index: 19
|
inline |
Default = 0.95.
Minimum per unit voltage for which the MODEL is assumed to apply. Lower end of normal voltage range.Below this value, the load model reverts to a constant impedance model that matches the model at the transition voltage. See also "Vlowpu" which causes the model to match Model=2 below the transition voltage.
DSS property name: Vminpu, DSS property index: 17
|
inline |
Default = 0.0.
Rated kVA of service transformer for allocating loads based on connected kVA at a bus. Side effect: kW, PF, and kvar are modified. See help on kVA.
DSS property name: xfkVA, DSS property index: 21
|
inline |
Neutral reactance of wye(star)-connected load in actual ohms.
May be + or -.
DSS property name: Xneut, DSS property index: 14
|
inline |
X/R ratio of the special harmonics mode reactance specified by the puXHARM property at fundamental frequency.
Default is 6.
DSS property name: XRharm, DSS property index: 38
|
inline |
LOADSHAPE object to use for yearly simulations.
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 Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. The default is no variation.
DSS property name: yearly, DSS property index: 7
|
inline |
LOADSHAPE object to use for yearly simulations.
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 Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. The default is no variation.
DSS property name: yearly, DSS property index: 7
|
inline |
Array of 7 coefficients:
First 3 are ZIP weighting factors for real power (should sum to 1) Next 3 are ZIP weighting factors for reactive power (should sum to 1) Last 1 is cut-off voltage in p.u. of base kV; load is 0 below this cut-off No defaults; all coefficients must be specified if using model=8.
DSS property name: ZIPV, DSS property index: 33