-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: No Method Matching add_to_expression #778
Comments
Thanks for submitting this issue @wrgunther . This has exposed a funny case where |
My guess is that this is happening when function must_run_vre_generation(t) is zero or constant. That's defined here I've done a little test here:
This expression comes back as a Vector{Float64}, as expected, because it contains no variables: This comes back as Vector{AffExpr}: It looks like this creates a local Vector{AffExpr}, but the version in the model is Vector{Float64}.
We could redefine
and
A safe, but clunky option would be to redefine |
This is now resolved in the |
Bug description
Using a GenX case with Operational_reserves.csv input containing a Static_Contingency_MW >0 the run crashes while loading the Operational Reserves Core Module. This can be replicated starting from the 5_three_zones_w_piecewise_fuel example case by entering 2000 for the Static_Contingency_MW. The problem can be fixed by reverting two lines in operational_reserves.jl
Line 273 add_to_expression!(EP[:eRsvReq], EP[:eContingencyReq])
to EP[:eRsvReq] = EP[:eRsvReq] + EP[:eContingencyReq]
Line 287 add_to_expression!(EP[:eObj], eTotalCRsvPen)
to EP[:eObj] += eTotalCRsvPen
This is a low priority given the known fix but presumably there is a way to update add_to_expression.
Environment and Version
Windows 11, Julia 1.10.5, GenX 0.4.1 main
Relevant error messages
Additional context
The bug existed in earlier versions of GenX (Dec 2023) and the relevant lines in reserves.jl were 258 and 268.
The text was updated successfully, but these errors were encountered: