private HashSet<TopologicalNode.DynamicTopologicalNode> makeDynamicTopologicalNodes (TopologicalNode.VoltageLevel parentNode, DateTime timeIndex) { var dynaNodes = new HashSet<TopologicalNode.DynamicTopologicalNode>(); foreach(KeyValuePair<string,ConnectivityNode> connNode in parentNode.Nodes.ConnectivityNodes) { if (connNode.Value.DynamicTopoNode == null) { var dynaNode = new TopologicalNode.DynamicTopologicalNode(connNode.Value, parentNode, timeIndex); connNode.Value.DynamicTopoNode = dynaNode; dynaNodes.Add(dynaNode); traverseClosedSwitches(dynaNode, connNode.Value); } if(connNode.Value.DynamicTopoNode.TimeIndex != timeIndex) { if(!parentNode.DynamicNodes.ContainsKey(timeIndex)) { parentNode.DynamicNodes[timeIndex] = new HashSet<TopologicalNode.DynamicTopologicalNode>(); } var dynaNode = new TopologicalNode.DynamicTopologicalNode(connNode.Value,parentNode,timeIndex); connNode.Value.DynamicTopoNode = dynaNode; parentNode.DynamicNodes[timeIndex].Add(dynaNode); traverseClosedSwitches(dynaNode, connNode.Value); dynaNodes.Add(dynaNode); } } return dynaNodes; }
internal TransmissionUnit(Terminal linkPoint, TransmissionUnit powerSource) { I = new Complex[] { 0, 0, 0 }; UpstreamUnit = powerSource; DownstreamUnits = new HashSet<TransmissionUnit>(); powerSource.DownstreamUnits.Add(this); var tryT = linkPoint.ParentEquipment as PowerTransformer.TransformerEnd; var tryLine = linkPoint.ParentEquipment as ACLineSegment; //For now assume that Ends[0] is always the upstream TransformerEnd if (tryT != null) { typeOfBranch = "TransformerEnd"; tbranch = tryT; upstreamTerm = tryT.ParentTransformer.Ends[1].Terminal1; Node = upstreamTerm.ConnectionPoint.DynamicTopoNode; BaseKV = UpstreamUnit.BaseKV * (tryT.ParentTransformer.Ends[1].BaseKV / tryT.ParentTransformer.Ends[0].BaseKV); } if (tryLine != null) { typeOfBranch = "Conductor"; lineBranch = tryLine; BaseKV = UpstreamUnit.BaseKV; if (ReferenceEquals(tryLine.Terminal1, linkPoint)) { Node = tryLine.Terminal2.ConnectionPoint.DynamicTopoNode; upstreamTerm = tryLine.Terminal2; } if (ReferenceEquals(tryLine.Terminal2, linkPoint)) { Node = tryLine.Terminal1.ConnectionPoint.DynamicTopoNode; upstreamTerm = tryLine.Terminal1; } } V = new Complex[]{BaseKV,BaseKV,BaseKV}; }
internal TransmissionUnit(ConnectivityNode sourceBus, float baseKV) { DownstreamUnits = new HashSet<TransmissionUnit>(); Node = sourceBus.DynamicTopoNode; V = new Complex[]{baseKV ,baseKV ,baseKV}; I = new Complex[]{ 0, 0, 0 }; BaseKV = baseKV; }