Skip to content

Commit

Permalink
Prepare DSS_MATLAB version 0.10.5
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
PMeira committed Mar 14, 2020
1 parent 805c37e commit 30015ad
Show file tree
Hide file tree
Showing 24 changed files with 222 additions and 99 deletions.
7 changes: 7 additions & 0 deletions +DSS_MATLAB/IActiveClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
% Name - Name of the Active Element of the Active Class
% 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.
% NumElements - Number of elements in this class. Same as Count property.
% ActiveClassParent - Get the name of the parent class of the active class

properties (Access = protected)
apiutil
Expand All @@ -22,6 +23,7 @@
Name
Next
NumElements
ActiveClassParent
end

methods (Access = public)
Expand Down Expand Up @@ -70,5 +72,10 @@
% (read-only) Number of elements in this class. Same as Count property.
result = calllib('dss_capi_v7', 'ActiveClass_Get_NumElements');
end

function result = get.ActiveClassParent(obj)
% Get the name of the parent class of the active class
result = calllib('dss_capi_v7', 'ActiveClass_Get_ActiveClassParent');
end
end
end
4 changes: 2 additions & 2 deletions +DSS_MATLAB/IBus.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
% SeqVoltages - Double Array of sequence voltages at this bus.
% TotalMiles - Total length of line downline from this bus, in miles. For recloser siting algorithm.
% 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.
% VMagAngle - Variant Array of doubles containing voltages in Magnitude (VLN), angle (deg)
% VMagAngle - Array of doubles containing voltages in Magnitude (VLN), angle (deg)
% Voc - Open circuit voltage; Complex array.
% Voltages - Complex array of voltages at this bus.
% YscMatrix - Complex array of Ysc matrix at bus. Column by column.
Expand Down Expand Up @@ -181,7 +181,7 @@
end

function result = get.VMagAngle(obj)
% (read-only) Variant Array of doubles containing voltages in Magnitude (VLN), angle (deg)
% (read-only) Array of doubles containing voltages in Magnitude (VLN), angle (deg)
calllib('dss_capi_v7', 'Bus_Get_VMagAngle_GR');
result = obj.apiutil.get_float64_gr_array();
end
Expand Down
7 changes: 5 additions & 2 deletions +DSS_MATLAB/ICircuit.m
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,11 @@
end

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

function result = get.TotalPower(obj)
Expand Down
9 changes: 9 additions & 0 deletions +DSS_MATLAB/ICktElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
% Voltages - Complex array of voltages at terminals
% VoltagesMagAng - Voltages at each conductor in magnitude, angle form as array of doubles.
% Yprim - YPrim matrix, column order, complex numbers (paired)
% IsIsolated - Returns true if the current active element is isolated. Note that this only fetches the current value. See also the Topology interface.
%
% Methods:
% Close -
Expand Down Expand Up @@ -92,6 +93,7 @@
Voltages
VoltagesMagAng
Yprim
IsIsolated
end

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

Expand Down Expand Up @@ -373,5 +376,11 @@
calllib('dss_capi_v7', 'CktElement_Get_Yprim_GR');
result = obj.apiutil.get_float64_gr_array();
end

function result = get.IsIsolated(obj)
% Returns true if the current active element is isolated.
% Note that this only fetches the current value. See also the Topology interface.
result = (calllib('dss_capi_v7', 'CktElement_Get_IsIsolated') ~= 0);
end
end
end
6 changes: 3 additions & 3 deletions +DSS_MATLAB/IDSS.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
function result = get.AllowEditor(obj)
% Gets/sets whether running the external editor for "Show" is allowed
%
% AllowEditor controls whether the external editor is used in commands like "Show".
% If you set to 0 (false), the editor is not executed. Note that other side effects,
% such as the creation of files, are not affected.
% AllowEditor controls whether the external editor is used in commands like "Show".
% If you set to 0 (false), the editor is not executed. Note that other side effects,
% such as the creation of files, are not affected.
result = (calllib('dss_capi_v7', 'DSS_Get_AllowEditor') ~= 0);
end
function obj = set.AllowEditor(obj, value)
Expand Down
28 changes: 13 additions & 15 deletions +DSS_MATLAB/IFuses.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
% Name - Get/sets the name of the current active Fuse
% Next - Sets next Fuse active; returns 0 if no more.
% idx - Sets next Fuse active; returns 0 if no more.
% 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.
% 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.
% MonitoredObj - Full name of the circuit element to which the fuse is connected.
% MonitoredTerm - (read) Terminal number to which the fuse is connected. (write) Number of the terminal to which the fuse is connected
% MonitoredTerm - Terminal number to which the fuse is connected.
% NumPhases - Number of phases, this fuse.
% 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.
% 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.
% 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.
% 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.
% SwitchedObj - Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj.
% SwitchedTerm - Number of the terminal of the controlled element containing the switch controlled by the fuse.
% TCCcurve - Name of the TCCcurve object that determines fuse blowing.
%
% Methods:
Expand Down Expand Up @@ -103,8 +103,8 @@


