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

23 lines
528 B
C#
Raw Normal View History

2023-09-01 06:54:46 +00:00
using static System.Math;
2023-06-13 11:03:49 +00:00
namespace InnovEnergy.Lib.Units.Composite;
2023-09-01 06:54:46 +00:00
public record AcPhase
{
public required VoltageRms Voltage { get; init; }
public required CurrentRms Current { get; init; }
public required Angle Phi { get; init; }
2023-09-01 06:54:46 +00:00
public AcPower Power => new()
2023-05-04 07:36:30 +00:00
{
2023-09-01 06:54:46 +00:00
Active = Voltage * Current * Cos(Phi),
Reactive = Voltage * Current * Sin(Phi),
2023-05-04 07:36:30 +00:00
};
2023-09-01 06:54:46 +00:00
public static AcPhase Zero => new AcPhase
2023-05-04 07:36:30 +00:00
{
2023-09-01 06:54:46 +00:00
Current = 0,
Voltage = 0,
Phi = 0,
2023-05-04 07:36:30 +00:00
};
}