Hello everyone,
in kind of a beginner in terms of PyPSA and i would like to know if there is a way to modify the objective function to a completly different one? Right know, as far as i understood, the objective function in PyPSA is composed of the capital cost for each component and operation costs for generators. I would like to change the objective function to minimize the transformer tape ratio for example.
I already tried to do it with the following code:
import pypsa
import numpy as np
import pandas as pd
network = pypsa.Network()
network.import_from_csv_folder(csv_folder_name=csv_folder_path)
def tape_ratio_transformer():
"Code to change the objective Function"
model = network.optimize.create_model()
model.add_constraints(tape_ratio_transformer, name="Minimize_Tape_Ratio_Transformer")
but i think in that way i am just adding extra Constraints and not changing the objective function. I also got the network data thats needed for the optimization like components, voltage magnitudes, power generation and so on.
If anyone has a solution i would really appreciate your help.
If more information is needed just let me know.