update calculate_line_rating function
This commit is contained in:
parent
d44283bc82
commit
b05cddae77
@ -103,14 +103,16 @@ def calculate_line_rating(n):
|
|||||||
cutout = atlite.Cutout(snakemake.input.cutout)
|
cutout = atlite.Cutout(snakemake.input.cutout)
|
||||||
if relevant_lines.r_pu.eq(0).all():
|
if relevant_lines.r_pu.eq(0).all():
|
||||||
#Overwrite standard line resistance with line resistance obtained from line type
|
#Overwrite standard line resistance with line resistance obtained from line type
|
||||||
relevant_lines["r_pu"]=relevant_lines.join(n.line_types["r_per_length"], on=["type"])['r_per_length']/1000 #in meters
|
R=relevant_lines.join(n.line_types["r_per_length"], on=["type"])['r_per_length']/1000 #in meters
|
||||||
#Set default number of bundles per line
|
|
||||||
relevant_lines["n_bundle"]=1
|
|
||||||
#If line type with bundles is given retrieve number of conductors per bundle
|
#If line type with bundles is given retrieve number of conductors per bundle
|
||||||
if relevant_lines["type"].str.contains("bundle").all():
|
relevant_lines["n_bundle"]=relevant_lines["type"].where(relevant_lines["type"].str.contains("bundle")).dropna().apply(lambda x: int(re.findall(r"(\d+)-bundle", x)[0]))
|
||||||
relevant_lines["n_bundle"]=relevant_lines["type"].apply(lambda x: int(re.findall(r"(\d+)-bundle", x)[0]))
|
#Set default number of bundles per line
|
||||||
Imax=cutout.line_rating(shapes, relevant_lines.r_pu, D=0.0218 ,Ts=353 , epsilon=0.8, alpha=0.8)
|
relevant_lines["n_bundle"].fillna(1, inplace=True)
|
||||||
da = xr.DataArray(data=np.sqrt(3) * Imax * relevant_lines["v_nom"].values.reshape(-1,1) * np.sqrt(relevant_lines["n_bundle"].values.reshape(-1,1)) * relevant_lines["num_parallel"].values.reshape(-1,1)/1e3, #in mW
|
R*=relevant_lines["n_bundle"]
|
||||||
|
R=calculate_resistance(T=353, R_ref=R)
|
||||||
|
Imax=cutout.line_rating(shapes, R, D=0.0218 ,Ts=353 , epsilon=0.8, alpha=0.8)
|
||||||
|
line_factor= relevant_lines.eval("v_nom * n_bundle * num_parallel")/1e3
|
||||||
|
da = xr.DataArray(data=np.sqrt(3) * Imax * line_factor.values.reshape(-1,1), #in mW
|
||||||
attrs=dict(description="Maximal possible power in MW for given line considering line rating"))
|
attrs=dict(description="Maximal possible power in MW for given line considering line rating"))
|
||||||
return da
|
return da
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user