repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: more stricter type checking in condition
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
ElectricUtils.ts
diff --git
a/src/utils/ElectricUtils.ts
b/src/utils/ElectricUtils.ts
index b779bf1dffa1d83470ae19ed3754e167b3b1b149..b0f8dff412ba6984f5443155339d40f0b4ec5691 100644
(file)
--- 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
/**
* Rationale: https://wiki.piment-noir.org/doku.php/en:cs:modelling_multi-phased_electrical_system_interconnexion
@@
-12,8
+12,8
@@
export class ACElectricUtils {
// This is intentional
}
// This is intentional
}
- static
amperageTotal(nbOfPhases: number, Iph: number
): number {
- return nbOfPhases *
Iph
;
+ 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 {
}
static powerPerPhase(V: number, Iph: number, cosPhi = 1): number {
@@
-24,8
+24,8
@@
export class ACElectricUtils {
return Math.round(powerPerPhase);
}
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 {
}
static amperageTotalFromPower(P: number, V: number, cosPhi = 1): number {