Skip to content

Commit 30015ad

Browse files
committed
Prepare DSS_MATLAB version 0.10.5
- Sync docstrings with DSS C-API and DSS Python 0.10.5 - Update dss_capi_v7_no_thunk.m to add the 4 new functions from v0.10.5 - Expose the new functions
1 parent 805c37e commit 30015ad

24 files changed

+222
-99
lines changed

+DSS_MATLAB/IActiveClass.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
% Name - Name of the Active Element of the Active Class
1010
% Next - Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.
1111
% NumElements - Number of elements in this class. Same as Count property.
12+
% ActiveClassParent - Get the name of the parent class of the active class
1213

1314
properties (Access = protected)
1415
apiutil
@@ -22,6 +23,7 @@
2223
Name
2324
Next
2425
NumElements
26+
ActiveClassParent
2527
end
2628

2729
methods (Access = public)
@@ -70,5 +72,10 @@
7072
% (read-only) Number of elements in this class. Same as Count property.
7173
result = calllib('dss_capi_v7', 'ActiveClass_Get_NumElements');
7274
end
75+
76+
function result = get.ActiveClassParent(obj)
77+
% Get the name of the parent class of the active class
78+
result = calllib('dss_capi_v7', 'ActiveClass_Get_ActiveClassParent');
79+
end
7380
end
7481
end

+DSS_MATLAB/IBus.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
% SeqVoltages - Double Array of sequence voltages at this bus.
2020
% TotalMiles - Total length of line downline from this bus, in miles. For recloser siting algorithm.
2121
% VLL - For 2- and 3-phase buses, returns array of complex numbers represetin L-L voltages in volts. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only first 3.
22-
% VMagAngle - Variant Array of doubles containing voltages in Magnitude (VLN), angle (deg)
22+
% VMagAngle - Array of doubles containing voltages in Magnitude (VLN), angle (deg)
2323
% Voc - Open circuit voltage; Complex array.
2424
% Voltages - Complex array of voltages at this bus.
2525
% YscMatrix - Complex array of Ysc matrix at bus. Column by column.
@@ -181,7 +181,7 @@
181181
end
182182

183183
function result = get.VMagAngle(obj)
184-
% (read-only) Variant Array of doubles containing voltages in Magnitude (VLN), angle (deg)
184+
% (read-only) Array of doubles containing voltages in Magnitude (VLN), angle (deg)
185185
calllib('dss_capi_v7', 'Bus_Get_VMagAngle_GR');
186186
result = obj.apiutil.get_float64_gr_array();
187187
end

+DSS_MATLAB/ICircuit.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,11 @@
416416
end
417417

418418
function result = get.SystemY(obj)
419-
% (read-only) System Y matrix (after a solution has been performed)
420-
result = DSS_MATLAB.get_float64_array('Circuit_Get_SystemY');
419+
% (read-only) System Y matrix (after a solution has been performed).
420+
% This is deprecated as it returns a dense matrix. Only use it for small systems.
421+
% For large scale systems, prefer YMatrix.GetCompressedYMatrix.
422+
calllib('dss_capi_v7', 'Circuit_Get_SystemY_GR');
423+
result = obj.apiutil.get_float64_gr_array();
421424
end
422425

423426
function result = get.TotalPower(obj)

+DSS_MATLAB/ICktElement.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
% Voltages - Complex array of voltages at terminals
4040
% VoltagesMagAng - Voltages at each conductor in magnitude, angle form as array of doubles.
4141
% Yprim - YPrim matrix, column order, complex numbers (paired)
42+
% IsIsolated - Returns true if the current active element is isolated. Note that this only fetches the current value. See also the Topology interface.
4243
%
4344
% Methods:
4445
% Close -
@@ -92,6 +93,7 @@
9293
Voltages
9394
VoltagesMagAng
9495
Yprim
96+
IsIsolated
9597
end
9698

9799
methods (Access = public)
@@ -273,6 +275,7 @@
273275
function result = get.NodeOrder(obj)
274276
% (read-only) Array of integer containing the node numbers (representing phases, for example) for each conductor of each terminal.
275277
calllib('dss_capi_v7', 'CktElement_Get_NodeOrder_GR');
278+
obj.CheckForError();
276279
result = obj.apiutil.get_int32_gr_array();
277280
end
278281

