2023-06-13 11:03:49 +00:00
|
|
|
using InnovEnergy.Lib.Units.Power;
|
|
|
|
|
2023-02-26 09:38:28 +00:00
|
|
|
namespace InnovEnergy.Lib.Units.Composite;
|
|
|
|
|
|
|
|
|
2023-06-13 11:03:49 +00:00
|
|
|
public sealed class AcPhase
|
2023-02-26 09:38:28 +00:00
|
|
|
{
|
2023-06-13 11:03:49 +00:00
|
|
|
private AcPhase(){}
|
2023-05-24 10:04:01 +00:00
|
|
|
|
2023-06-27 11:14:17 +00:00
|
|
|
public required Voltage Voltage { get; init; }
|
|
|
|
public required Current Current { get; init; }
|
|
|
|
public required AcPower Power { get; init; }
|
2023-05-04 07:36:30 +00:00
|
|
|
|
|
|
|
public static AcPhase FromVoltageCurrentPhi(Voltage voltageRms,
|
|
|
|
Current currentRms,
|
|
|
|
Angle phi) => new()
|
|
|
|
{
|
|
|
|
Current = currentRms,
|
|
|
|
Voltage = voltageRms,
|
|
|
|
Power = AcPower.FromVoltageCurrentPhi(voltageRms, currentRms, phi)
|
|
|
|
};
|
|
|
|
|
|
|
|
public static AcPhase FromVoltageCurrentActiveReactive(Voltage voltageRms,
|
|
|
|
Current currentRms,
|
|
|
|
ActivePower activePower,
|
|
|
|
ReactivePower reactivePower) => new()
|
|
|
|
{
|
|
|
|
Current = currentRms,
|
|
|
|
Voltage = voltageRms,
|
|
|
|
Power = AcPower.FromActiveReactive(activePower, reactivePower)
|
|
|
|
};
|
|
|
|
|
|
|
|
public static AcPhase FromVoltageCurrentActiveReactiveApparent(Voltage voltageRms,
|
|
|
|
Current currentRms,
|
|
|
|
ActivePower activePower,
|
|
|
|
ReactivePower reactivePower,
|
|
|
|
ApparentPower apparentPower) => new()
|
|
|
|
{
|
|
|
|
Current = currentRms,
|
|
|
|
Voltage = voltageRms,
|
|
|
|
Power = AcPower.FromActiveReactiveApparent(activePower, reactivePower, apparentPower)
|
|
|
|
};
|
2023-06-13 11:03:49 +00:00
|
|
|
|
2023-06-22 08:13:21 +00:00
|
|
|
public static AcPhase Null => FromVoltageCurrentPhi(0, 0, 0);
|
2023-06-20 08:13:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-26 09:38:28 +00:00
|
|
|
}
|