public Electricity Get(float CurrentA, float Time) { Electricity input = new Electricity(0, 0); for (int i = 0; i < 3; i++) { Electricity e = Input.Get(CurrentA / 2.64f / 3, Time)[i]; input.Voltage += Math.Abs(e.Voltage / 2.64f / 3); //Transformador y puente de diodos input.Current += Math.Abs(e.Current * 2.64f * 3); } input.Voltage = VFilter.Filter(input.Voltage, Time - LastTime); //Condensador input.Voltage = Math.Min(72, input.Voltage); //Zener LastTime = Time; return(input); }
public Convertidor_3000Vcc_380Vca3(Func <Electricity> Input) { Output = (float Time, float Current) => { if (State != PowerSupplyState.PowerOn) { return new Electricity[] { new Electricity(0, 0), new Electricity(0, 0), new Electricity(0, 0) } } ; Time = Time % 0.02f; double Angle = Time * 50 * 2 * Math.PI; Electricity Fase1 = new Electricity((float)Math.Sin(Angle) * 380, Current * (float)Math.Sin(Angle) * 380 / Input().Voltage); Electricity Fase2 = new Electricity((float)Math.Sin(Angle + 2 * Math.PI / 3) * 380, Current * (float)Math.Sin(Angle + 2 * Math.PI / 3) * 380 / Input().Voltage); Electricity Fase3 = new Electricity((float)Math.Sin(Angle + 4 * Math.PI / 3) * 380, Current * (float)Math.Sin(Angle + 4 * Math.PI / 3) * 380 / Input().Voltage); return(new Electricity[] { Fase1, Fase2, Fase3 }); }; this.Input = Input; } }
public void Add(Electricity e, float TimeS) { VoltageV = e.Voltage; ChargeAh = Math.Max(Math.Min(ChargeAh + e.Current * TimeS / 3600, MaxChargeAh), ChargeAh); }