Skip to content
Snippets Groups Projects
Commit 5ebf7ae2 authored by Jingyu Gong's avatar Jingyu Gong
Browse files

Preparation for the workshop

parent 86f9a709
No related branches found
No related tags found
No related merge requests found
{
"specific_capital_expenditure": 1000,
"service_life": 15,
"factor_effort_maintenance_operation": 0.02,
"input_efficiency": 0.99,
"output_efficiency": 0.99,
"e2p_in": 1,
"e2p_out": 1,
"self_discharging_loss": 0.0
}
\ No newline at end of file
File moved
{
"specific_capital_expenditure": 250,
"service_life": 15,
"factor_effort_maintenance_operation": 0.02,
"efficiency_a": 0.95,
"efficiency_b": 0.95,
"rated_power_side_a": "input",
"rated_power_side_b": "output"
}
\ No newline at end of file
File moved
...@@ -21,29 +21,28 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ...@@ -21,29 +21,28 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
# Import necessary modules from the custom model library
from Model_Library.architecture import Architecture, Profile from Model_Library.architecture import Architecture, Profile
from Model_Library.dynamics import DynamicTree from Model_Library.dynamics import DynamicTree
from Model_Library.topology import Prosumer from Model_Library.topology import Prosumer
import json import json
import numpy as np import numpy as np
architecture = Architecture(DynamicTree(np.full(24, 3600, dtype=int)).root()) # === Create system architecture with time resolution ===
input_profiles = Profile.from_csv("data.csv", architecture.get_dynamic(""))
with open("prosumer.json") as f: # === Load input profiles from CSV and the Prosumer configuration from JSON ===
prosumer_json = json.load(f)
prosumer_json["components"]["pv"]["irradiance"] = input_profiles["irradiance"] # === Inject time series data into the prosumer model ===
prosumer_json["components"]["pv"]["temperature"] = input_profiles["temperature"]
prosumer_json["components"]["consumption"]["consumption"] = input_profiles[
"electricity_demand"
]
prosumer = Prosumer("my_prosumer", prosumer_json) # === Instantiate the Prosumer object ===
prosumer.optimize("sized", architecture, {}, ["annuity"], {}) # === Run system sizing optimization ===
# Objective: optimize component sizing to minimize annuity cost
# Arguments: key, architecture, component_iden_strs, strategy, sub_configurations
# - optimization type
# - architecture
# - component_iden_strs
# - strategy
# - sub_configurations
prosumer.save_results("output_files") # === Save results to output directory ===
\ No newline at end of file
{
"components": {
"pv": {
"type": "PVGenerator",
"model": "pv.json",
"min_capacity": 10,
"max_capacity": 10
},
"inverter_pv": {
"type": "PowerElectronic",
"model": "inverter_pv.json",
"min_capacity": 10,
"max_capacity": 10
},
"grid": {
"type": "ElectricalGrid",
"price": 0.3046,
"injection_price": 0.0793
},
"consumption": {
"type": "ElectricalConsumption"
}
},
"connections": [
{
"type": "OneToOne",
"from": "pv.output_1",
"to": "inverter_pv.input_1"
},
{
"type": "OneToOne",
"from": "inverter_pv.output_1",
"to": "grid.input_1"
},
{
"type": "OneToOne",
"from": "inverter_pv.output_1",
"to": "consumption.input_1"
},
{
"type": "OneToOne",
"from": "grid.output_1",
"to": "consumption.input_1"
}
],
"planning_horizon": 20,
"price_change_factor": 1.02,
"interest_factor": 1.05
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment