Calculation parameters

Calculation parameters affect the result calculation, e.g CO2 conversion rates, and can be provided as configuration overrides and the calculationParameters parameter. All override parameters are optional, hence you only need to provide the explicit parameters you want to change.

We highly encourage to utilize the offered TypeScript types to make configuration easy and safe.

import EconansGreenHousing from "@econans/green-housing"

EconansGreenHousing.mount("#widget", {
    calculationsParameters: {
        maxImprovementBreakEvenYear: 25,
    }
})

Example of calculations parameters overrides being passed to the widget

CO2Conversions

CO2 conversion rates for energy carriers can be adjusted via calculationsParameters.CO2Conversions which is an object following the structure <carrier>: number.

The following carriers can be adjusted:

  • greenElectricity
  • districtHeating
  • electricity
  • firewood
  • gas
  • oil
  • pellets
  • localPv
EconansGreenHousing.mount("#widget", {
    calculationsParameters: {
        districtHeating: 0.045,
        oil: 0.2675,
    }
})

Example of adjusting CO2 conversion rate for district heating and oil

energyLoan

Energy loan parameters can be adjusted via calculationParameters.energyLoan and are grouped by the residence types apartment, house and multi-resident.

The following can be passed (all parameters are optional):

calculationParameters: {
    energyLoan: ["apartment" | "house" | "multi-resident"]: {
        defaultInterestRate: number;
        loanPeriod: number;
        loanType: "annuityLoan" | "straightAmortization";
        minLoanAmount: number;
        maxLoanAmount: number;
    }
}
EconansGreenHousing.mount("#widget", {
    calculationsParameters: {
        energyLoan: {
            apartment: {
                defaultInterestRate: 0.025,
                minLoanAmount: 250000,
            },
            house: {
                maxLoanAmount: 10000000,
            }
        }
    }
})

Example of passing energy loan parameters for apartment and house

maxImprovementBreakEvenYear

calculationsParameters.maxImprovementBreakEvenYear dictates the timeframe in which a suggested improvement investment, e.g install solar cell panels, must reach break even to be deemed feasible and thereby be presented to a user.

EconansGreenHousing.mount("#widget", {
    calculationsParameters: {
        maxImprovementBreakEvenYear: 25,
    }
})

Example of adjusting maxImprovementBreakEvenYear to 25 years