Simple room temperature (ex. 54)
Overview
The relevant section of the top-level YAML looks like this:
components:
# ... other stuff ...
# NOTE: Constructing a simple "degree celsius" storage, ranging from 20 to 23 degrees.
house:
type: Node
carrier: heat_degree_celsius
has_state: true
state_lb: 20
state_ub: 23
heatpump:
type: Unit
inputs: {electricity: grid}
outputs: {heat_degree_celsius: house}
conversion: 1 electricity -> cop@data * <degc_per_kWh> heat_degree_celsius
capacity: 5 in:electricity
# NOTE: Modeling this using `node_from` means it models the passive cooling of the house; negative values in
# `demand@data` therefore relate to passive heating (e.g., during summer times).
passive_change:
type: Profile
carrier: heat_degree_celsius
node_from: house
value: demand@data
This is a simple model of a house with a heat pump that can heat the house. The heat pump has a coefficient of performance (COP) that is pre-calculated based on outside temperature. The house has a temperature that is bounded between 20 and 23 degrees Celsius. The house assively changes temperature based on the passive_change
profile. Using the degc_per_kWh
parameter we translate heat energy output from the heat pump to temperature change in the house.
Running the example
First, import iesopt
.
import iesopt
Then, create a local copy of the IESopt example.
config = iesopt.make_example("54_simple_roomtemperature", "opt")
INFO:iesopt:Data folder for examples already exists; NOT copying ANY contents
INFO:iesopt:Creating example ('54_simple_roomtemperature') at: 'opt/54_simple_roomtemperature.iesopt.yaml'
INFO:iesopt:Set write permissions for example ('opt/54_simple_roomtemperature.iesopt.yaml'), and data folder ('opt/files')
Finally, run the model and observe some results.
model = iesopt.run(config, config={"general.verbosity.core": "error"})
model.results.to_pandas().query(
"component == 'house' and field == 'state' and mode == 'primal'"
)
snapshot | component | fieldtype | field | value | mode | |
---|---|---|---|---|---|---|
169 | t1 | house | var | state | 20.996 | primal |
170 | t2 | house | var | state | 20.396 | primal |
171 | t3 | house | var | state | 21.392 | primal |
172 | t4 | house | var | state | 21.800 | primal |
173 | t5 | house | var | state | 21.200 | primal |
174 | t6 | house | var | state | 20.600 | primal |
175 | t7 | house | var | state | 20.000 | primal |
176 | t8 | house | var | state | 20.000 | primal |
177 | t9 | house | var | state | 20.000 | primal |
178 | t10 | house | var | state | 20.100 | primal |
179 | t11 | house | var | state | 20.000 | primal |
180 | t12 | house | var | state | 21.404 | primal |
181 | t13 | house | var | state | 21.504 | primal |
182 | t14 | house | var | state | 21.504 | primal |
183 | t15 | house | var | state | 23.000 | primal |
184 | t16 | house | var | state | 23.000 | primal |
185 | t17 | house | var | state | 22.700 | primal |
186 | t18 | house | var | state | 22.400 | primal |
187 | t19 | house | var | state | 23.000 | primal |
188 | t20 | house | var | state | 22.400 | primal |
189 | t21 | house | var | state | 21.800 | primal |
190 | t22 | house | var | state | 21.200 | primal |
191 | t23 | house | var | state | 20.600 | primal |
192 | t24 | house | var | state | 20.000 | primal |