Component List for various utilities

Calculator

Component to perform calculations with the variables of other components.

Parameters

Variables

The component will generate a variable for each of the input variables specified in "input_variables" and "output_variables" using the mathematical expressions for the calculation in each time step. The expressions are evaluated at the start of each time step, so that other components can use the outputs during it, and again at its end, with the final values of the time step: the outputs stored can use the variables that other components compute during the time step, such as the loads of a space or the power of a system.

Example:


...

calc = osm.new_component("Calculator","unit_change")
param = {
    "input_variables": ["T = met.temperature", "w = met.abs_humidity"],
    "output_variables": ["T_F","W_kg"],
    "output_units": ["ºF","kg/kg a.s."],
    "output_expressions": ["T * 9/5 + 32", "w / 1000"]
}
calc.set_parameters(param)

Four variables will be created with names: T, w, T_F and W_kg, two from input_variables and two from output_variables.