@@ -373,5 +376,11 @@
373376
calllib('dss_capi_v7', 'CktElement_Get_Yprim_GR');
374377
result = obj.apiutil.get_float64_gr_array();
375378
end
379+
380+
function result = get.IsIsolated(obj)
381+
% Returns true if the current active element is isolated.
382+
% Note that this only fetches the current value. See also the Topology interface.
383+
result = (calllib('dss_capi_v7', 'CktElement_Get_IsIsolated') ~= 0);
384+
end
376385
end
377386
end

+DSS_MATLAB/IDSS.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@
168168
function result = get.AllowEditor(obj)
169169
% Gets/sets whether running the external editor for "Show" is allowed
170170
%
171-
% AllowEditor controls whether the external editor is used in commands like "Show".
172-
% If you set to 0 (false), the editor is not executed. Note that other side effects,
173-
% such as the creation of files, are not affected.
171+
% AllowEditor controls whether the external editor is used in commands like "Show".
172+
% If you set to 0 (false), the editor is not executed. Note that other side effects,
173+
% such as the creation of files, are not affected.
174174
result = (calllib('dss_capi_v7', 'DSS_Get_AllowEditor') ~= 0);
175175
end
176176
function obj = set.AllowEditor(obj, value)

+DSS_MATLAB/IFuses.m

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
% Name - Get/sets the name of the current active Fuse
99
% Next - Sets next Fuse active; returns 0 if no more.
1010
% idx - Sets next Fuse active; returns 0 if no more.
11-
% Delay - (read) A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0. (write) Fixed delay time in seconds added to the fuse blowing time to represent fuse clear or other delay.
11+
% Delay - A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0. This represents a fuse clear or other delay.
1212
% MonitoredObj - Full name of the circuit element to which the fuse is connected.
13-
% MonitoredTerm - (read) Terminal number to which the fuse is connected. (write) Number of the terminal to which the fuse is connected
13+
% MonitoredTerm - Terminal number to which the fuse is connected.
1414
% NumPhases - Number of phases, this fuse.
15-
% RatedCurrent - (read) Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multipliy current values of TCC curve by this to get actual amps. (write) Multiplier or actual fuse amps for the TCC curve. Defaults to 1.0. Has to correspond to the Current axis of TCCcurve object.
16-
% SwitchedObj - (read) Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj. (write) Full name of the circuit element switch that the fuse controls. Defaults to MonitoredObj.
17-
% SwitchedTerm - (read) Number of the terminal containing the switch controlled by the fuse. (write) Number of the terminal of the controlled element containing the switch controlled by the fuse.
15+
% RatedCurrent - Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multiply current values of TCC curve by this to get actual amps.
16+
% SwitchedObj - Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj.
17+
% SwitchedTerm - Number of the terminal of the controlled element containing the switch controlled by the fuse.
1818
% TCCcurve - Name of the TCCcurve object that determines fuse blowing.
1919
%
2020
% Methods:
@@ -103,8 +103,8 @@
103103

104104

105105
function result = get.Delay(obj)
106-
% (read) A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0.
107-
% (write) Fixed delay time in seconds added to the fuse blowing time to represent fuse clear or other delay.
106+
% A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0.
107+
% This represents a fuse clear or other delay.
108108
result = calllib('dss_capi_v7', 'Fuses_Get_Delay');
109109
end
110110
function obj = set.Delay(obj, Value)
@@ -122,8 +122,7 @@
122122
end
123123

124124
function result = get.MonitoredTerm(obj)
125-
% (read) Terminal number to which the fuse is connected.
126-
% (write) Number of the terminal to which the fuse is connected
125+
% Terminal number to which the fuse is connected.
127126
result = calllib('dss_capi_v7', 'Fuses_Get_MonitoredTerm');
128127
end
129128
function obj = set.MonitoredTerm(obj, Value)
@@ -137,8 +136,8 @@
137136
end
138137

139138
function result = get.RatedCurrent(obj)
140-
% (read) Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multipliy current values of TCC curve by this to get actual amps.
141-
% (write) Multiplier or actual fuse amps for the TCC curve. Defaults to 1.0. Has to correspond to the Current axis of TCCcurve object.
139+
% Multiplier or actual amps for the TCCcurve object. Defaults to 1.0.
140+
% Multiply current values of TCC curve by this to get actual amps.
142141
result = calllib('dss_capi_v7', 'Fuses_Get_RatedCurrent');
143142
end
144143
function obj = set.RatedCurrent(obj, Value)
@@ -147,8 +146,8 @@
147146
end
148147

