Esempio n. 1
0
 /// <summary>
 /// Returns the percentage reactance between the two coils
 /// </summary>
 /// <param name="highEnd"></param>
 /// <param name="lowEnd"></param>
 /// <returns></returns>
 public float Xpercentage(PowerTransformer.TransformerEnd highEnd, PowerTransformer.TransformerEnd lowEnd)
 {
     if (highEnd.BaseKV < lowEnd.BaseKV)
     {throw new ArgumentOutOfRangeException("lowEnd","lowEnd should have a lower BaseKV than highEnd");}
     return (float)
         ((BaseKVA * (highEnd.X + lowEnd.X)) / (highEnd.BaseKV - lowEnd.BaseKV));
 }
Esempio n. 2
0
        private string transformerToDSS(PowerTransformer tran)
        {
            StringBuilder dssTran = new StringBuilder("New Transformer");
            dssTran.AppendFormat(".{0}  ", tran.Name);
            int endCount = 0;
            int phaseCount = 0;
            var windingDefs = new StringBuilder();
            PowerTransformer.TransformerEnd highest = null;
            PowerTransformer.TransformerEnd lowest = null;
            foreach (PowerTransformer.TransformerEnd end in tran.Ends)
            {
                endCount++;
                if(highest == null || highest.BaseKV < end.BaseKV)
                {
                    highest = end;
                }
                if(lowest == null || lowest.BaseKV > end.BaseKV)
                {
                    lowest = end;
                }
                phaseCount = Math.Max(phaseCount,end.Terminal1.Phases.NumPhases());
                windingDefs.AppendFormat
                    (
                    " wdg={0} bus={1}   ",
                    endCount.ToString(),
                    end.Terminal1.ConnectionPointName
                    );
                windingDefs.AppendFormat
                    (
                    "conn={0} kv={1}  ",
                    end.ConnectionType.ToString(),
                    end.BaseKV.ToString()
                    );
            }
            dssTran.AppendFormat
                (
                "Windings={0} Phases={1} ",
                endCount.ToString(),
                phaseCount
                );
            dssTran.AppendFormat
                (
                " Xhl={0} kVA={1}",
                tran.Xpercentage(highest, lowest).ToString(),
                tran.BaseKVA.ToString()
                );
            return dssTran.Append(windingDefs.ToString()).ToString();


        }
Esempio n. 3
0
            protected override void constructAndConnect(Dictionary<string, DataTable> typesToBuild)
            {
                var terms = new Dictionary<string, Terminal>();
                lineObject = modelObject as Line;
                if (typesToBuild["PowerTransformer"] != null)
                {
                    foreach (DataRow row in typesToBuild["PowerTransformer"].Rows)
                    {
                        var tranName = (string)row["Name"];
                        lineObject[tranName] = new PowerTransformer(row);
                    }
                    foreach (DataRow row in typesToBuild["PowerTransformerEnd"].Rows)
                    {
                        var endName = (string)row["Name"];
                        var parent = (PowerTransformer)lineObject[(string)row["PowerTransformer"]];
                        var end = new PowerTransformer.TransformerEnd(row, parent);
                        lineObject[endName] = end;
                        parent.Ends.Add(end);

                    }
                }
                foreach (DataRow row in typesToBuild["Switch"].Rows)
                {
                    var switchName = (string)row["Name"];
                    lineObject[switchName] = ConductingEquipment.newConductingEquipment(row);
                }
                foreach (DataRow row in typesToBuild["ACLineSegment"].Rows)
                {
                    var linesegName = (string)row["Name"];
                    lineObject[linesegName] = ConductingEquipment.newConductingEquipment(row);
                }
                foreach (DataRow row in typesToBuild["EnergyConsumer"].Rows)
                {
                    var loadName = (string)row["Name"];
                    lineObject[loadName] = ConductingEquipment.newConductingEquipment(row);
                }
                foreach (DataRow row in typesToBuild["Terminal"].Rows)
                {
                    var termName = (string)row["Name"];
                    var parentName = (string)row["ParentEquipment"];
                    terms.Add(termName,new Terminal(row,(ConductingEquipment)lineObject[parentName],lineObject.serviceArea));
                }

                //instantiate and connect conducting equipment classes
                makeBranches(terms);
                makeShunts(terms);
                makeStaticTopology(lineObject);
            }
Esempio n. 4
0
            public TransformerEnd(DataRow data, PowerTransformer parent)
                : base(data)
            {
                parentTransformer = parent;
                BaseKV = (float)(double)data["BaseKV"];
                r = (float)(double)data["R"];
                
                x = (float)(double)data["X"];
                g = (float)(double)data["G"];
                r0 = (float)(double)data["R0"];
                
                g0 = (float)(double)data["G0"];
                x0 = (float)(double)data["X0"];
                ConnectionType = (PhaseShuntConnectionKind)Enum.Parse
                (
                typeof(PhaseShuntConnectionKind),
                (string)data["phaseConnection"],
                true
                );
                
                equipmentType = EquipmentTopoTypes.Shunt;

            }