Skip to content

Commit

Permalink
add ifelse for base power
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Dec 9, 2024
1 parent 92c7f27 commit 9dff0db
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/parsers/power_models_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,14 @@ function make_thermal_gen(
ext["z_source"] = (r = d["r_source"], x = d["x_source"])
end

base_conversion = sys_mbase / d["mbase"]
if d["mbase"] != 0.0
mbase = d["mbase"]
else
@warn "Generator $gen_name has base power equal to zero: $(d["mbase"]). Changing it to system base: $sys_mbase"
mbase = sys_mbase
end

base_conversion = sys_mbase / mbase
thermal_gen = ThermalStandard(;
name = gen_name,
status = Bool(d["gen_status"]),
Expand All @@ -577,7 +584,7 @@ function make_thermal_gen(
ramp_limits = (up = ramp_lim, down = ramp_lim),
time_limits = nothing,
operation_cost = operation_cost,
base_power = d["mbase"],
base_power = mbase,
ext = ext,
)

Expand Down

0 comments on commit 9dff0db

Please sign in to comment.