149148
function result = get.SwitchedObj(obj)
150-
% (read) Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj.
151-
% (write) Full name of the circuit element switch that the fuse controls. Defaults to MonitoredObj.
149+
% Full name of the circuit element switch that the fuse controls.
150+
% Defaults to the MonitoredObj.
152151
result = calllib('dss_capi_v7', 'Fuses_Get_SwitchedObj');
153152
end
154153
function obj = set.SwitchedObj(obj, Value)
@@ -157,8 +156,7 @@
157156
end
158157

159158
function result = get.SwitchedTerm(obj)
160-
% (read) Number of the terminal containing the switch controlled by the fuse.
161-
% (write) Number of the terminal of the controlled element containing the switch controlled by the fuse.
159+
% Number of the terminal of the controlled element containing the switch controlled by the fuse.
162160
result = calllib('dss_capi_v7', 'Fuses_Get_SwitchedTerm');
163161
end
164162
function obj = set.SwitchedTerm(obj, Value)

+DSS_MATLAB/ILineGeometries.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
% idx - Sets next LineGeometrie active; returns 0 if no more.
1111
% Conductors - Array of strings with names of all conductors in the active LineGeometry object
1212
% EmergAmps - Emergency ampere rating
13-
% NormAmps - Normal Ampere rating
13+
% NormAmps - Normal ampere rating
1414
% RhoEarth -
1515
% Reduce -
1616
% Phases - Number of Phases
@@ -132,7 +132,7 @@
132132
end
133133

134134
function result = get.NormAmps(obj)
135-
% Normal Ampere rating
135+
% Normal ampere rating
136136
result = calllib('dss_capi_v7', 'LineGeometries_Get_NormAmps');
137137
end
138138
function obj = set.NormAmps(obj, Value)

+DSS_MATLAB/ILines.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
% Xmatrix -
3636
% Yprim - Yprimitive: Does Nothing at present on Put; Dangerous
3737
% SeasonRating - Delivers the rating for the current season (in Amps) if the "SeasonalRatings" option is active
38+
% IsSwitch - Sets/gets the Line element switch status. Setting it has side-effects to the line parameters.
3839
%
3940
% Methods:
4041
% New -
@@ -77,6 +78,7 @@
7778
Xmatrix
7879
Yprim
7980
SeasonRating
81+
IsSwitch
8082
end
8183

8284
methods (Access = public)
@@ -357,5 +359,13 @@
357359
% Delivers the rating for the current season (in Amps) if the "SeasonalRatings" option is active
358360
result = calllib('dss_capi_v7', 'Lines_Get_SeasonRating');
359361
end
362+
363+
function result = get.IsSwitch(obj)
364+
% Sets/gets the Line element switch status. Setting it has side-effects to the line parameters.
365+
result = (calllib('dss_capi_v7', 'Lines_Get_IsSwitch') ~= 0);
366+
end
367+
function obj = set.IsSwitch(obj, Value)
368+
calllib('dss_capi_v7', 'Lines_Set_IsSwitch', Value);
369+
end
360370
end
361371
end

+DSS_MATLAB/ILoadShapes.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
% idx - Sets next LoadShape active; returns 0 if no more.
1111
% HrInterval - Fixed interval time value, hours.
1212
% MinInterval - Fixed Interval time value, in minutes
13-
% Npts - (read) Get Number of points in active Loadshape. (write) Set number of points to allocate for active Loadshape.
13+
% Npts - Get/set Number of points in active Loadshape.
1414
% PBase -
1515
% Pmult - Array of doubles for the P multiplier in the Loadshape.
1616
% QBase - Base for normalizing Q curve. If left at zero, the peak value is used.
1717
% Qmult - Array of doubles containing the Q multipliers.
1818
% TimeArray - Time array in hours correscponding to P and Q multipliers when the Interval=0.
19-
% UseActual - T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
19+
% UseActual - Boolean flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
2020
% sInterval -
2121
%
2222
% Methods:
@@ -120,8 +120,7 @@
120120
end
121121

122122
function result = get.Npts(obj)
123-
% (read) Get Number of points in active Loadshape.
124-
% (write) Set number of points to allocate for active Loadshape.
123+
% Get/set Number of points in active Loadshape.
125124
result = calllib('dss_capi_v7', 'LoadShapes_Get_Npts');
126125
end
127126
function obj = set.Npts(obj, Value)
@@ -177,7 +176,7 @@
177176
end
178177

