forked from jappel/leistungsbilanz-ts
first commit
This commit is contained in:
commit
c3e98af5b6
36 changed files with 4779 additions and 0 deletions
29
src/domain/calculations/power-calculation.ts
Normal file
29
src/domain/calculations/power-calculation.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
export interface PowerInput {
|
||||
quantity: number;
|
||||
installedPowerPerUnitKw: number;
|
||||
demandFactor: number;
|
||||
}
|
||||
|
||||
export interface CurrentInput {
|
||||
demandPowerKw: number;
|
||||
voltageV: number;
|
||||
phaseCount: 1 | 3;
|
||||
powerFactor: number;
|
||||
}
|
||||
|
||||
export function calculateInstalledPowerKw(input: PowerInput): number {
|
||||
return input.quantity * input.installedPowerPerUnitKw;
|
||||
}
|
||||
|
||||
export function calculateDemandPowerKw(input: PowerInput): number {
|
||||
return calculateInstalledPowerKw(input) * input.demandFactor;
|
||||
}
|
||||
|
||||
export function calculateCurrentA(input: CurrentInput): number {
|
||||
const powerW = input.demandPowerKw * 1000;
|
||||
if (input.phaseCount === 1) {
|
||||
return powerW / (input.voltageV * input.powerFactor);
|
||||
}
|
||||
return powerW / (Math.sqrt(3) * input.voltageV * input.powerFactor);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue