mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
modified validation, error scripts
This commit is contained in:
@@ -33,15 +33,15 @@ function build_model(;
|
|||||||
variable_names::Bool = false,
|
variable_names::Bool = false,
|
||||||
)::JuMP.Model
|
)::JuMP.Model
|
||||||
if formulation.ramping == WanHob2016.Ramping() &&
|
if formulation.ramping == WanHob2016.Ramping() &&
|
||||||
instance.reserves.spinning != zeros(instance.time)
|
instance.reserves.spinning >= ones(instance.time).*1e-6
|
||||||
error(
|
error(
|
||||||
"Spinning reserves are not supported by the WanHob2016 ramping formulation",
|
"Spinning reserves are not supported by the WanHob2016 ramping formulation",
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@show formulation.ramping
|
|
||||||
if formulation.ramping !== WanHob2016.Ramping() && (
|
if formulation.ramping !== WanHob2016.Ramping() && (
|
||||||
instance.reserves.upflexiramp != zeros(instance.time) ||
|
instance.reserves.upflexiramp >= ones(instance.time).*1e-6 ||
|
||||||
instance.reserves.dwflexiramp != zeros(instance.time)
|
instance.reserves.dwflexiramp >= ones(instance.time).*1e-6
|
||||||
)
|
)
|
||||||
error(
|
error(
|
||||||
"Flexiramp is supported only by the WanHob2016 ramping formulation",
|
"Flexiramp is supported only by the WanHob2016 ramping formulation",
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ function _validate_reserve_and_demand(instance, solution, tol = 0.01)
|
|||||||
|
|
||||||
# Verify flexiramp solutions only if either of the up-flexiramp and
|
# Verify flexiramp solutions only if either of the up-flexiramp and
|
||||||
# down-flexiramp requirements is not a default array of zeros
|
# down-flexiramp requirements is not a default array of zeros
|
||||||
if instance.reserves.upflexiramp != zeros(T) || instance.reserves.dwflexiramp != zeros(T)
|
if instance.reserves.upflexiramp != zeros(instance.time) || instance.reserves.dwflexiramp != zeros(instance.time)
|
||||||
upflexiramp =
|
upflexiramp =
|
||||||
sum(solution["Up-flexiramp (MW)"][g.name][t] for g in instance.units)
|
sum(solution["Up-flexiramp (MW)"][g.name][t] for g in instance.units)
|
||||||
upflexiramp_shortfall =
|
upflexiramp_shortfall =
|
||||||
@@ -342,6 +342,7 @@ function _validate_reserve_and_demand(instance, solution, tol = 0.01)
|
|||||||
err_count += 1
|
err_count += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
dwflexiramp =
|
dwflexiramp =
|
||||||
sum(solution["Down-flexiramp (MW)"][g.name][t] for g in instance.units)
|
sum(solution["Down-flexiramp (MW)"][g.name][t] for g in instance.units)
|
||||||
dwflexiramp_shortfall =
|
dwflexiramp_shortfall =
|
||||||
@@ -379,6 +380,7 @@ function _validate_reserve_and_demand(instance, solution, tol = 0.01)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
return err_count
|
return err_count
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user