Utilities

Note

This section of the documentation is auto-generated from the code of the Julia-based core model. Refer to IESopt.jl for any further details (which may require some familiarity with Julia).

If you spot incorrect math-mode rendering, or similar issues, please file an issue, since rendering documentation from Julia to Python is not the easiest task.

Overview

This module contains utility functions for the IESopt package, that can be helpful in preparing or analysing components.

API Reference

Types

Macros

Functions

annuity

annuity(total::Real; lifetime::Real, rate::Float64, fraction::Float64)

Calculate the annuity of a total amount over a lifetime with a given interest rate.

Arguments

  • total::Real: The total amount to be annuitized.

Keyword Arguments

  • lifetime::Real: The lifetime over which the total amount is to be annuitized.

  • rate::Float64: The interest rate at which the total amount is to be annuitized.

  • fraction::Float64: The fraction of a year that the annuity is to be calculated for (default: 1.0).

Returns

Float64: The annuity of the total amount over the lifetime with the given interest rate.

Example

Calculating a simple annuity, for a total amount of € 1000,- over a lifetime of 10 years with an interest rate of 5%:

# Set a parameter inside a template.
set("capex", IESU.annuity(1000.0; lifetime=10, rate=0.05))

Calculating a simple annuity, for a total amount of € 1000,- over a lifetime of 10 years with an interest rate of 5%, for a fraction of a year (given by MODEL.yearspan, which is the total timespan of the model in years):

# Set a parameter inside a template.
set("capex", IESU.annuity(1000.0; lifetime=10, rate=0.05, fraction=MODEL.yearspan))

timespan

timespan(model::JuMP.Model)::Float64

Calculate the total timespan (duration, time period, …) of a model in hours.

Arguments

  • model::JuMP.Model: The model for which the timespan is to be calculated.

Returns

Float64: The total timespan of the model in hours.


yearspan

yearspan(model::JuMP.Model)::Float64

Calculate the total timespan (duration, time period, …) of a model in years. This assumes that a full year has a total of 8760 hours.

Arguments

  • model::JuMP.Model: The model for which the timespan is to be calculated.

Returns

Float64: The total timespan of the model in years.