Repository navigation
indflex: Python toolkit for the full chain (process models → PSI → D3R → VPP) - #1
Merged
Merged
Conversation
- indflex package (Pyomo + free HiGHS solver, Gurobi optional): STN, LSTN, and multi-factory fleet models, data loaders, solver wrapper, plots - Legacy .xlsx/.mat inputs converted to plain YAML/CSV under data/ - Tests check the Python models against reference outputs from the original MATLAB/YALMIP code (tools/matlab_reference/make_reference.m) - Notebook 01: interactive STN schedule, STN vs LSTN accuracy over July 2022, and a scaling demo where each solve takes at most 30 s - README quickstart and GitHub Actions test workflow; MATLAB folders unchanged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- indflex.models.batch: conventional RTN with flexible EAF (Zhang et al. 2017) and the continuous RTN (cRTN), transcribed from Efficient-Scheduling-of-Discrete-Industrial-Processes - Batch plant data (steelmaking_zhang2017, eaf_small_case) as YAML - Tests compare against MATLAB/Gurobi references generated by tools/matlab_reference/make_reference_crtn.m; documents a bug in the MATLAB RTN with one heat (sum over time instead of over heats) - Notebook 02: rounding error in the one-furnace case, interactive steelmaking schedules, binaries vs. heats, and a HiGHS solve-time sweep sized to finish in about 2 minutes - solve(): Gurobi via gurobipy as an option, unfixed variable counts, energy units; viz: sub-hourly slots and generic scaling plots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- indflex.identify: mSTN forward model, one-day inverse problem (primal, dual, strong duality; Gurobi NonConvex), and the iterative training loop, transcribed from Production-Scheduling-Identification - make_meter_dataset reproduces the paper's cement meter data exactly from the toolkit's STN - target_from_energy: production-target prior from daily energy and public g; avoids the trivial zero-production solution under short time limits - Notebook 03: one inverse solve recovers a 2-machine plant's rated powers and targets; iteration and the cement case are optional cells - Tests: dataset parity with the paper fixtures, target prior, toy identification (skipped without a full Gurobi license) - build_notebooks.py can rebuild selected notebooks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- indflex.reduce: adjustable load fleet (ALF) model, inverse problem with big-M KKT (L2 for Gurobi, L1 as a MILP for free HiGHS), iterative training as in Data-Driven-Dimension-Reduction, the paper's error metric - Tests: ALF reproduces the paper's saved steel powder and steelmaking responses; single-solve fit on cement; integer meter data - Notebook 04: one HiGHS solve fits a 1-load ALF to the cement STN (9.3% held-out error, paper 8.9%), power-band and fit figures - Notebook 02: RTN rounding error vs cRTN melting progress, 8 per-heat RTN lines vs 4 shared cRTN lines, heat Gantt charts (heat_schedule, crtn_progress, viz.plot_gantt) - Notebook 03: buffered 2-machine toy, machine schedules and buffer level, demand-response event figure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…igures - indflex.coordinate.vpp: standardized resource model, scenario-based bidding LP (day-ahead and real-time re-bid, HiGHS), duals as stored-energy values, merit-order disaggregation, one-hour signal simulation; ported from Real-time-operation-strategy-of-virtual-power-plants (Applied Energy 2024) - Tests match the paper code: profits, bids, duals, and allocations over the first 2 minutes; merit order equals the disaggregation LP; eta^T lambda (default) is never costlier than the paper code's eta lambda - Day-21 case converted to data/vpp (JSON + RegD CSV) - Notebook 05: resource mix, hourly bids, merit order, signal following - Notebook 02: 8-hour horizon so both RTN deliveries show; cRTN column at half height; optional RTN tie_break (cost reported without it) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: chain diagram, notebook table (runtime, solver), quickstart covering all four steps, papers/code/videos table, updated Chinese section - docs/: one concept page per step (idea, limits, figures, results checked against the paper code, links) and reproducibility notes on the paper code - CITATION.cff with the toolkit and the five papers - tools: export_doc_figures.py, extract_paper_fixtures.py, and the VPP MATLAB reference script, so every figure and fixture can be regenerated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README, CITATION.cff, pyproject.toml, package docstring: name indflex, tagline "Industrial demand flexibility: from process models to grid decisions", new repository URL (formerly Industrial User Modeling Toolkit) - pyproject: keywords and project URLs - test_psi: identify the toy plant with one inverse solve to optimality instead of time-limited iterations, whose outcome depended on machine load Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sorry @ruikelyu, your pull request is larger than the review limit of 150,000 diff characters |
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.
Summary
Turns this repository into indflex, Industrial demand flexibility: from process models to grid decisions: a Python package with one teaching notebook per step of the thesis chain. The original MATLAB folders are unchanged.
01_stn_vs_lstn02_rtn_vs_crtn03_psi04_d3r05_vppsrc/indflex/: Pyomo models with HiGHS as the default solver (Gurobi optional), plain-text data underdata/.tests/fixturesandtools/.docs/, plusdocs/notes_on_paper_code.mdwith differences found in the original paper code.CITATION.cffadded.After merging, the repository can be renamed to
indflex. GitHub redirects the old URL.Test plan
pytest: 42 tests pass locally (Gurobi tests are skipped without a full license)jupyter nbconvert --execute)docs/resolvetestsworkflow (HiGHS only) passes on this PR🤖 Generated with Claude Code