Yprim
(read only)
This property returns the primitive Y bus matrix for the active line.
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';
DSSLines = DSSCircuit.Lines;
% Sets the first line of the list as the active element
if DSSLines.First > 0,
% Gets the Y prim matrix (vector)
myYPrim = DSSLines.YPrim;
% Formats the vector as a complex matrix (dense)
mySize = size(myYPrim);
myYPMat = []
for a = 1:2:mySize(2),
CNum = myYPrim(a) + i* myYPrim(a + 1);
myYPMat = [myYPMat;CNum];
end;
myMatSize = mySize(2)/2/(DSSLines.Phases * 2);
myYPMat = reshape(myYPMat,myMatSize,myMatSize);
else
disp('It seems that you have no lines!');
end;