X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FElectricUtils.ts;h=b0f8dff412ba6984f5443155339d40f0b4ec5691;hb=66b40cf34ebe01c358b4fd9a77266588b70b2e57;hp=448d11ebb1dc205716f2e3bf3d2bd5c53c852fa0;hpb=c8eeb62b00988601b40e599745329acb67197750;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/ElectricUtils.ts b/src/utils/ElectricUtils.ts index 448d11eb..b0f8dff4 100644 --- a/src/utils/ElectricUtils.ts +++ b/src/utils/ElectricUtils.ts @@ -1,4 +1,4 @@ -// Copyright Jerome Benoit. 2021. All Rights Reserved. +// Copyright Jerome Benoit. 2021-2023. All Rights Reserved. /** * Rationale: https://wiki.piment-noir.org/doku.php/en:cs:modelling_multi-phased_electrical_system_interconnexion @@ -8,8 +8,12 @@ * Targeted to AC related values calculation. */ export class ACElectricUtils { - static amperageTotal(nbOfPhases: number, Iph: number): number { - return nbOfPhases * Iph; + private constructor() { + // This is intentional + } + + static powerTotal(nbOfPhases: number, V: number, Iph: number, cosPhi = 1): number { + return nbOfPhases * ACElectricUtils.powerPerPhase(V, Iph, cosPhi); } static powerPerPhase(V: number, Iph: number, cosPhi = 1): number { @@ -20,8 +24,8 @@ export class ACElectricUtils { return Math.round(powerPerPhase); } - static powerTotal(nbOfPhases: number, V: number, Iph: number, cosPhi = 1): number { - return nbOfPhases * ACElectricUtils.powerPerPhase(V, Iph, cosPhi); + static amperageTotal(nbOfPhases: number, Iph: number): number { + return nbOfPhases * Iph; } static amperageTotalFromPower(P: number, V: number, cosPhi = 1): number { @@ -46,6 +50,10 @@ export class ACElectricUtils { * Targeted to DC related values calculation. */ export class DCElectricUtils { + private constructor() { + // This is intentional + } + static power(V: number, I: number): number { return V * I; }