64D3E3ZOPPF3UFDFYWGBCKS5NTBR34J27FGESDZSSYMUEPD5ZMLQC
WFOI5DN6JBBPNX7T3RCENHAHMHSZMO6MNCSNH7276AYS2REGK23QC
6NB2PU2F64XDSURKYMBECKEN7ZQ63RMDN2GL5CP74YA6HE4K3TTAC
7MCTB5G2W6IB7JQXGO2HCMRHBUYIOKXI4MBODKLAJIK66EMLC5ZQC
LU257USNNJW57H5M5E46IB2E3IBFNYBXB6EPEM63BYC23NNVHCFQC
PI6D6Y5EHSXHSILBYHKRKXWXZ6H6JOR5ZTP44CXBW4LUUIREY7OQC
LX2ZVNAYX2FRCEIJ6XBCBILB3O7YT52AP56QDWCCGLATFCEB7KHQC
632SZPUQC6KX3CDZLYWV22OSFIOG66CJ7PONRNTXYTFLQX3JFFXQC
export function coutElecAuto(p: Grain.SimulationCommunaute, N: number) {
let cout = 0
for (let i = 0; i < N; i++) {
cout +=
(tarifLocal(p, i) * consoMoyenneFoyer(p, i) * p.autoprod) / 100 +
(p.coutElec *
Math.pow(1 + p.inflationElec / 100, i) *
consoMoyenneFoyer(p, i) *
(100 - p.autoprod)) /
100
}
return cout
}
export function tarifLocal(p: Grain.SimulationCommunaute, i: number) {
return p.prix * Math.pow(1 + p.inflation / 100, i)
}
export function productionAnnuelle(p: Grain.SimulationCommunaute, i: number) {
return p.productible * p.puissance * Math.pow(1 - p.degradation / 100, i)
}
export function consoMoyenneFoyer(p: Grain.SimulationCommunaute, i: number) {
return Math.min(p.consoMoyenneFoyer, productionAnnuelle(p, i) / p.autoprod)
}
import type { Grain } from './grain-types'
export { Grain } from './grain-types'
export function coutElec(p: Grain.SimulationCommunaute, N: number) {
let cout = 0
for (let i = 0; i < N; i++) {
cout +=
p.coutElec *
Math.pow(1 + p.inflationElec / 100, i) *
consoMoyenneFoyer(p, i)
}
return cout
}
export function coutElecAuto(p: Grain.SimulationCommunaute, N: number) {
let cout = 0
for (let i = 0; i < N; i++) {
cout +=
(tarifLocal(p, i) * consoMoyenneFoyer(p, i) * p.autoprod) / 100 +
(p.coutElec *
Math.pow(1 + p.inflationElec / 100, i) *
consoMoyenneFoyer(p, i) *
(100 - p.autoprod)) /
100
}
return cout
}
export function tarifLocal(p: Grain.SimulationCommunaute, i: number) {
return p.prix * Math.pow(1 + p.inflation / 100, i)
}
export function productionAnnuelle(p: Grain.SimulationCommunaute, i: number) {
return p.productible * p.puissance * Math.pow(1 - p.degradation / 100, i)
}
export function consoMoyenneFoyer(p: Grain.SimulationCommunaute, i: number) {
return Math.min(p.consoMoyenneFoyer, productionAnnuelle(p, i) / p.autoprod)
}