function result = get.Delay(obj)
% (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.
% 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.
result = calllib('dss_capi_v7', 'Fuses_Get_Delay');
end
function obj = set.Delay(obj, Value)
Expand All @@ -122,8 +122,7 @@
end

function result = get.MonitoredTerm(obj)
% (read) Terminal number to which the fuse is connected.
% (write) Number of the terminal to which the fuse is connected
% Terminal number to which the fuse is connected.
result = calllib('dss_capi_v7', 'Fuses_Get_MonitoredTerm');
end
function obj = set.MonitoredTerm(obj, Value)
Expand All @@ -137,8 +136,8 @@
end

function result = get.RatedCurrent(obj)
% (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.
% Multiplier or actual amps for the TCCcurve object. Defaults to 1.0.
% Multiply current values of TCC curve by this to get actual amps.
result = calllib('dss_capi_v7', 'Fuses_Get_RatedCurrent');
end
function obj = set.RatedCurrent(obj, Value)
Expand All @@ -147,8 +146,8 @@
end

function result = get.SwitchedObj(obj)
% (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.
% Full name of the circuit element switch that the fuse controls.
% Defaults to the MonitoredObj.
result = calllib('dss_capi_v7', 'Fuses_Get_SwitchedObj');
end
function obj = set.SwitchedObj(obj, Value)
Expand All @@ -157,8 +156,7 @@
end

function result = get.SwitchedTerm(obj)
% (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.
% Number of the terminal of the controlled element containing the switch controlled by the fuse.
result = calllib('dss_capi_v7', 'Fuses_Get_SwitchedTerm');
end
function obj = set.SwitchedTerm(obj, Value)
Expand Down
4 changes: 2 additions & 2 deletions +DSS_MATLAB/ILineGeometries.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% idx - Sets next LineGeometrie active; returns 0 if no more.
% Conductors - Array of strings with names of all conductors in the active LineGeometry object
% EmergAmps - Emergency ampere rating
% NormAmps - Normal Ampere rating
% NormAmps - Normal ampere rating
% RhoEarth -
% Reduce -
% Phases - Number of Phases
Expand Down Expand Up @@ -132,7 +132,7 @@
end

function result = get.NormAmps(obj)
% Normal Ampere rating
% Normal ampere rating
result = calllib('dss_capi_v7', 'LineGeometries_Get_NormAmps');
end
function obj = set.NormAmps(obj, Value)
Expand Down
10 changes: 10 additions & 0 deletions +DSS_MATLAB/ILines.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
% Xmatrix -
% Yprim - Yprimitive: Does Nothing at present on Put; Dangerous
% SeasonRating - Delivers the rating for the current season (in Amps) if the "SeasonalRatings" option is active
% IsSwitch - Sets/gets the Line element switch status. Setting it has side-effects to the line parameters.
%
% Methods:
% New -
Expand Down Expand Up @@ -77,6 +78,7 @@
Xmatrix
Yprim
SeasonRating
IsSwitch
end

methods (Access = public)
Expand Down Expand Up @@ -357,5 +359,13 @@
% Delivers the rating for the current season (in Amps) if the "SeasonalRatings" option is active
result = calllib('dss_capi_v7', 'Lines_Get_SeasonRating');
end

function result = get.IsSwitch(obj)
% Sets/gets the Line element switch status. Setting it has side-effects to the line parameters.
result = (calllib('dss_capi_v7', 'Lines_Get_IsSwitch') ~= 0);
end
function obj = set.IsSwitch(obj, Value)
calllib('dss_capi_v7', 'Lines_Set_IsSwitch', Value);
end
end
end
9 changes: 4 additions & 5 deletions +DSS_MATLAB/ILoadShapes.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
% idx - Sets next LoadShape active; returns 0 if no more.
% HrInterval - Fixed interval time value, hours.
% MinInterval - Fixed Interval time value, in minutes
% Npts - (read) Get Number of points in active Loadshape. (write) Set number of points to allocate for active Loadshape.
% Npts - Get/set Number of points in active Loadshape.
% PBase -
% Pmult - Array of doubles for the P multiplier in the Loadshape.
% QBase - Base for normalizing Q curve. If left at zero, the peak value is used.
% Qmult - Array of doubles containing the Q multipliers.
% TimeArray - Time array in hours correscponding to P and Q multipliers when the Interval=0.
% UseActual - T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
% UseActual - Boolean flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
% sInterval -
%
% Methods:
Expand Down Expand Up @@ -120,8 +120,7 @@
end

function result = get.Npts(obj)
% (read) Get Number of points in active Loadshape.
% (write) Set number of points to allocate for active Loadshape.
% Get/set Number of points in active Loadshape.
result = calllib('dss_capi_v7', 'LoadShapes_Get_Npts');
end
function obj = set.Npts(obj, Value)
Expand Down Expand Up @@ -177,7 +176,7 @@
end

function result = get.UseActual(obj)
% T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
% Boolean flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.
result = (calllib('dss_capi_v7', 'LoadShapes_Get_UseActual') ~= 0);
end
function obj = set.UseActual(obj, Value)
Expand Down
12 changes: 6 additions & 6 deletions +DSS_MATLAB/ILoads.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% CVRcurve - Name of a loadshape with both Mult and Qmult, for CVR factors as a function of time.
% CVRvars - Percent reduction in Q for percent reduction in V. Must be used with dssLoadModelCVR.
% CVRwatts - Percent reduction in P for percent reduction in V. Must be used with dssLoadModelCVR.
% Cfactor - Factor relates average to peak kw. Used for allocation with kwh and kwhdays/
% Cfactor - Factor relates average to peak kw. Used for allocation with kwh and kwhdays
% Class -
% Growth - Name of the growthshape curve for yearly load growth factors.
% IsDelta - Delta loads are connected line-to-line.
Expand All @@ -31,13 +31,13 @@
% Vminpu - Minimum voltage to apply the load model. Below this, constant Z is used.
% Xneut - Neutral reactance for wye-connected loads.
% Yearly - Name of yearly duration loadshape
% ZIPV - Array of 7 doubles with values for ZIPV property of the LOAD object
% ZIPV - Array of 7 doubles with values for ZIPV property of the load object
% daily - Name of the loadshape for a daily load profile.
% duty - Name of the loadshape for a duty cycle simulation.
% kV - Set kV rating for active Load. For 2 or more phases set Line-Line kV. Else actual kV across terminals.
% kW - Set kW for active Load. Updates kvar based on present PF.
% kva - Base load kva. Also defined kw and kvar or pf input, or load allocation by kwh or xfkva.
% kvar - Set kvar for active Load. Updates PF based on present kW.
% kvar - Get/set kvar for active Load. If set, updates PF based on present kW.
% kwh - kwh billed for this period. Can be used with Cfactor for load allocation.
% kwhdays - Length of kwh billing period for average demand calculation. Default 30.
% pctSeriesRL - Percent of Load that is modeled as series R-L for harmonics studies
Expand Down Expand Up @@ -175,7 +175,7 @@
end

function result = get.Cfactor(obj)
% Factor relates average to peak kw. Used for allocation with kwh and kwhdays/
% Factor relates average to peak kw. Used for allocation with kwh and kwhdays
result = calllib('dss_capi_v7', 'Loads_Get_Cfactor');
end
function obj = set.Cfactor(obj, Value)
Expand Down Expand Up @@ -345,7 +345,7 @@
end

function result = get.ZIPV(obj)
% Array of 7 doubles with values for ZIPV property of the LOAD object
% Array of 7 doubles with values for ZIPV property of the load object
calllib('dss_capi_v7', 'Loads_Get_ZIPV_GR');
result = obj.apiutil.get_float64_gr_array();
end
Expand Down Expand Up @@ -400,7 +400,7 @@
end

function result = get.kvar(obj)
% Set kvar for active Load. Updates PF based on present kW.
% Get/set kvar for active Load. If set, updates PF based on present kW.
result = calllib('dss_capi_v7', 'Loads_Get_kvar');
end
function obj = set.kvar(obj, Value)
Expand Down
4 changes: 2 additions & 2 deletions +DSS_MATLAB/IPDElements.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% FaultRate - Get/Set Number of failures per year. For LINE elements: Number of failures per unit length per year.
% First - Set the first enabled PD element to be the active element. Returns 0 if none found.
% FromTerminal - Number of the terminal of active PD element that is on the "from" side. This is set after the meter zone is determined.
% 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.
% 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.
% Lambda - Failure rate for this branch. Faults per year including length of line.
% Name - Get/Set name of active PD Element. Returns null string if active element is not PDElement type.
% Next - Advance to the next PD element in the circuit. Enabled elements only. Returns 0 when no more elements.
Expand Down Expand Up @@ -80,7 +80,7 @@
end

function result = get.IsShunt(obj)
% (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.
% (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.
result = (calllib('dss_capi_v7', 'PDElements_Get_IsShunt') ~= 0);
end

Expand Down
Loading

0 comments on commit 30015ad

Please sign in to comment.