Innovenergy_trunk/csharp/Lib/Units/Composite/Ac3Phase.cs

22 lines
950 B
C#
Raw Normal View History

using InnovEnergy.Lib.Utils;
2023-02-26 14:39:55 +00:00
using static DecimalMath.DecimalEx;
namespace InnovEnergy.Lib.Units.Composite;
public record Ac3Phase
{
public required AcPhase L1 { get; init; }
public required AcPhase L2 { get; init; }
public required AcPhase L3 { get; init; }
public required Frequency Frequency { get; init; }
2023-02-26 14:39:55 +00:00
public ApparentPower ApparentPower => L1.ApparentPower + L2.ApparentPower + L3.ApparentPower;
public ReactivePower ReactivePower => L1.ReactivePower + L2.ReactivePower + L3.ReactivePower;
public Power ActivePower => L1.ActivePower + L2.ActivePower + L3.ActivePower;
public Angle Phi => ATan2(ReactivePower, ActivePower);
2023-02-26 14:39:55 +00:00
public static Ac3Phase operator |(Ac3Phase left, Ac3Phase right) => OpParallel(left, right);
private static readonly Func<Ac3Phase, Ac3Phase, Ac3Phase> OpParallel = "|".CreateBinaryOpForProps<Ac3Phase>();
2023-02-26 18:19:16 +00:00
}