179178
function result = get.UseActual(obj)
180-
% T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
179+
% Boolean flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
181180
result = (calllib('dss_capi_v7', 'LoadShapes_Get_UseActual') ~= 0);
182181
end
183182
function obj = set.UseActual(obj, Value)

+DSS_MATLAB/ILoads.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
% CVRcurve - Name of a loadshape with both Mult and Qmult, for CVR factors as a function of time.
1313
% CVRvars - Percent reduction in Q for percent reduction in V. Must be used with dssLoadModelCVR.
1414
% CVRwatts - Percent reduction in P for percent reduction in V. Must be used with dssLoadModelCVR.
15-
% Cfactor - Factor relates average to peak kw. Used for allocation with kwh and kwhdays/
15+
% Cfactor - Factor relates average to peak kw. Used for allocation with kwh and kwhdays
1616
% Class -
1717
% Growth - Name of the growthshape curve for yearly load growth factors.
1818
% IsDelta - Delta loads are connected line-to-line.
@@ -31,13 +31,13 @@
3131
% Vminpu - Minimum voltage to apply the load model. Below this, constant Z is used.
3232
% Xneut - Neutral reactance for wye-connected loads.
3333
% Yearly - Name of yearly duration loadshape
34-
% ZIPV - Array of 7 doubles with values for ZIPV property of the LOAD object
34+
% ZIPV - Array of 7 doubles with values for ZIPV property of the load object
3535
% daily - Name of the loadshape for a daily load profile.
3636
% duty - Name of the loadshape for a duty cycle simulation.
3737
% kV - Set kV rating for active Load. For 2 or more phases set Line-Line kV. Else actual kV across terminals.
3838
% kW - Set kW for active Load. Updates kvar based on present PF.
3939
% kva - Base load kva. Also defined kw and kvar or pf input, or load allocation by kwh or xfkva.
40-
% kvar - Set kvar for active Load. Updates PF based on present kW.
40+
% kvar - Get/set kvar for active Load. If set, updates PF based on present kW.
4141
% kwh - kwh billed for this period. Can be used with Cfactor for load allocation.
4242
% kwhdays - Length of kwh billing period for average demand calculation. Default 30.
4343
% pctSeriesRL - Percent of Load that is modeled as series R-L for harmonics studies
@@ -175,7 +175,7 @@
175175
end
176176

177177
function result = get.Cfactor(obj)
178-
% Factor relates average to peak kw. Used for allocation with kwh and kwhdays/
178+
% Factor relates average to peak kw. Used for allocation with kwh and kwhdays
179179
result = calllib('dss_capi_v7', 'Loads_Get_Cfactor');
180180
end
181181
function obj = set.Cfactor(obj, Value)
@@ -345,7 +345,7 @@
345345
end
346346

347347
function result = get.ZIPV(obj)
348-
% Array of 7 doubles with values for ZIPV property of the LOAD object
348+
% Array of 7 doubles with values for ZIPV property of the load object
349349
calllib('dss_capi_v7', 'Loads_Get_ZIPV_GR');
350350
result = obj.apiutil.get_float64_gr_array();
351351
end
@@ -400,7 +400,7 @@
400400
end
401401

402402
function result = get.kvar(obj)
403-
% Set kvar for active Load. Updates PF based on present kW.
403+
% Get/set kvar for active Load. If set, updates PF based on present kW.
404404
result = calllib('dss_capi_v7', 'Loads_Get_kvar');
405405
end
406406
function obj = set.kvar(obj, Value)

+DSS_MATLAB/IPDElements.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
% FaultRate - Get/Set Number of failures per year. For LINE elements: Number of failures per unit length per year.
88
% First - Set the first enabled PD element to be the active element. Returns 0 if none found.
99
% FromTerminal - Number of the terminal of active PD element that is on the "from" side. This is set after the meter zone is determined.
10-
% IsShunt - Variant boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.
10+
% IsShunt - Boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.
1111
% Lambda - Failure rate for this branch. Faults per year including length of line.
1212
% Name - Get/Set name of active PD Element. Returns null string if active element is not PDElement type.
1313
% Next - Advance to the next PD element in the circuit. Enabled elements only. Returns 0 when no more elements.
@@ -80,7 +80,7 @@
8080
end
8181

8282
function result = get.IsShunt(obj)
83-
% (read-only) Variant boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.
83+
% (read-only) Boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.
8484
result = (calllib('dss_capi_v7', 'PDElements_Get_IsShunt') ~= 0);
8585
end
8686

0 commit comments

Comments
 (0)