Spectrum
(read/write)
This property sets/gets the name of harmonic current spectrum shape (to be used for Harmonic-Harmonic-T simulations). Must be previously defined. Default is "defaultload", which is defined when the DSS starts.
Example
% Create DSS object
DSSObject = actxserver('OpenDSSEngine.DSS')
if ~DSSObject.Start(0),
disp('Unable to start openDSS');
return
end;
DSSText = DSSObject.Text;
DSSCircuit = DSSObject.ActiveCircuit;
% Compile a model
DSSText.Command = 'Compile C:\myPath\myModel.dss';
DSSLoads = DSSCircuit.Loads;
% activates the first load on the list
i = DSSLoads.First;
% gets the spectrum name for the active load
myOldSpec = DSSLoads.Spectrum;
% Defines a new spectrum
DSSText.Command = 'New "Spectrum.Spectrum_1" NumHarm=8 CSVFile=Spectrum_Load_1.csv' ;
% activates the first load on the list (again)
i = DSSLoads.First;
% Assigns the new spectrum to the active load
DSSLoads.Spectrum = 'Spectrum_1';