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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- chemistry
|
| 5 |
+
- pyrolysis
|
| 6 |
+
- biomass
|
| 7 |
+
- neural-network
|
| 8 |
+
- surrogate-model
|
| 9 |
+
- kinetic-modeling
|
| 10 |
+
- thermogravimetry
|
| 11 |
+
- matlab
|
| 12 |
+
- machine-learning
|
| 13 |
+
pretty_name: PyroBot Pyrolysis Foundation Models
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# PyroBot Pyrolysis Foundation Models (`bpDNN2Ea` & `bpDNN2Yield`)
|
| 17 |
+
|
| 18 |
+
This repository contains the core neural network surrogate models of **PyroBot**, an autonomous, agentic framework designed for interpreting, optimizing, and simulating biomass pyrolysis. These foundation surrogates are trained to predict the apparent activation energy ($E_a$) and three-phase product yields (Char, Liquid, Gas) directly from multi-dimensional feedstock properties and process state variables.
|
| 19 |
+
|
| 20 |
+
By utilizing these pre-trained Backpropagation Deep Neural Networks (BP-DNNs) as a fast and accurate surrogate "brain," PyroBot bypasses computationally expensive ab initio or multi-phase CFD simulations, enabling real-time closed-loop autonomous kinetic analysis and thermogravimetric (TG) curve reconstruction.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## 📂 Model Repository Structure
|
| 25 |
+
|
| 26 |
+
The repository contains two trained neural networks saved in MATLAB format, along with their respective preprocessing parameters:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
.
|
| 30 |
+
├── README.md # This model card document
|
| 31 |
+
├── .gitattributes # Git LFS configurations tracking .mat files
|
| 32 |
+
├── bpDNN2Ea/
|
| 33 |
+
│ └── Results_trained.mat # Apparent Activation Energy (Ea) network & scaling metadata
|
| 34 |
+
└── bpDNN2Yield/
|
| 35 |
+
└── Results_trained.mat # Pyrolysis Product Yield network & scaling metadata
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
Each `Results_trained.mat` file contains three core structures:
|
| 39 |
+
1. `net`: The trained deep neural network (weights, biases, layer transfer functions).
|
| 40 |
+
2. `PS`: Preprocessing struct (`mapminmax` scaling parameters for inputs).
|
| 41 |
+
3. `TS`: Postprocessing struct (`mapminmax` scaling parameters for outputs).
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## 🧠Model Descriptions & Architectures
|
| 46 |
+
|
| 47 |
+
### 1. `bpDNN2Ea` (Activation Energy Prediction)
|
| 48 |
+
* **Goal**: Predicts the Apparent Activation Energy ($E_a$, in $\text{kJ/mol}$) as a function of biomass feedstock composition and the instantaneous conversion level ($\alpha$).
|
| 49 |
+
* **Network Topology**: `256` (Input) $\rightarrow$ `42` (Hidden Layer 1) $\rightarrow$ `42` (Hidden Layer 2) $\rightarrow$ `1` (Output).
|
| 50 |
+
* **Input Features (256 Dimensions)**:
|
| 51 |
+
* **Basic Feedstock Characteristics (19 Dimensions)**: Includes proximate analysis (volatile matter, fixed carbon, ash), ultimate analysis (C, H, O, N, S), and detailed ash compositions ($SiO_2$, $Al_2O_3$, etc.).
|
| 52 |
+
* **Pyrolysis Progress State (1 Dimension)**: The instantaneous degree of conversion ($\alpha$), ranging from `0.01` to `0.999`.
|
| 53 |
+
* **Feedstock Blending/Mixing Features (236 Dimensions)**: Captures complex multi-component feedstock mixtures, geographic source classifications, and blending ratio parameters.
|
| 54 |
+
* **Output**: Apparent Activation Energy $E_a$ ($\text{kJ/mol}$).
|
| 55 |
+
|
| 56 |
+
### 2. `bpDNN2Yield` (Product Yields Prediction)
|
| 57 |
+
* **Goal**: Predicts the ultimate three-phase pyrolysis yields (Char, Liquid, Gas) under high-temperature conditions.
|
| 58 |
+
* **Network Topology**: `259` (Input) $\rightarrow$ `45` $\rightarrow$ `45` $\rightarrow$ `45` $\rightarrow$ `45` $\rightarrow$ `45` $\rightarrow$ `3` (Outputs).
|
| 59 |
+
* **Input Features (259 Dimensions)**:
|
| 60 |
+
* **Basic Feedstock Characteristics (19 Dimensions)**
|
| 61 |
+
* **Detailed Feedstock Blending/Mixing Features (240 Dimensions)**
|
| 62 |
+
* **Outputs (3 Dimensions)**:
|
| 63 |
+
* Pyrolysis yields (expressed in weight percentages):
|
| 64 |
+
1. **Char Yield (%)** (used directly as the ultimate residue $w_{\infty}$ for TG scaling).
|
| 65 |
+
2. **Liquid/Bio-oil Yield (%)**
|
| 66 |
+
3. **Gas Yield (%)**
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## 🧪 Downstream Application: TG Curve Synthesis & Kinetic Coupling
|
| 71 |
+
|
| 72 |
+
In the PyroBot cognitive ecosystem, these two models are combined to reconstruct simulated Thermogravimetric (TG) curves with perfect physical and kinetic consistency:
|
| 73 |
+
|
| 74 |
+
1. **Mass Loss Curve Platform ($w_{\infty}$)**:
|
| 75 |
+
The ultimate char yield predicted by `bpDNN2Yield` sets the lower boundary platform ($w_{\infty} = \text{Char Yield}/100$) of the mass-loss profile. For any degree of conversion $\alpha$, the remaining sample weight $w(\alpha)$ is calculated via mass balance:
|
| 76 |
+
$$w(\alpha) = 100 \times \bigl(1 - \alpha \cdot (1 - w_{\infty})\bigr)\%$$
|
| 77 |
+
|
| 78 |
+
2. **Kinetic & Temperature Integration**:
|
| 79 |
+
The conversion-dependent apparent activation energy profile $E_a(\alpha)$ predicted by `bpDNN2Ea` is mapped to an adaptive kinetic solver. The system compares a library of 130 mechanisms (such as diffusion, nucleation, geometrical, and reaction-order models in series/parallel/hybrid modes) and uses a **Genetic Algorithm (GA)** coupled with non-linear optimization (`fmincon`) to solve the Kissinger-Arrhenius equations:
|
| 80 |
+
$$G(\alpha) = \int_{T_{0}}^{T} \frac{A}{\beta} \exp\left(-\frac{E_a(\alpha)}{R T}\right) dT$$
|
| 81 |
+
Solving this equation gives the temperature trajectory $T(\alpha)$ and pre-exponential factor $A$.
|
| 82 |
+
|
| 83 |
+
3. **Synthesis**:
|
| 84 |
+
Combining $T(\alpha)$ (from the $E_a$ network + kinetic solver) and $w(\alpha)$ (from the Yield network) yields the completed, publication-quality TG curve ($w$ vs. $T$) without requiring numerical interpolation.
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
## 📊 Comprehensive Feedstock Input Feature Map (19 Core Attributes)
|
| 89 |
+
|
| 90 |
+
For reference, the 19 basic feedstock input characteristics representing the biomass sample are organized below:
|
| 91 |
+
|
| 92 |
+
| Col Index | Feature Name | Description / Physical Meaning | Unit |
|
| 93 |
+
| :--- | :--- | :--- | :--- |
|
| 94 |
+
| **1** | Location / Source | Geographic region identifier | Class ID |
|
| 95 |
+
| **2** | Volatile Matter | Proximate analysis of volatile substances | wt.% (dry-basis) |
|
| 96 |
+
| **3** | Fixed Carbon | Proximate analysis of fixed carbon | wt.% (dry-basis) |
|
| 97 |
+
| **4** | Ash Content | Proximate analysis of inorganic residue | wt.% (dry-basis) |
|
| 98 |
+
| **5** | Carbon (C) | Ultimate analysis of elemental Carbon | wt.% (dry-basis) |
|
| 99 |
+
| **6** | Hydrogen (H) | Ultimate analysis of elemental Hydrogen | wt.% (dry-basis) |
|
| 100 |
+
| **7** | Oxygen (O) | Ultimate analysis of elemental Oxygen | wt.% (dry-basis) |
|
| 101 |
+
| **8** | Nitrogen (N) | Ultimate analysis of elemental Nitrogen | wt.% (dry-basis) |
|
| 102 |
+
| **9** | Sulfur (S) | Ultimate analysis of elemental Sulfur | wt.% (dry-basis) |
|
| 103 |
+
| **10** | $SiO_2$ | Silica percentage in biomass ash | wt.% of ash |
|
| 104 |
+
| **11** | $Al_2O_3$ | Alumina percentage in biomass ash | wt.% of ash |
|
| 105 |
+
| **12** | $Fe_2O_3$ | Iron oxide percentage in biomass ash | wt.% of ash |
|
| 106 |
+
| **13** | $CaO$ | Calcium oxide percentage in biomass ash | wt.% of ash |
|
| 107 |
+
| **14** | $MgO$ | Magnesium oxide percentage in biomass ash | wt.% of ash |
|
| 108 |
+
| **15** | $TiO_2$ | Titanium dioxide percentage in biomass ash | wt.% of ash |
|
| 109 |
+
| **16** | $Na_2O$ | Sodium oxide percentage in biomass ash | wt.% of ash |
|
| 110 |
+
| **17** | $K_2O$ | Potassium oxide percentage in biomass ash | wt.% of ash |
|
| 111 |
+
| **18** | $P_2O_5$ | Phosphorus pentoxide percentage in biomass ash | wt.% of ash |
|
| 112 |
+
| **19** | $SO_3$ | Sulfur trioxide percentage in biomass ash | wt.% of ash |
|
| 113 |
+
|
| 114 |
+
*Note: For the $E_a$ network, column 20 is the degree of conversion ($\alpha$), and columns 21–256 contain mixed feedstock attributes. For the Yield network, columns 20–259 contain mixed feedstock attributes.*
|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
+
## 💻 MATLAB Inference Implementation Code
|
| 119 |
+
|
| 120 |
+
To run predictions using the trained `.mat` model cards locally, you can use the following MATLAB script:
|
| 121 |
+
|
| 122 |
+
```matlab
|
| 123 |
+
%% PyroBot Foundation Models: Inference Example
|
| 124 |
+
% Clear workspace
|
| 125 |
+
clear; clc;
|
| 126 |
+
|
| 127 |
+
% Configure paths to find the bpDNN2Ea and bpDNN2Yield directories
|
| 128 |
+
addpath('bpDNN2Ea');
|
| 129 |
+
addpath('bpDNN2Yield');
|
| 130 |
+
|
| 131 |
+
%% 1. Load the Pre-trained Surrogates
|
| 132 |
+
fprintf('=== Loading PyroBot Foundation Models ===\n');
|
| 133 |
+
|
| 134 |
+
EaModelStruct = load('bpDNN2Ea/Results_trained.mat');
|
| 135 |
+
netEa = EaModelStruct.net;
|
| 136 |
+
PS_Ea = EaModelStruct.PS;
|
| 137 |
+
TS_Ea = EaModelStruct.TS;
|
| 138 |
+
|
| 139 |
+
YieldModelStruct = load('bpDNN2Yield/Results_trained.mat');
|
| 140 |
+
netYield = YieldModelStruct.net;
|
| 141 |
+
PS_Y = YieldModelStruct.PS;
|
| 142 |
+
TS_Y = YieldModelStruct.TS;
|
| 143 |
+
|
| 144 |
+
fprintf('Models loaded successfully!\n\n');
|
| 145 |
+
|
| 146 |
+
%% 2. Define Sample Biomass (e.g. Corn Stover Base Features)
|
| 147 |
+
% Define the 19 core ultimate, proximate, and ash compositions
|
| 148 |
+
basicBiomassFeatures = [ ...
|
| 149 |
+
1.00, ... % Location ID
|
| 150 |
+
72.50, ... % Volatile Matter (%)
|
| 151 |
+
18.20, ... % Fixed Carbon (%)
|
| 152 |
+
9.30, ... % Ash (%)
|
| 153 |
+
43.10, ... % C (%)
|
| 154 |
+
5.60, ... % H (%)
|
| 155 |
+
41.50, ... % O (%)
|
| 156 |
+
0.45, ... % N (%)
|
| 157 |
+
0.05, ... % S (%)
|
| 158 |
+
35.20, ... % SiO2 (% of ash)
|
| 159 |
+
2.10, ... % Al2O3 (% of ash)
|
| 160 |
+
1.80, ... % Fe2O3 (% of ash)
|
| 161 |
+
12.40, ... % CaO (% of ash)
|
| 162 |
+
4.10, ... % MgO (% of ash)
|
| 163 |
+
0.15, ... % TiO2 (% of ash)
|
| 164 |
+
0.80, ... % Na2O (% of ash)
|
| 165 |
+
18.50, ... % K2O (% of ash)
|
| 166 |
+
3.20, ... % P2O5 (% of ash)
|
| 167 |
+
1.50 ... % SO3 (% of ash)
|
| 168 |
+
];
|
| 169 |
+
|
| 170 |
+
% Construct blending/mixing parameters (zero-padded for single pure biomass)
|
| 171 |
+
feedstockMixingEa = zeros(1, 236);
|
| 172 |
+
feedstockMixingYield = zeros(1, 240);
|
| 173 |
+
|
| 174 |
+
%% 3. Predict Pyrolysis Yields
|
| 175 |
+
% Prepare input for Yield Network: (259 features x 1 sample)
|
| 176 |
+
yieldInput = [basicBiomassFeatures, feedstockMixingYield]';
|
| 177 |
+
|
| 178 |
+
% Switch global normalization handlers for nnpredict
|
| 179 |
+
global PS TS
|
| 180 |
+
PS = PS_Y;
|
| 181 |
+
TS = TS_Y;
|
| 182 |
+
|
| 183 |
+
% Run forward propagation through the Yield surrogate
|
| 184 |
+
yieldPred = nnpredict(netYield, yieldInput);
|
| 185 |
+
|
| 186 |
+
charYield = yieldPred(1);
|
| 187 |
+
liquidYield = yieldPred(2);
|
| 188 |
+
gasYield = yieldPred(3);
|
| 189 |
+
|
| 190 |
+
fprintf('=== Predicted Pyrolysis Yields ===\n');
|
| 191 |
+
fprintf('Char (Solid) Yield: %.2f %%\n', charYield);
|
| 192 |
+
fprintf('Liquid/Oil Yield: %.2f %%\n', liquidYield);
|
| 193 |
+
fprintf('Gas Yield: %.2f %%\n', gasYield);
|
| 194 |
+
fprintf('Sum Check: %.2f %%\n\n', sum(yieldPred));
|
| 195 |
+
|
| 196 |
+
%% 4. Predict Apparent Activation Energy (Ea) vs. Pyrolysis Progress (Alpha)
|
| 197 |
+
% Define conversion levels (alpha from 0.02 to 0.98)
|
| 198 |
+
alphaList = 0.02:0.02:0.98;
|
| 199 |
+
numAlpha = length(alphaList);
|
| 200 |
+
eaInputs = zeros(numAlpha, 256);
|
| 201 |
+
|
| 202 |
+
for i = 1:numAlpha
|
| 203 |
+
% Ea input structure: [basicFeatures(1-19), alpha(20), feedstockMixing(21-256)]
|
| 204 |
+
eaInputs(i, :) = [basicBiomassFeatures, alphaList(i), feedstockMixingEa];
|
| 205 |
+
end
|
| 206 |
+
|
| 207 |
+
% Transpose to (256 features x numAlpha samples) for network evaluation
|
| 208 |
+
sampleInpEa = eaInputs';
|
| 209 |
+
|
| 210 |
+
% Switch global normalization handlers to Ea Network scaling
|
| 211 |
+
PS = PS_Ea;
|
| 212 |
+
TS = TS_Ea;
|
| 213 |
+
|
| 214 |
+
% Run forward propagation through the Ea surrogate
|
| 215 |
+
EaPred_kJ = nnpredict(netEa, sampleInpEa);
|
| 216 |
+
|
| 217 |
+
fprintf('=== Predicted Apparent Activation Energies ===\n');
|
| 218 |
+
fprintf('Alpha = 0.10: Ea = %.2f kJ/mol\n', EaPred_kJ(alphaList == 0.10));
|
| 219 |
+
fprintf('Alpha = 0.50: Ea = %.2f kJ/mol\n', EaPred_kJ(alphaList == 0.50));
|
| 220 |
+
fprintf('Alpha = 0.90: Ea = %.2f kJ/mol\n', EaPred_kJ(alphaList == 0.90));
|
| 221 |
+
fprintf('Average Ea: %.2f kJ/mol\n', mean(EaPred_kJ));
|
| 222 |
+
|
| 223 |
+
%% 5. Reconstruct Monotonic Mass Loss (TG) Curve
|
| 224 |
+
w_inf = charYield / 100; % Final residue mass fraction
|
| 225 |
+
w_t = (1 - alphaList .* (1 - w_inf)) * 100; % Remaining mass percentage (%)
|
| 226 |
+
|
| 227 |
+
fprintf('\nTG Curve Endpoint Platform (w_inf): %.2f %%\n', w_inf * 100);
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
To run this model, make sure you include the deep neural network framework helper utility files: `nnpreprocess.m`, `nnpostprocess.m`, and `nnpredict.m` which compute standard forward propagation, multi-layer activation maps (`logsig`, `tansig`), and apply scale scaling/restoration according to the matrices in `Results_trained.mat`.
|
| 231 |
+
|
| 232 |
+
---
|
| 233 |
+
|
| 234 |
+
## 📜 License & Citation
|
| 235 |
+
|
| 236 |
+
These models are distributed under the **Apache License 2.0**.
|
| 237 |
+
|
| 238 |
+
If you use **PyroBot** or these foundation pyrolysis surrogate networks in your scientific publications or research, please cite our corresponding work:
|
| 239 |
+
|
| 240 |
+
```bibtex
|
| 241 |
+
@article{pyrobot2026,
|
| 242 |
+
title={PyroBot: An Autonomous Agent Framework powered by Foundation Surrogate Deep Neural Networks for Intelligent Biomass Pyrolysis Simulation},
|
| 243 |
+
author={Tang, Siqi and et al.},
|
| 244 |
+
journal={Journal of Analytical and Applied Pyrolysis / Fuel / Environmental Science},
|
| 245 |
+
year={2026},
|
| 246 |
+
volume={xx},
|
| 247 |
+
pages={xx},
|
| 248 |
+
doi={xx}
|
| 249 |
+
}
|
| 250 |
+
```
|