AI-Based Exergy Analysis of a Multi-Section Cement Plant Using High-Ash Indian Coal: A Case Study
收藏资源简介:
AI-Based Exergy Analysis of a Multi-Section Cement Plant Using High-Ash Indian Coal — Reproducibility Package This repository contains the Aspen Plus model, dataset, analysis code, trained machine-learning surrogate, and result files supporting the paper: AI-Based Exergy Analysis of a Multi-Section Cement Plant Using High-Ash Indian Coal: A Case Study Abhijeet Bajpai, Dr. Sonu Rajak NIT Patna / Government Engineering College Kaimur Submitted to the Journal of Mechanical Science and Technology (JMST) Archived at (this repository): https://doi.org/10.5281/zenodo.20717411 The study performs a section-wise exergy analysis of a six-section dry-process cement plant (raw mill, coal mill, preheater, calciner, rotary kiln, clinker cooler) firing high-ash Indian coal, validated in Aspen Plus V14. It then builds a hybrid machine-learning surrogate of the plant (ANN + Random Forest, selected per output), ranks the dominant operating drivers of irreversibility using SHAP, and optimises the operating point at constant clinker production using particle swarm optimisation (PSO) with full Aspen re-validation of the optimum. Table of contents Software environment Repository / file manifest How to reproduce the results Exergy accounting method The hybrid ML surrogate SHAP sensitivity analysis PSO optimisation Key modelling conventions Governing equations (supplementary_equations.pdf) Annexure tables (supplementary_tables.pdf) Headline results A note on two base-case numbers you may see in old files Reproducibility, seeds, and tolerances Citation License Contact 1. Software environment Component Version used Aspen Plus V14 Python 3.11 TensorFlow / Keras 2.x (CPU) scikit-learn 1.8.0 SHAP latest (TreeExplainer + GradientExplainer) pandas, numpy, joblib, matplotlib standard Aspen COM interface win32com (pywin32) — Windows only Install Python dependencies: pip install tensorflow scikit-learn shap pandas numpy joblib matplotlib pywin32 A licensed Aspen Plus V14 installation on Windows is required for the base-case exergy calculation, dataset generation, and PSO Phase-2 (Aspen) validation. Surrogate training (Step 4), SHAP (Step 5), and PSO Phase-1 (the surrogate search) run on any platform directly from the provided ann_dataset.csv and trained-model artifacts, without Aspen. 2. Repository / file manifest This section lists the files that should be in this archive and what each one is for. A few file names look similar (exergy_calculator.py vs exergy_calculator_v2.py, ann_*_step*.py vs hybrid_*_step*.py) but are not interchangeable — see the "Do not confuse with" notes below and §12 for why this matters. Aspen model (ground truth) File Description new cmill rmill preheater calciner kiln cooler.bkp The validated Aspen Plus V14 flowsheet (raw mill → coal mill → preheater → calciner → kiln → clinker cooler). Everything else in this repository can be regenerated from this file. Dataset File Description ann_dataset.csv The exergy campaign dataset: 500 accepted Latin-hypercube samples plus the base-case row. 26 operating-input columns, 21 exergy-output columns, plus per-section diagnostic columns and a status flag. Train only on rows with status in {OK, OK_CAPPED}; REJECT rows are genuine second-law-violating / non-physical samples rejected by the branch guard and are excluded from training. New_Microsoft_Excel_Worksheet.xlsx / renamed aspen_stream_export.xlsx Raw Aspen Plus stream/block table export underlying the base-case exergy calculation. Upload only one copy (the renamed one is recommended for clarity) — do not upload both, they are identical. Pipeline code — run in this order Step File Purpose 0 basecase_preflight.py GO/NO-GO check on the base case before doing anything else: verifies the solve landed on the correct (non-spurious) flowsheet branch, and that section/plant exergy values match hard-coded reference values (see §8). 1 exergy_calculator.py Standalone base-case exergy accounting. Solves the flowsheet via the write-then-solve protocol (§8) and computes the per-section and plant exergy balance — this is the source of Table 3. Writes exergy_results.xlsx. 2 exergy_campaign_driver.py Generates ann_dataset.csv by perturbing the 26 operating inputs (±10% Latin-hypercube design) around the base case and recomputing the exergy balance for each sample via write-then-solve. Includes a branch guard (rejects any sample whose solve lands on the spurious high-temperature branch, RMINLETG > 600 K or plant total > 135 MW) and freezes/caches the base-case fuel exergy and electrical work so the efficiency basis stays solve-independent (§8). 3 hybrid_train_step2.py Trains the adopted hybrid surrogate: for each of the 21 outputs, both an ANN and a Random Forest are trained on an identical 70/15/15 (train/validation/test) split (seed 42); the better model per output is selected on the validation set and reported on the held-out test set. Writes model artifacts to ANN_models/HYBRID/ (see below) — this is the source of the "Hybrid" column of Table 4. 4 hybrid_shap_step3.py SHAP sensitivity analysis on the hybrid surrogate: each output is explained by its own routed model (TreeExplainer on raw inputs for RF-routed outputs, GradientExplainer on scaled inputs for ANN-routed outputs), with per-output SHAP magnitudes normalised so they are comparable across the two explainer types. 5 hybrid_pso_step4.py Constant-duty PSO optimisation (Phase 1, on the hybrid surrogate) followed by full Aspen re-validation of the base case and the optimum (Phase 2, via write-then-solve) — this is the source of Table 6. Additional trainers — optional, for the Table 4 model-comparison columns only File Purpose ann_train_step2.py ANN-only surrogate: a single 26→21-output multi-output network, plus six per-section 3-output networks. Reproduces the "ANN-only" column of Table 4. Does not include a Random Forest. rf_train_step2.py Random-Forest-only surrogate: 21 dedicated per-output forests (400 estimators each). Reproduces the "RF-only" column of Table 4. Do not confuse with: ann_shap_step3.py and ann_pso_step4.py are an older, superseded ANN-only SHAP/PSO pipeline from an earlier project iteration (they load only single_18output.keras, use only shap.GradientExplainer, and internally reference a stale 108.3 MW base case). They pre-date the hybrid surrogate and do not reproduce the results reported in the paper (Table 4's hybrid R² = 0.93, Table 6's 110.505 → 106.190 MW optimisation). They are excluded from this repository. Use hybrid_shap_step3.py and hybrid_pso_step4.py instead. ann_train_step2.py is kept because it legitimately reproduces the ANN-only comparison column of Table 4 and is not superseded for that purpose. Trained surrogate artifacts (ANN_models/HYBRID/) File Description hybrid_ann.keras The 21-output ANN component (tanh, 64–32 hidden layers, scaled I/O, Adam, LR = 1e-3). scaler_X.pkl, scaler_y.pkl Input/output standard scalers for the ANN. hybrid_bundle.joblib Dict {forests[21], routing[21], output_cols, input_cols, ann_file, kind} — the 21 trained Random Forests plus the per-output ANN-vs-RF routing map. routing.csv Which model (ANN or RF) was selected for each of the 21 outputs. metrics_report.csv Per-output test R² / RMSE for ANN, RF, and hybrid (Table 4 source). training_summary.txt Human-readable training log/summary. plots/parity_hybrid_sections.png Parity plots, hybrid model, by section. Including these trained artifacts lets a user reproduce the SHAP and PSO results exactly, without retraining (training has minor run-to-run variation even with a fixed seed, due to floating-point ordering and BLAS/GPU non-determinism). SHAP outputs (ANN_models/HYBRID/shap/) shap_importance.csv, shap_importance_by_section.csv, ranked_sensitivity_by_section.csv, ranked_sensitivity_table.txt, top_drivers_summary.csv, shap_specific_irrev.csv / shap_specific_irrev.txt, shap_top_inputs.csv, plots/ (bar + beeswarm PNGs per output). PSO / optimisation outputs (ANN_models/HYBRID/pso/) pso_result.csv (optimised operating point), pso_section_summary.csv, pso_convergence.png, pso_summary.txt, validate_optimum.csv / validate_optimum.txt (Aspen-validated base-vs-optimum comparison — this is the authoritative source for Table 6). Result files (repository root) File Description exergy_results.xlsx Base-case section/plant exergy breakdown (Table 3 source), written by exergy_calculator.py. Do not confuse with: exergy_calculator_v2.py and its output exergy_results_v2.xlsx are an older calculator variant that computes physical/chemical exergy the same way but without the mandatory write-then-solve base-case protocol, and produces a base case of 108.3 MW — not the 110.505 MW reported in the paper. See §12 for a full explanation. Neither file is included in this repository. Use exergy_calculator.py and exergy_results.xlsx. Documentation File Description README.md This file. LICENSE License terms (see §15). 3. How to reproduce the results All scripts read/write inside the Aspen working folder. Edit the ASPEN_FOLDER path in the configuration block at the top of each script to point at your local copy, then run from that folder so the Aspen COM session and the relative ANN_models/ paths resolve correctly. # 0) verify the base case lands on the correct flowsheet branch python basecase_preflight.py # 1) base-case exergy balance (Table 3) python exergy_calculator.py # 2) generate the dataset (long: several hours of Aspen solves; # skip this step if using the provided ann_dataset.csv) python exergy_campaign_driver.py # 3) train the hybrid surrogate (Table 4, "Hybrid" column) python hybrid_train_step2.py # optional — ANN-only / RF-only comparison columns of Table 4: python ann_train_step2.py python rf_train_step2.py # 4) SHAP sensitivity analysis python hybrid_shap_step3.py # 5) constant-duty PSO optimisation + Aspen validation (Table 6) python hybrid_pso_step4.py To reproduce only the surrogate / SHAP / PSO-Phase-1 results without Aspen, use the provided ann_dataset.csv and the ANN_models/HYBRID/ artifacts and run Steps 3–5 (Step 5's Phase 2 Aspen re-validation is the only part of the pipeline that strictly requires Aspen once the dataset exists). 4. Exergy accounting method Exergy is computed with the dead-state reference-stream method (Hinderink et al., 1996) for physical exergy and the Szargut method (Szargut, 1999) with the Szargut–Styrylska correlation for chemical exergy of the coal and combustion products. Clinker-mineral chemical exergies are derived from thermochemical reference data (see Annexure Table A2, §10). Section-level exergy destruction (irreversibility) is closed by an exergy balance around each of the six sections; overall plant efficiency uses the Kotas functional-efficiency definition (exergy of product / exergy of fuel). A Gouy–Stodola entropy-generation cross-check (Route A) is computed alongside the direct section exergy balance (Route B, the primary/reported route) as an internal consistency check. The flowsheet's recycle/split structure is path-dependent: depending on initialisation, Aspen's simultaneous solver can converge to either a physically correct branch (plant irreversibility ≈ 110.5 MW) or a spurious "hot" branch (≈ 128–130 MW, with the raw-mill inlet gas stream RMINLETG converging to an unphysical ≈ 709 K). All results in this repository use the write-then-solve protocol to reliably land on the single correct branch: re-initialise the flowsheet, write all 26 operating inputs, then call Run (repeated up to N times if needed for convergence). basecase_preflight.py and the branch guard inside exergy_campaign_driver.py both check for this (RMINLETG < 600 K sentinel) and reject/flag any sample that lands on the spurious branch. 5. The hybrid ML surrogate For each of the 21 plant-level and section-level exergy outputs, both an ANN (single multi-output network, tanh activations, 64–32 hidden units, scaled inputs/outputs, Adam optimiser, learning rate 1e-3) and a Random Forest (21 dedicated per-output forests, 400 estimators each) are trained on an identical 70/15/15 train/validation/test split (fixed seed 42). The better-performing model per output is selected using the held-out validation set, and accuracy is then reported on a separate held-out test set that played no role in model selection — this avoids validation leakage into the reported accuracy. Output Selected model Raw mill irreversibility Random Forest Coal mill irreversibility Random Forest Preheater irreversibility ANN Calciner irreversibility ANN Kiln irreversibility ANN Clinker cooler irreversibility ANN Clinker exergy, overall exergy efficiency Random Forest Plant specific irreversibility ANN Random Forests win the drying-dominated mill sections, where the exergy response has strong multiplicative interactions between throughput and moisture/temperature; the ANN wins the smoother thermal sections (preheater, calciner, kiln, cooler) and the plant-level specific irreversibility. Held-out test accuracy (mean R² over 21 outputs): ANN-only ≈ 0.85, RF-only ≈ 0.84, Hybrid ≈ 0.93. The hybrid raises raw-mill and coal-mill irreversibility prediction to R² ≈ 0.92–0.94 (up from ≈ 0.61–0.79 for the ANN alone). 6. SHAP sensitivity analysis Each of the 21 outputs is explained using its own routed model: shap.TreeExplainer on the raw (unscaled) inputs for outputs routed to a Random Forest, and shap.GradientExplainer on the scaled inputs for outputs routed to the ANN. Because the two explainer types produce SHAP values on different native scales, per-output mean(|SHAP value|) is normalised to sum to 1 before cross-output/cross-model comparison, so importances are comparable regardless of which model produced them. Dominant drivers identified: raw-mill dryer/gas inlet temperatures (raw mill), gas-heater/coal-mill temperatures (coal mill), and calciner temperature together with coal feed/split (thermal sections); plant-wide specific irreversibility is dominated by raw-meal throughput. 7. PSO optimisation A Clerc–Kennedy constriction-coefficient PSO (40 particles, 200 iterations, inertia W = 0.7298, C1 = C2 = 1.4962) minimises the plant specific irreversibility (sum of the six section irreversibilities, divided by clinker exergy) on the hybrid surrogate, within a ±10% search box around the 26 base-case input values. Because clinker output in this flowsheet is set by raw-meal stoichiometry rather than a direct fuel–clinker heat coupling, an unconstrained search can find "improvements" that are really just a throughput trick — inflating clinker mass to make the specific (per-kg) irreversibility look lower without actually improving the process. To prevent this, PSO runs in FIX_THROUGHPUT mode: the five duty-setting inputs (raw-meal feed, coal feed, meal split, coal split, calciner temperature) are pinned near their base-case values, and clinker exergy is constrained within ±2% of the base case, so any reduction in irreversibility is genuine and not an artefact of changed production rate. The PSO optimum found on the surrogate (Phase 1) is then re-validated on the real Aspen model (Phase 2), using the same write-then-solve protocol as the base case, and both the base case and the optimum are solved independently so the reported improvement is not an artefact of surrogate error. validate_optimum.csv / .txt is the authoritative source for Table 6. The optimiser also reports (bound_report()) which inputs, if any, are pinned at the ±10% search-box edges, flagging that the true unconstrained optimum may lie further out. 8. Key modelling conventions These conventions are applied consistently across the calculator, the dataset, the surrogate, SHAP, and PSO, so every number reported in the paper traces back to one self-consistent basis. Single solution branch (write-then-solve). See §4. All reported results are from the physically correct branch; the branch guard in exergy_campaign_driver.py rejects samples on the spurious branch (RMINLETG > 600 K or plant total > 135 MW). Base-case reference values (as checked by basecase_preflight.py): plant irreversibility 110.51 MW; per-section irreversibility — raw mill 7.51 MW, coal mill 1.51 MW, preheater 11.43 MW, calciner 36.63 MW, kiln 37.71 MW, clinker cooler 15.72 MW; overall exergy efficiency 37.74%; clinker exergy 64.45 MW; CM-GRIND duty 0.600 MW; specific irreversibility 1.6403 MJ/kg clinker; clinker mass flow 67.37 kg/s; raw-mill inlet gas temperature (RMINLETG) 436.0 K (branch sentinel threshold: 600 K). Reproducibility check. Two independent write-then-solve passes on the base case must agree within 0.15 MW plant irreversibility; this is checked automatically by basecase_preflight.py. Fixed-fuel / frozen-electrical efficiency basis. The exergy-efficiency denominator uses the base-case fuel exergy (166.513 MW) and the base-case auxiliary electrical work (4.279 MW), both held constant across the dataset and PSO search. At fixed firing and production these are essentially invariant; freezing them prevents off-design heat-block sign reversals in individual samples from corrupting the efficiency metric. Constant-duty optimisation. See §7 — PSO is run at fixed throughput with a ±2% clinker-exergy band, inside a ±10% search box on all 26 inputs. Primary vs. secondary irreversibility metric. Specific irreversibility is reported primarily in MJ/kg clinker (equivalently GJ/tonne); the dimensionless ratio (Σ section irreversibilities / clinker exergy, MW/MW) is used as the PSO objective function. Fixed random seed (42) is used throughout for the train/validation/test split and model initialisation. Minor numerical differences between reruns may still arise from floating-point summation order and hardware-specific BLAS/GPU library optimisations; these do not affect the paper's conclusions. 9. Governing equations (supplementary_equations.pdf) The full, numbered derivations (Eqs. 1–24) are provided as a standalone PDF, supplementary_equations.pdf (kept as PDF rather than Markdown/Word because Zenodo's built-in file viewer does not render LaTeX/MathType equations embedded in .md or .docx). The equation groups are: Equations Topic 1–6 Calcination and clinker-phase formation reactions 7–8 Mass and energy balance 9–10 Surrogate accuracy metrics (R², RMSE) 11–17 Total, physical, and chemical exergy (dead-state / Szargut methods) 18 Section-level exergy balance (Route B, primary) 19 Route A cross-check — Gouy–Stodola entropy-generation theorem 20 Kotas functional exergy efficiency 21 Exergetic improvement potential 22–24 Plant-level aggregation of section results A numbered reference list (matching the main paper's reference numbering) is included at the end of the PDF. 10. Annexure tables (supplementary_tables.pdf) Also kept as a standalone PDF for the same LaTeX-rendering reason as §9. Contents: Table Contents A1 Standard molar chemical exergies of 18 conventional/oxide reference species (Szargut conventional-element table). A2 Derived clinker-mineral chemical exergies for the four clinker phases modelled in Aspen (TRICA-01, OLIVI-01, (CAO)-01, C4AF). A3 Thermochemical inputs and data provenance (enthalpies/third-law entropies) for 8 species used to derive Table A2. A4 Application of the method to the case-study coal — proximate/ultimate composition C/H/O/N/S/ash = 48.00 / 3.50 / 8.85 / 1.20 / 0.45 / 38.0 wt% (high-ash Indian coal), O/C ratio 0.184, Szargut–Styrylska factor φ_dry = 1.0697, net calorific value (dry) 18,761 kJ/kg, resulting dry chemical exergy 20.11 MJ/kg. A5 Fallback solid heat-capacity correlations/values for 12 species used where composition-weighted Cp data were unavailable. 11. Headline results Base case (Table 3): 110.505 MW plant exergy destruction (irreversibility); 1.6403 MJ/kg clinker specific irreversibility; 37.74% overall exergy efficiency (fixed-fuel basis); clinker exergy 64.453 MW; exact exergy boundary closure across all six sections. Surrogate accuracy (Table 4): mean test R² — ANN-only 0.85, RF-only 0.84, Hybrid 0.93, with the per-output routing given in §5. Dominant drivers (SHAP, §6): raw-mill dryer/gas temperatures (raw mill), gas-heater/coal-mill temperatures (coal mill), calciner temperature with coal feed/split (thermal sections); plant-wide specific irreversibility dominated by raw-meal throughput. Constant-duty optimisation (Table 6): specific and total irreversibility reduced by ≈ 3.9% (110.505 → 106.190 MW) at constant clinker production and constant (37.7%) efficiency; the largest sectional gain is in the raw mill (≈ −34%). The optimum is envelope-bounded — several inputs sit at the ±10% search-box edges, flagged by bound_report(). 12. A note on two base-case numbers you may see in old files Earlier project iterations produced two different base-case irreversibility numbers from two different code paths; only one is correct and reported in the paper. "Method 1" — 108.3 MW. Produced by exergy_calculator_v2.py, which computes physical/chemical exergy correctly but without the mandatory write-then-solve protocol, so it can converge on either flowsheet branch (§4). Its output is exergy_results_v2.xlsx. This method and its output files are superseded and are not included in this repository. "Method 2" — 110.505 MW. Produced by exergy_calculator.py, which mandatorily calls the write-then-solve base-case routine in exergy_campaign_driver.py before computing the balance (there is no silent fallback — the script exits with a fatal error if the write-then-solve driver cannot be imported, specifically to prevent this ambiguity). Its output is exergy_results.xlsx. This is the number reported throughout the paper (Table 3, Table 6 baseline) and the only base case this repository documents. If you generate your own results from this repository and get 108.3 MW instead of ≈110.5 MW, you are most likely running exergy_calculator_v2.py (or a copy of exergy_campaign_driver.py that still imports it as EX) instead of the current exergy_calculator.py / exergy_campaign_driver.py pair — check that your exergy_campaign_driver.py contains import exergy_calculator as EX (not exergy_calculator_v2), that it includes the branch guard described in §4/§8, and that basecase_preflight.py passes before trusting any downstream number. 13. Reproducibility, seeds, and tolerances Train/validation/test split: 70/15/15, fixed seed 42, identical split used for the ANN, the Random Forest, and the hybrid selection. Base-case reproducibility tolerance: two independent write-then-solve passes must agree within 0.15 MW plant irreversibility (basecase_preflight.py). Branch sentinel: any solve with RMINLETG ≥ 600 K (raw-mill inlet gas temperature) or plant irreversibility > 135 MW is treated as the spurious branch and rejected/flagged, never used in the dataset or reported results. Surrogates, SHAP rankings, and PSO results are valid only within the ±10% operating envelope on which the surrogate was trained and should not be extrapolated beyond it without re-validation against Aspen. Minor run-to-run numerical variation (training, and floating-point solve order in Aspen) is expected and does not affect the paper's conclusions; the trained-model artifacts in ANN_models/HYBRID/ are provided so SHAP and PSO can be reproduced exactly without retraining. 14. Citation If you use this dataset or code, please cite the associated paper: Bajpai, A., Rajak, S. AI-Based Exergy Analysis of a Multi-Section Cement Plant Using High-Ash Indian Coal: A Case Study. Journal of Mechanical Science and Technology (JMST) [in review / year]. and this repository via its archived DOI: https://doi.org/10.5281/zenodo.20717411 15. License This dataset and code are released under a permissive open license to permit reuse, in line with the journal's open-data policy: MIT for the code and CC-BY 4.0 for the data. See the LICENSE file in this repository. The Aspen model represents a generic dry-process cement plant configuration parameterised on high-ash Indian coal; no proprietary plant data are included. 16. Contact For questions about the model, the pipeline, or this repository, contact the corresponding author of the associated publication (Abhijeet Bajpai, NIT Patna / Government Engineering College Kaimur).



