Hi Barry
I had read a document, its a general information, it doesn't indicate how to proceed, if we consider a simple example as :
import pypsa
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pyomo.environ import Constraint
IES = pypsa.Network()
IES.set_snapshots(range(8760))
IES.add("Bus","power_generation",v_nom=20.)
IES.add("Generator","Natural_gas_generator",bus="power_generation",carrier="gas",lifetime=20,
marginal_cost=42,capital_cost=450000,efficiency=0.5,p_nom=180,
p_nom_extendable=True)
IES.add("Generator","Oil_generator",bus="power_generation",carrier="oil",lifetime=20,
marginal_cost=45,capital_cost=400000,efficiency=0.35,p_nom=30,p_nom_extendable=True)
IES.add("Carrier", "gas")
IES.add("Carrier", "oil")
IES.add("Load","Cosumption",bus="power_generation",p_set=200)
IES.lopf(pyomo=True)
Could you indicate how to custom a constraint using several function to limit the energy into the oil generator by 35 KTOE ?
Thank you
Riadh
Hi Barry
As showed in the model the dispatch of oil generation is constant for the whole snapshot, while I would like to use oil power plant only for the backup and renewable energy wind/solar generator as main sources of electricity, to make it clearer, it will be a few cases as fellow:
If wind/solar generation are equal to demand, battery is not charging, the is not gas/oil power plant electricity generation.
If wind/solar generation exceed demand, the exceeding is stored in battery storage with a limit of 5000 MWh and the is not gas/oil power plant electricity generation.
If wind/solar generation exceed demand and battery energy capacity, the electricity exceeding is curtailed, the is not gas/oil power plant electricity generation.
If wind/solar generation cannot meet demand, the battery storage will fill the gap, the is not gas/oil power plant electricity generation.
If both wind/solar generation and battery storage cannot meet demand, the gap is filled by gas/oil power plant electricity.
I would like to ask if PYPSA can do that, if yes, do I have to custom a several constraints? or trick the capital and marginal cost and try many combinations?
Kind regards
Riadh