Pablo/updates#25
Open
PabloBotinGP wants to merge 65 commits into
Open
Conversation
…ng file, and system build function
…stored in .md files
…red fields Previously, make_new_bus called the ACBus kwargs constructor without `available`, which in psy5 caused `UndefKeywordError(:available)` while calling `add_line!()`. This commit adds `available=true` and ensures other required fields are set correctly. Note: add_line! still fails later due to another bug
Problem: - New buses did not inherit base_voltage from existing endpoints. - When both ends were new, defaults used bus_data[3] (area code) instead of intended bus_data[1] (kV). Solution: - Inherit base_voltage from the existing endpoint when present. - When both new, use bus_data[1] as the default (kV). - Mirror the inheritance logic in add_transformer!. - Add logging for inheritance and conflict cases.
…match handling - Set base_voltage from line definition (new_arc[1]) for all new buses - Remove redundant voltage mismatch detection and correction logic
…tibility - Added base_power argument to TapTransformer calls due to new struct requirements in beta PowerSystems.jl - Set base_power = system_base_power and rating = 2000.0/system_base_power to preserve original 2000 MVA specification - Convert rating to per-unit as required by new API - Implementation may need revision pending clarification from PS.jl developers on base_power vs rating semantics
…and fixed a path conflict
…ut SCED data Fixed critical UndefVarError bug in system_build_functions.jl where the make_thermal_gen() function referenced undefined variable 'gen' instead of the correct parameter name 'original_gen'. This bug affected all steam turbines and generators without SCED market data, causing failures hours into production runs. Changes: - Fixed lines 860 & 863 in system_build_functions.jl to use 'original_gen'
Fixed UndefVarError in get_mean_quadratic_model() and get_median_quadratic_model() where JuMP model variable 'm' was created inside try-catch block but used outside of it. When Xpress optimizer failed to instantiate, the error was caught and rethrown, but if an outer handler caught it, execution continued to code that referenced the undefined 'm' variable. Changes: - Added 'local m' declaration in function scope - Moved set_optimizer_attribute() calls inside try blocks - Ensures 'm' is only used after successful creation
- Import DataStructures.SortedDict in make_day_ahead_data.jl - Replace Dict with SortedDict for scenario forecast data - PowerSystems requires chronologically ordered time series - Fixes both 31-scenario and 84-scenario system construction - Document bug in BUGS.md as Error NLR-Sienna#4
PROBLEM: -------- Hour-ahead (HA) and real-time (RT) time series data were embedded in System objects (.json + .h5) created with an older PowerSystems.jl version. SOLUTION: --------- Extracted time series from old systems and saved as individual H5 files, then adapted scripts to read directly from H5 files instead of loading old System objects. Related: Error NLR-Sienna#7 in dev/BUGS.md
PowerSystems.jl API changed the argument order for get_components() when using a filter function. Updated to correct signature. Related: Error NLR-Sienna#8 in dev/BUGS.md
- Fixed: Changed to in make_real_time_data.jl (3 occurrences) - Fixed: Changed HA output from jsons/HA_sys.json to HA_sys.json for consistency
…zer definition and call after.
…with Marbele 6 Hydro
…enerated artifacts
…oid infeasible UC Override incorrect min==max active-power limits coming from original TAMU data by forcing every HydroDispatch component's active_power_limits.min to 0.0 on system load. Implemented as a short-term mitigation in copper_singlestage_sim.jl. Prevents unit‑commitment infeasibilities caused by bad input limits while investigation/fix is applied upstream. Next steps (choose one) A) Fix the original TAMU MATPOWER data so hydro generator limits are correct (recommended, permanent fix). B) Or, apply the same override immediately after loading the original TAMU system (e.g., right after sys = System(TAMU_matpower_file) in build_system_script.jl) so all downstream serialized snapshots inherit corrected limits.
PROBLEM: - Original TAMU/ACTIVSg2000 MATPOWER data contains HydroDispatch generators with incorrect minimum active power limits (min==max or min!=0) - This caused infeasibility in Unit Commitment optimization - Previous workaround: manually set limits to zero in copper_singlestage_sim.jl after loading the system SOLUTION: 1. Corrected all HydroDispatch min active power limits to 0.0 on the datafile. - Saved corrected system as ACTIVSg2000.json (PowerSystems native format) 2. Updated file_pointers.jl: - Changed TAMU_matpower_file from .m to .json extension 3. Commented out provisional fix in copper_singlestage_sim.jl: - Lines 31-42 now commented out (HydroDispatch limit fix loop) - No longer needed since data is corrected at source
… my own modifications
- Add fix_hydro_dispatch_limits!() function to system_build_functions.jl - Integrate hydro limits fix into build_system_script.jl at system initialization - Remove redundant hydro fix code from copper_singlestage_sim.jl This resolves UC infeasibility issues caused by HydroDispatch components having min==max active power limits from the original TAMU data. The fix is now applied automatically during system building without modifying any datafile.
- Remove erroneous include(add_services.jl) - add_services.jl attempts to load intermediate_sys.json which doesn't exist - Script already correctly loads intermediate_sys_w_services.json, which already exists This resolves the No such file or directory error when trying to load intermediate_sys.json during hour-ahead data generation.
…power so I removed its definitions. Leaving the original command for reference
… by piecewise (linear) cost functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forked out from Annas repo and work advanced by Pablo during the last couple weeks, adapting repo to psy5.
build_system_script works
copper_singlestage works
copper_multistage has some feasibility issues