+// Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
+
/**
* Rationale: https://wiki.piment-noir.org/doku.php/en:cs:modelling_multi-phased_electrical_system_interconnexion
*/
* 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 {
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 {
* Targeted to DC related values calculation.
*/
export class DCElectricUtils {
+ private constructor() {
+ // This is intentional
+ }
+
static power(V: number, I: number): number {
return V * I;
}