Beispiel #1
0
 /// <summary>
 /// Once a load is broken up between multiple models, this returns the command for initializing loads for each model
 /// </summary>
 /// <param name="newLoad"></param>
 /// <param name="pmult"></param>
 /// <param name="qmult"></param>
 /// <param name="loadnum"></param>
 /// <returns></returns>
 private string subLoadToDSS(EnergyConsumer newLoad, float pmult, float qmult, int loadnum)
 {
     Dictionary<PhaseShuntConnectionKind, string> conn = new Dictionary<PhaseShuntConnectionKind, string>();
     conn.Add(PhaseShuntConnectionKind.D, "Delta");
     conn.Add(PhaseShuntConnectionKind.Y, "Wye");
     StringBuilder dssLoad = new StringBuilder("New Load");
     dssLoad.AppendFormat(".{0}", newLoad.Name);
     dssLoad.Append(ToDSSBusFormat(newLoad.Terminal1));
     dssLoad.AppendFormat(" model={0}", loadnum.ToString());
     dssLoad.AppendFormat(" conn={0} ", conn[newLoad.PhaseConnection]);
     dssLoad.AppendFormat(" kW={0} kVar={1}", (newLoad.Pfixed * pmult).ToString(), (newLoad.Qfixed * qmult).ToString());
     return dssLoad.ToString();
 }
Beispiel #2
0
 /// <summary>
 /// Generates an OpenDSS definition for a load
 /// </summary>
 /// <param name="newLoad"></param>
 /// <returns></returns>
 private IEnumerable<string> LoadToDSS(EnergyConsumer newLoad)
 {
     var comms = new List<string>();
     if (newLoad.LoadResponse.PConstantPower != 0 || newLoad.LoadResponse.QConstantPower != 0)
     {
         comms.Add(subLoadToDSS(newLoad,newLoad.LoadResponse.PConstantPower,newLoad.LoadResponse.QConstantPower, 1)); 
     }
     if (newLoad.LoadResponse.PConstantImpedance != 0 || newLoad.LoadResponse.QConstantImpedance != 0)
     {
         comms.Add(subLoadToDSS(newLoad,newLoad.LoadResponse.PConstantImpedance,newLoad.LoadResponse.QConstantImpedance,2));
     }
     if (newLoad.LoadResponse.PConstantCurrent != 0  || newLoad.LoadResponse.QConstantCurrent != 0)
     {
         comms.Add(subLoadToDSS(newLoad, newLoad.LoadResponse.PConstantCurrent,newLoad.LoadResponse.QConstantCurrent,5));
     }
     return comms;
 }