{ "cells": [ { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] } ], "source": [ "from pyrecoy.assets import HotWaterStorage, HeatBuffer\\\n", "\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "HotWaterStorage(name=HWS, max_power=10, min_power=-10, roundtrip_eff=1, capacity_per_volume=0.05, volume = 1000),lifetime=25, temperature = 368, min_storagelevel = 5)" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws = HotWaterStorage(\n", " name='HWS',\n", " max_power=10,\n", " min_power=-10,\n", " roundtrip_eff=1,\n", " capacity_per_volume = 50 * 1e-3,\n", " volume = 1000,\n", " lifetime = 25,\n", " temperature = 368, #K\n", " min_storagelevel = 5,\n", ")\n", "\n", "hws" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [], "source": [ "hws.storagelevel\n", "hws.set_freq('15T')" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7.5" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws.charge(10)\n", "hws.storagelevel" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "32.5" ] }, "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws.charge(100)\n", "hws.storagelevel" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "47.5" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws.charge(100)\n", "hws.storagelevel" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "22.5" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws.discharge(100)\n", "hws.storagelevel" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hws.discharge(100)\n", "hws.storagelevel" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [], "source": [ "hb = HeatBuffer(\n", " name='HB',\n", " rated_power=10, \n", " capacity_per_volume = 50 * 1e-3,\n", " volume=1000, \n", " temperature=368,\n", " min_storagelevel = 5,\n", ")" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "50.0" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.capacity" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.min_chargelevel" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "47.5" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.max_chargelevel" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Battery(self, rated_power=10, rated_capacity=50.0, roundtrip_eff=1, min_soc=0.1, max_soc=0.95)" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.set_freq('15T')\n", "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7.5" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.charge(10)\n", "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-10.0" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.charge(100)" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-10.0" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.charge(100)" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "12.5" ] }, "execution_count": 84, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 85, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.discharge(100)" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 87, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 87, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.discharge(100)" ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7.5" ] }, "execution_count": 88, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 89, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.discharge(5)" ] }, { "cell_type": "code", "execution_count": 90, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6.25" ] }, "execution_count": 90, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": 91, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 91, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.discharge(10)" ] }, { "cell_type": "code", "execution_count": 92, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0" ] }, "execution_count": 92, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hb.chargelevel" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def set_financials(\n", " self,\n", " capex_per_MW,\n", " capex_per_MWh,\n", " opex,\n", " devex,\n", " lifetime=None,\n", " depreciate=True,\n", " salvage_value=0,\n", "):\n", " total_capex = (\n", " capex_per_MW * self.max_power + capex_per_MWh * self.max_storage_capacity\n", " )\n", " super().set_financials(\n", " total_capex, opex, devex, lifetime=None, depreciate=True, salvage_value=0\n", " )\n", "\n", "def __repr__(self):\n", " return (\n", " f\"{self.__class__.__name__}(name={self.name}, max_power={self.max_power}, \"\n", " f\"min_power={self.min_power}, roundtrip_eff={self.roundtrip_eff}, capacity_per_volume={self.capacity_per_volume}, volume = {self.volume}),\"\n", " f\"lifetime={self.lifetime}, temperature = {self.temperature}, min_storagelevel = {self.min_storagelevel})\"\n", " )" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:py39]", "language": "python", "name": "conda-env-py39-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }