Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ from utils.data import (
|
|
| 16 |
build_cycle_life_curves, build_rate_capability,
|
| 17 |
build_msd_curves, build_ion_mobility_map,
|
| 18 |
build_dendrite_risk, diffusion_coefficient, R_GAS,
|
| 19 |
-
# SIB
|
| 20 |
SIB_STRUCTURES, SIB_FORMATION_ENERGIES, SIB_AVG_CHARGES,
|
| 21 |
SIB_CATHODE_RANKING, SIB_DIFFUSION, SIB_VOLTAGE,
|
| 22 |
SIB_PIPELINE_STAGES, SIB_SCREENED,
|
|
@@ -89,9 +89,8 @@ def load_static():
|
|
| 89 |
|
| 90 |
# ββ Sidebar ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 91 |
with st.sidebar:
|
| 92 |
-
st.markdown("## π
|
| 93 |
-
st.caption("
|
| 94 |
-
st.markdown("**De Angelis et al.** *Sci. Rep.* 14:978 (2024)")
|
| 95 |
st.divider()
|
| 96 |
|
| 97 |
st.markdown("#### Global Filters")
|
|
@@ -126,7 +125,7 @@ with st.sidebar:
|
|
| 126 |
key="sb_sib_mat",
|
| 127 |
)
|
| 128 |
st.divider()
|
| 129 |
-
st.caption("
|
| 130 |
|
| 131 |
|
| 132 |
# ββ Header & KPIs ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -142,8 +141,8 @@ kpis = [
|
|
| 142 |
("SIB Structures", "4", "NaFePOβ + NaβMnNiOβ (UC + SC)"),
|
| 143 |
("Energy RΒ² (New FF)", "0.293", "vs β0.093 prior"),
|
| 144 |
("D @300K (LiF FF)", "3.44Γ10β»βΈ", "cmΒ²/s"),
|
| 145 |
-
("NaFePOβ Eform", "β2.38 eV/atom", "DFT
|
| 146 |
-
("NaβMnNiOβ Eform", "β1.542 eV/atom", "DFT
|
| 147 |
("NaFePOβ AI Score", "89/100", "AI cathode ranking"),
|
| 148 |
("Na D (b-axis)", "8.5Γ10β»ΒΉβ° cmΒ²/s", "predicted ML-NEB"),
|
| 149 |
]
|
|
@@ -168,7 +167,7 @@ tabs = st.tabs([
|
|
| 168 |
"π€ AI Property Predictor",
|
| 169 |
"π§ͺ SEI Analysis",
|
| 170 |
"π AI Ranking Engine",
|
| 171 |
-
"π
|
| 172 |
"π· Na-Ion Battery (SIB)",
|
| 173 |
])
|
| 174 |
|
|
@@ -196,7 +195,7 @@ with tabs[0]:
|
|
| 196 |
("π", "Battery Property Predictor",
|
| 197 |
"Predicts: ionic diffusivity Β· activation energy Β· SEI stability Β· decomp. risk Β· mechanical stability Β· thermal safety Β· cycle-life Β· capacity retention"),
|
| 198 |
("π", "AI Ranking Engine",
|
| 199 |
-
"Multi-objective scoring of materials, electrolytes, additives. Final output: top candidates + predicted properties +
|
| 200 |
]
|
| 201 |
for icon, title, body in pipeline_steps:
|
| 202 |
with st.expander(f"{icon} **{title}**", expanded=False):
|
|
@@ -257,12 +256,12 @@ with tabs[0]:
|
|
| 257 |
"Diffusion coefficient & activation energy",
|
| 258 |
"SEI stability prediction",
|
| 259 |
"Electrolyte decomposition risk",
|
| 260 |
-
"LIB performance
|
| 261 |
-
"Experimental validation
|
| 262 |
],
|
| 263 |
"Tab": ["AI Ranking Engine", "ML FF Trainer", "MD Simulation Engine",
|
| 264 |
"AI Property Predictor", "SEI Analysis",
|
| 265 |
-
"AI Property Predictor", "
|
| 266 |
})
|
| 267 |
st.dataframe(deliverables, use_container_width=True, hide_index=True)
|
| 268 |
|
|
@@ -289,16 +288,16 @@ with tabs[1]:
|
|
| 289 |
if uploaded:
|
| 290 |
st.success(f"Received: **{uploaded.name}** ({uploaded.size:,} bytes) β format auto-detected, queued for processing.")
|
| 291 |
else:
|
| 292 |
-
st.caption("No file uploaded β showing
|
| 293 |
|
| 294 |
with c2:
|
| 295 |
-
st.markdown("#### Training Database Quality Metrics
|
| 296 |
quality = pd.DataFrame({
|
| 297 |
"Metric": ["Total DFT simulations", "Database entries (energy+force+charge)",
|
| 298 |
"Energy accuracy target", "Force accuracy target",
|
| 299 |
-
"Duplicate check", "Autocorrelation reduction", "
|
| 300 |
"Value": ["300+", "3,000+", "< 0.01 eV/atom", "< 5.1Γ10β»Β³ eV/Γ
",
|
| 301 |
-
"Stochastic sampling", "Minimised by design", "
|
| 302 |
})
|
| 303 |
st.dataframe(quality, use_container_width=True, hide_index=True)
|
| 304 |
|
|
@@ -339,8 +338,8 @@ with tabs[1]:
|
|
| 339 |
st.markdown("#### Simulation Campaign Log")
|
| 340 |
st.dataframe(SIM_CAMPAIGN, use_container_width=True, hide_index=True)
|
| 341 |
st.markdown("""
|
| 342 |
-
**Key
|
| 343 |
-
- DFT code: BAND (PBE functional, DZ NAO basis)
|
| 344 |
- k-point accuracy: < 0.01 eV/atom
|
| 345 |
- ab initio MD: DFTB (Grimme xTB)
|
| 346 |
- LAMMPS ReaxFF-MD: 500 ps NVT, Ξ΄t = 0.25 fs
|
|
@@ -361,7 +360,7 @@ with tabs[2]:
|
|
| 361 |
|
| 362 |
c1, c2 = st.columns([1.4, 1])
|
| 363 |
with c1:
|
| 364 |
-
st.markdown("#### Force Field Prediction Accuracy
|
| 365 |
st.plotly_chart(ff_performance_chart(FF_PERFORMANCE), use_container_width=True, key="ff_perf")
|
| 366 |
with c2:
|
| 367 |
st.markdown("#### Metrics")
|
|
@@ -596,8 +595,8 @@ with tabs[4]:
|
|
| 596 |
use_container_width=True, hide_index=True)
|
| 597 |
st.markdown("""
|
| 598 |
**FEC advantage:** 1M LiPFβ + 10% FEC has the lowest decomp. risk score (3.1) and highest LiF SEI yield
|
| 599 |
-
among liquid electrolytes. FEC decomposes selectively to produce LiF-dominant SEI,
|
| 600 |
-
DFT and ReaxFF simulations.
|
| 601 |
""")
|
| 602 |
st.markdown("#### Decomposition Products by Precursor")
|
| 603 |
st.dataframe(DECOMP_PRODUCTS, use_container_width=True, hide_index=True)
|
|
@@ -623,7 +622,7 @@ with tabs[4]:
|
|
| 623 |
st.markdown("**Predicted by:** Thermal decomposition onset temperatures from literature + ReaxFF thermal MD")
|
| 624 |
st.plotly_chart(thermal_safety_plot(THERMAL_SAFETY), use_container_width=True, key="prop_thermal")
|
| 625 |
st.dataframe(THERMAL_SAFETY, use_container_width=True, hide_index=True)
|
| 626 |
-
st.success("**LiF melting point: 1121.35 K (848 Β°C)** β far above all operating temperatures. The highest thermal stability of any SEI component.
|
| 627 |
st.error("**Thermal runaway onset: ~130 Β°C** β triggered by SEI breakdown releasing exothermic energy. LiF-rich SEI delays this onset by ~20β40 Β°C vs. organic-dominated SEI.")
|
| 628 |
|
| 629 |
# ββ P7: Cycle-Life Risk
|
|
@@ -712,7 +711,7 @@ with tabs[6]:
|
|
| 712 |
unsafe_allow_html=True)
|
| 713 |
st.caption(
|
| 714 |
"Ranks materials, additives, and electrolytes using multi-objective scoring. "
|
| 715 |
-
"Final output: top battery candidates + predicted properties + simulation evidence +
|
| 716 |
)
|
| 717 |
|
| 718 |
rank_tabs = st.tabs(["π§ͺ SEI Components", "π Electrolytes", "β‘ Anode Materials", "β Additives", "π Pareto Analysis"])
|
|
@@ -734,7 +733,7 @@ with tabs[6]:
|
|
| 734 |
.sort_values("Overall Score", ascending=False),
|
| 735 |
use_container_width=True, hide_index=True,
|
| 736 |
)
|
| 737 |
-
st.success("**Top recommendation:** 1M LiPFβ + 10% FEC in EC/DMC β highest LiF SEI formation, lowest decomp. risk among liquid electrolytes.
|
| 738 |
|
| 739 |
# ββ R3: Anode Materials
|
| 740 |
with rank_tabs[2]:
|
|
@@ -751,7 +750,7 @@ with tabs[6]:
|
|
| 751 |
st.plotly_chart(additive_ranking_chart(ADDITIVES), use_container_width=True, key="rank_add")
|
| 752 |
st.dataframe(ADDITIVES.sort_values("Overall Score", ascending=False),
|
| 753 |
use_container_width=True, hide_index=True)
|
| 754 |
-
st.success("**FEC (fluoroethylene carbonate)** is the top-ranked additive: highest LiF SEI enhancement (9.5/10), 35% cycle-life improvement, HF scavenging capability
|
| 755 |
|
| 756 |
# ββ R5: Pareto
|
| 757 |
with rank_tabs[4]:
|
|
@@ -805,7 +804,7 @@ with tabs[7]:
|
|
| 805 |
("6", "Electrolyte Decomposition Risk",
|
| 806 |
"EC/DMC+FEC: Decomp. risk 3.1/10 (lowest liquid). Onset 1.1 V vs Li/LiβΊ. Primary products: LiF (dominant), LiβCOβ. Solid electrolytes (LGPS): risk 1.5/10.",
|
| 807 |
"π₯"),
|
| 808 |
-
("7", "LIB Performance
|
| 809 |
"Capacity retention: LiF SEI >88% @200cy, >80% @500cy. Rate capability: LiF SEI maintains 300 mAh/g @10C (graphite). Thermal runaway delayed by ~30Β°C with LiF SEI.",
|
| 810 |
"π"),
|
| 811 |
("8", "Experimental Validation Recommendations",
|
|
@@ -872,34 +871,33 @@ with tabs[7]:
|
|
| 872 |
fig_params.update_yaxes(gridcolor="rgba(255,255,255,0.1)")
|
| 873 |
st.plotly_chart(fig_params, use_container_width=True, key="reaxff_params")
|
| 874 |
with c2:
|
| 875 |
-
st.markdown("####
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
|
| 891 |
|
| 892 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 893 |
-
# TAB 9 β Na-Ion Battery (SIB)
|
| 894 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 895 |
with tabs[8]:
|
| 896 |
-
st.markdown('<div class="section-hdr">Na-Ion Battery (SIB) β DFT
|
| 897 |
unsafe_allow_html=True)
|
| 898 |
st.markdown(
|
| 899 |
-
"
|
| 900 |
-
"
|
| 901 |
-
"
|
| 902 |
-
"PPT data to a specific AI workflow stage."
|
| 903 |
)
|
| 904 |
|
| 905 |
# Sub-tabs within the SIB tab
|
|
@@ -916,10 +914,10 @@ with tabs[8]:
|
|
| 916 |
|
| 917 |
# ββ SIB Sub-tab 1: DFT Database βββββββββββββββββββββββββββββββββββββββββββ
|
| 918 |
with sib_tabs[0]:
|
| 919 |
-
st.markdown("### Crystal Structure Database
|
| 920 |
st.markdown(
|
| 921 |
-
"Four fully-relaxed DFT structures computed with VASP (GGA+U)
|
| 922 |
-
"
|
| 923 |
)
|
| 924 |
|
| 925 |
# KPI row for SIB structures
|
|
@@ -978,14 +976,14 @@ with tabs[8]:
|
|
| 978 |
with sib_tabs[1]:
|
| 979 |
st.markdown("### Formation Energy Analysis β Stage 3: Formation Energy Predictor")
|
| 980 |
st.markdown(
|
| 981 |
-
"Formation energies from
|
| 982 |
"can screen **millions of hypothetical cathodes** without running DFT."
|
| 983 |
)
|
| 984 |
col1, col2, col3, col4 = st.columns(4)
|
| 985 |
with col1:
|
| 986 |
-
st.metric("NaFePOβ Eform", "β2.38 eV/atom", "DFT
|
| 987 |
with col2:
|
| 988 |
-
st.metric("NaβMnNiOβ Eform", "β1.542 eV/atom", "DFT
|
| 989 |
with col3:
|
| 990 |
st.metric("NaβVβ(POβ)β Eform", "β2.85 eV/atom", "Literature reference")
|
| 991 |
with col4:
|
|
@@ -1013,7 +1011,7 @@ with tabs[8]:
|
|
| 1013 |
with sib_tabs[2]:
|
| 1014 |
st.markdown("### Bader Charge Analysis β Stage 4: Charge Distribution Model")
|
| 1015 |
st.markdown(
|
| 1016 |
-
"Bader charges computed from
|
| 1017 |
"distribution model. These predict **oxidation state, charge transfer, and redox activity** "
|
| 1018 |
"β critical inputs to the voltage predictor."
|
| 1019 |
)
|
|
@@ -1055,7 +1053,7 @@ with tabs[8]:
|
|
| 1055 |
st.dataframe(SIB_AVG_CHARGES, use_container_width=True)
|
| 1056 |
|
| 1057 |
st.info("""
|
| 1058 |
-
**Key charge insights
|
| 1059 |
- **NaβΊ in NaFePOβ:** +0.890 e β consistent with NaβΊ ionic character
|
| 1060 |
- **Fe in NaFePOβ:** +1.486 e β confirms FeΒ²βΊ oxidation state (partially covalent FeβO bonds)
|
| 1061 |
- **P in NaFePOβ:** +5.0 e β fully ionic Pβ΅βΊ (phosphate POβΒ³β» group)
|
|
@@ -1108,7 +1106,7 @@ with tabs[8]:
|
|
| 1108 |
st.markdown("### AI Cathode Ranking β Stage 8: Intelligent Cathode Ranking")
|
| 1109 |
st.markdown(
|
| 1110 |
"The AI ranks cathode candidates using a weighted 5-property score. "
|
| 1111 |
-
"
|
| 1112 |
)
|
| 1113 |
|
| 1114 |
r1, r2, r3 = st.columns(3)
|
|
@@ -1152,11 +1150,10 @@ with tabs[8]:
|
|
| 1152 |
|
| 1153 |
# ββ SIB Sub-tab 6: AI Pipeline βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1154 |
with sib_tabs[5]:
|
| 1155 |
-
st.markdown("### 8-Stage AI Pipeline
|
| 1156 |
st.markdown(
|
| 1157 |
-
"
|
| 1158 |
-
"
|
| 1159 |
-
"ready, or in progress."
|
| 1160 |
)
|
| 1161 |
|
| 1162 |
st.plotly_chart(sib_pipeline_status(SIB_PIPELINE_STAGES),
|
|
@@ -1165,14 +1162,14 @@ with tabs[8]:
|
|
| 1165 |
st.markdown("#### Detailed Pipeline Mapping")
|
| 1166 |
for _, row in SIB_PIPELINE_STAGES.iterrows():
|
| 1167 |
status_emoji = {
|
| 1168 |
-
"Done
|
| 1169 |
"Predicted": "π£", "Training": "π΄",
|
| 1170 |
}.get(row["Status"], "βͺ")
|
| 1171 |
with st.expander(f"{status_emoji} Stage {row['Stage']}: {row['Name']} β {row['Status']}"):
|
| 1172 |
cols = st.columns(2)
|
| 1173 |
with cols[0]:
|
| 1174 |
-
st.markdown("**
|
| 1175 |
-
st.info(row["
|
| 1176 |
with cols[1]:
|
| 1177 |
st.markdown("**AI Output:**")
|
| 1178 |
st.success(row["AI Output"])
|
|
@@ -1180,7 +1177,7 @@ with tabs[8]:
|
|
| 1180 |
st.markdown("#### Legend")
|
| 1181 |
leg_cols = st.columns(5)
|
| 1182 |
for col, (color, label) in zip(leg_cols, [
|
| 1183 |
-
("π’", "Done
|
| 1184 |
("π΅", "Ready β can run immediately"),
|
| 1185 |
("π‘", "Trained β model ready"),
|
| 1186 |
("π£", "Predicted β AI output available"),
|
|
@@ -1192,7 +1189,7 @@ with tabs[8]:
|
|
| 1192 |
with sib_tabs[6]:
|
| 1193 |
st.markdown("### AI-Screened Hypothetical Cathodes β Stage 3 Output")
|
| 1194 |
st.markdown(
|
| 1195 |
-
"Once trained on the
|
| 1196 |
"screens hypothetical compositions. Below are the first 10 candidates including "
|
| 1197 |
"the two DFT-validated anchor points."
|
| 1198 |
)
|
|
@@ -1215,13 +1212,13 @@ with tabs[8]:
|
|
| 1215 |
- **X-axis:** Predicted voltage vs Na/NaβΊ (higher β more energy dense)
|
| 1216 |
- **Y-axis:** Predicted capacity in mAh/g (higher β more charge storage)
|
| 1217 |
- **Bubble size:** Absolute value of formation energy (larger β more stable)
|
| 1218 |
-
- **Colour:** Red = DFT-verified
|
| 1219 |
|
| 1220 |
**Top AI candidate:** NaβMn0.5Co0.5Oβ β highest capacity (200 mAh/g) and voltage (3.55 V)
|
| 1221 |
but lower stability (Eform = β1.72 eV/atom). Needs DFT validation.
|
| 1222 |
""")
|
| 1223 |
|
| 1224 |
-
st.markdown("#### Next DFT Calculations
|
| 1225 |
next_dft = pd.DataFrame({
|
| 1226 |
"Structure": [
|
| 1227 |
"Naβ.βββ
FePOβ (vacancy)", "Naβ.ββ
FePOβ (vacancy)",
|
|
@@ -1271,7 +1268,7 @@ with tabs[8]:
|
|
| 1271 |
with v4:
|
| 1272 |
st.metric("NaβMnNiOβ Capacity", "195 mAh/g", "2 Na per formula unit")
|
| 1273 |
|
| 1274 |
-
st.markdown("#### Voltage State Table (
|
| 1275 |
st.dataframe(SIB_VOLTAGE, use_container_width=True)
|
| 1276 |
|
| 1277 |
# Simple voltage vs capacity scatter
|
|
@@ -1282,7 +1279,7 @@ with tabs[8]:
|
|
| 1282 |
size=[20] * len(SIB_SCREENED),
|
| 1283 |
text="Material",
|
| 1284 |
title="Voltage vs Capacity β All Cathode Candidates",
|
| 1285 |
-
color_discrete_map={"DFT
|
| 1286 |
labels={"Predicted Voltage (V)": "Voltage (V vs Na/NaβΊ)"},
|
| 1287 |
)
|
| 1288 |
fig_vc.update_traces(textposition="top center", textfont_size=8)
|
|
@@ -1308,33 +1305,23 @@ with tabs[8]:
|
|
| 1308 |
|
| 1309 |
st.markdown("#### Industrial Vision β Battery Foundation Model")
|
| 1310 |
st.markdown("""
|
| 1311 |
-
|
| 1312 |
-
for the Battery Foundation Model with the following architecture:
|
| 1313 |
|
| 1314 |
| Input | AI Engine Module | Output |
|
| 1315 |
|-------|-----------------|--------|
|
| 1316 |
-
| DFT structures
|
| 1317 |
-
| Formation energies
|
| 1318 |
-
| Bader charges
|
| 1319 |
-
| Supercell structures
|
| 1320 |
| MD trajectories | Cycle-Life Predictor | Degradation forecast |
|
| 1321 |
| Experimental data | Calibration layer | Validated recommendations |
|
| 1322 |
|
| 1323 |
-
**Recommended next steps**
|
| 1324 |
1. Add vacancy structures (Naβ.βββ
FePOβ, Naβ.ββ
FePOβ)
|
| 1325 |
2. Run NEB calculations for both materials
|
| 1326 |
3. Compute elastic tensors and electronic bandgaps
|
| 1327 |
4. Integrate finite-temperature (300/500/700 K) MD trajectories
|
| 1328 |
-
5. Expand to full cathode library (10+ materials) for production
|
| 1329 |
""")
|
| 1330 |
|
| 1331 |
|
| 1332 |
-
# ββ Footer βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1333 |
-
st.divider()
|
| 1334 |
-
st.markdown(
|
| 1335 |
-
"<center><small>Battery-AI Force Field & Simulation Engine Β· "
|
| 1336 |
-
"De Angelis et al., <em>Scientific Reports</em> 14:978 (2024) Β· "
|
| 1337 |
-
"SIB data: Report June 15β19 PPT Β· "
|
| 1338 |
-
"Deployed on Hugging Face Spaces β WellmatixGenAI Β· v3.0.0</small></center>",
|
| 1339 |
-
unsafe_allow_html=True,
|
| 1340 |
-
)
|
|
|
|
| 16 |
build_cycle_life_curves, build_rate_capability,
|
| 17 |
build_msd_curves, build_ion_mobility_map,
|
| 18 |
build_dendrite_risk, diffusion_coefficient, R_GAS,
|
| 19 |
+
# SIB cathode data
|
| 20 |
SIB_STRUCTURES, SIB_FORMATION_ENERGIES, SIB_AVG_CHARGES,
|
| 21 |
SIB_CATHODE_RANKING, SIB_DIFFUSION, SIB_VOLTAGE,
|
| 22 |
SIB_PIPELINE_STAGES, SIB_SCREENED,
|
|
|
|
| 89 |
|
| 90 |
# ββ Sidebar ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 91 |
with st.sidebar:
|
| 92 |
+
st.markdown("## π Battery-AI Engine")
|
| 93 |
+
st.caption("Force Field & Simulation Platform")
|
|
|
|
| 94 |
st.divider()
|
| 95 |
|
| 96 |
st.markdown("#### Global Filters")
|
|
|
|
| 125 |
key="sb_sib_mat",
|
| 126 |
)
|
| 127 |
st.divider()
|
| 128 |
+
st.caption("Battery-ION Β· LiB + SIB")
|
| 129 |
|
| 130 |
|
| 131 |
# ββ Header & KPIs ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 141 |
("SIB Structures", "4", "NaFePOβ + NaβMnNiOβ (UC + SC)"),
|
| 142 |
("Energy RΒ² (New FF)", "0.293", "vs β0.093 prior"),
|
| 143 |
("D @300K (LiF FF)", "3.44Γ10β»βΈ", "cmΒ²/s"),
|
| 144 |
+
("NaFePOβ Eform", "β2.38 eV/atom", "DFT computed"),
|
| 145 |
+
("NaβMnNiOβ Eform", "β1.542 eV/atom", "DFT computed"),
|
| 146 |
("NaFePOβ AI Score", "89/100", "AI cathode ranking"),
|
| 147 |
("Na D (b-axis)", "8.5Γ10β»ΒΉβ° cmΒ²/s", "predicted ML-NEB"),
|
| 148 |
]
|
|
|
|
| 167 |
"π€ AI Property Predictor",
|
| 168 |
"π§ͺ SEI Analysis",
|
| 169 |
"π AI Ranking Engine",
|
| 170 |
+
"π Deliverables & Validation",
|
| 171 |
"π· Na-Ion Battery (SIB)",
|
| 172 |
])
|
| 173 |
|
|
|
|
| 195 |
("π", "Battery Property Predictor",
|
| 196 |
"Predicts: ionic diffusivity Β· activation energy Β· SEI stability Β· decomp. risk Β· mechanical stability Β· thermal safety Β· cycle-life Β· capacity retention"),
|
| 197 |
("π", "AI Ranking Engine",
|
| 198 |
+
"Multi-objective scoring of materials, electrolytes, additives. Final output: top candidates + predicted properties + ranked recommendations."),
|
| 199 |
]
|
| 200 |
for icon, title, body in pipeline_steps:
|
| 201 |
with st.expander(f"{icon} **{title}**", expanded=False):
|
|
|
|
| 256 |
"Diffusion coefficient & activation energy",
|
| 257 |
"SEI stability prediction",
|
| 258 |
"Electrolyte decomposition risk",
|
| 259 |
+
"LIB performance summary",
|
| 260 |
+
"Experimental validation roadmap",
|
| 261 |
],
|
| 262 |
"Tab": ["AI Ranking Engine", "ML FF Trainer", "MD Simulation Engine",
|
| 263 |
"AI Property Predictor", "SEI Analysis",
|
| 264 |
+
"AI Property Predictor", "Deliverables", "Deliverables"],
|
| 265 |
})
|
| 266 |
st.dataframe(deliverables, use_container_width=True, hide_index=True)
|
| 267 |
|
|
|
|
| 288 |
if uploaded:
|
| 289 |
st.success(f"Received: **{uploaded.name}** ({uploaded.size:,} bytes) β format auto-detected, queued for processing.")
|
| 290 |
else:
|
| 291 |
+
st.caption("No file uploaded β showing database statistics below.")
|
| 292 |
|
| 293 |
with c2:
|
| 294 |
+
st.markdown("#### Training Database Quality Metrics")
|
| 295 |
quality = pd.DataFrame({
|
| 296 |
"Metric": ["Total DFT simulations", "Database entries (energy+force+charge)",
|
| 297 |
"Energy accuracy target", "Force accuracy target",
|
| 298 |
+
"Duplicate check", "Autocorrelation reduction", "Data accessibility"],
|
| 299 |
"Value": ["300+", "3,000+", "< 0.01 eV/atom", "< 5.1Γ10β»Β³ eV/Γ
",
|
| 300 |
+
"Stochastic sampling", "Minimised by design", "Open-access"],
|
| 301 |
})
|
| 302 |
st.dataframe(quality, use_container_width=True, hide_index=True)
|
| 303 |
|
|
|
|
| 338 |
st.markdown("#### Simulation Campaign Log")
|
| 339 |
st.dataframe(SIM_CAMPAIGN, use_container_width=True, hide_index=True)
|
| 340 |
st.markdown("""
|
| 341 |
+
**Key simulation parameters:**
|
| 342 |
+
- DFT code: VASP/BAND (PBE functional, DZ NAO basis)
|
| 343 |
- k-point accuracy: < 0.01 eV/atom
|
| 344 |
- ab initio MD: DFTB (Grimme xTB)
|
| 345 |
- LAMMPS ReaxFF-MD: 500 ps NVT, Ξ΄t = 0.25 fs
|
|
|
|
| 360 |
|
| 361 |
c1, c2 = st.columns([1.4, 1])
|
| 362 |
with c1:
|
| 363 |
+
st.markdown("#### Force Field Prediction Accuracy")
|
| 364 |
st.plotly_chart(ff_performance_chart(FF_PERFORMANCE), use_container_width=True, key="ff_perf")
|
| 365 |
with c2:
|
| 366 |
st.markdown("#### Metrics")
|
|
|
|
| 595 |
use_container_width=True, hide_index=True)
|
| 596 |
st.markdown("""
|
| 597 |
**FEC advantage:** 1M LiPFβ + 10% FEC has the lowest decomp. risk score (3.1) and highest LiF SEI yield
|
| 598 |
+
among liquid electrolytes. FEC decomposes selectively to produce LiF-dominant SEI,
|
| 599 |
+
confirmed by DFT and ReaxFF simulations.
|
| 600 |
""")
|
| 601 |
st.markdown("#### Decomposition Products by Precursor")
|
| 602 |
st.dataframe(DECOMP_PRODUCTS, use_container_width=True, hide_index=True)
|
|
|
|
| 622 |
st.markdown("**Predicted by:** Thermal decomposition onset temperatures from literature + ReaxFF thermal MD")
|
| 623 |
st.plotly_chart(thermal_safety_plot(THERMAL_SAFETY), use_container_width=True, key="prop_thermal")
|
| 624 |
st.dataframe(THERMAL_SAFETY, use_container_width=True, hide_index=True)
|
| 625 |
+
st.success("**LiF melting point: 1121.35 K (848 Β°C)** β far above all operating temperatures. The highest thermal stability of any SEI component.")
|
| 626 |
st.error("**Thermal runaway onset: ~130 Β°C** β triggered by SEI breakdown releasing exothermic energy. LiF-rich SEI delays this onset by ~20β40 Β°C vs. organic-dominated SEI.")
|
| 627 |
|
| 628 |
# ββ P7: Cycle-Life Risk
|
|
|
|
| 711 |
unsafe_allow_html=True)
|
| 712 |
st.caption(
|
| 713 |
"Ranks materials, additives, and electrolytes using multi-objective scoring. "
|
| 714 |
+
"Final output: top battery candidates + predicted properties + simulation evidence + ranked recommendations."
|
| 715 |
)
|
| 716 |
|
| 717 |
rank_tabs = st.tabs(["π§ͺ SEI Components", "π Electrolytes", "β‘ Anode Materials", "β Additives", "π Pareto Analysis"])
|
|
|
|
| 733 |
.sort_values("Overall Score", ascending=False),
|
| 734 |
use_container_width=True, hide_index=True,
|
| 735 |
)
|
| 736 |
+
st.success("**Top recommendation:** 1M LiPFβ + 10% FEC in EC/DMC β highest LiF SEI formation, lowest decomp. risk among liquid electrolytes. Confirmed by FEC β LiF reaction pathway simulations.")
|
| 737 |
|
| 738 |
# ββ R3: Anode Materials
|
| 739 |
with rank_tabs[2]:
|
|
|
|
| 750 |
st.plotly_chart(additive_ranking_chart(ADDITIVES), use_container_width=True, key="rank_add")
|
| 751 |
st.dataframe(ADDITIVES.sort_values("Overall Score", ascending=False),
|
| 752 |
use_container_width=True, hide_index=True)
|
| 753 |
+
st.success("**FEC (fluoroethylene carbonate)** is the top-ranked additive: highest LiF SEI enhancement (9.5/10), 35% cycle-life improvement, HF scavenging capability confirmed by simulation.")
|
| 754 |
|
| 755 |
# ββ R5: Pareto
|
| 756 |
with rank_tabs[4]:
|
|
|
|
| 804 |
("6", "Electrolyte Decomposition Risk",
|
| 805 |
"EC/DMC+FEC: Decomp. risk 3.1/10 (lowest liquid). Onset 1.1 V vs Li/LiβΊ. Primary products: LiF (dominant), LiβCOβ. Solid electrolytes (LGPS): risk 1.5/10.",
|
| 806 |
"π₯"),
|
| 807 |
+
("7", "LIB Performance Summary",
|
| 808 |
"Capacity retention: LiF SEI >88% @200cy, >80% @500cy. Rate capability: LiF SEI maintains 300 mAh/g @10C (graphite). Thermal runaway delayed by ~30Β°C with LiF SEI.",
|
| 809 |
"π"),
|
| 810 |
("8", "Experimental Validation Recommendations",
|
|
|
|
| 871 |
fig_params.update_yaxes(gridcolor="rgba(255,255,255,0.1)")
|
| 872 |
st.plotly_chart(fig_params, use_container_width=True, key="reaxff_params")
|
| 873 |
with c2:
|
| 874 |
+
st.markdown("#### ReaxFF Coefficient Breakdown")
|
| 875 |
+
coeff_df = pd.DataFrame({
|
| 876 |
+
"Type": ["General", "Atoms", "Bonds", "Off-diagonal", "Angles", "Dihedral", "H-bonds"],
|
| 877 |
+
"Count": [41, 32, 16, 6, 7, 7, 4],
|
| 878 |
+
"Description": [
|
| 879 |
+
"Global FF parameters",
|
| 880 |
+
"Per atomic species",
|
| 881 |
+
"Per bond pair",
|
| 882 |
+
"Cross terms",
|
| 883 |
+
"3-body interactions",
|
| 884 |
+
"4-body torsional",
|
| 885 |
+
"Hydrogen-bond terms",
|
| 886 |
+
],
|
| 887 |
+
})
|
| 888 |
+
st.dataframe(coeff_df, use_container_width=True, hide_index=True)
|
| 889 |
|
| 890 |
|
| 891 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 892 |
+
# TAB 9 β Na-Ion Battery (SIB)
|
| 893 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 894 |
with tabs[8]:
|
| 895 |
+
st.markdown('<div class="section-hdr">Na-Ion Battery (SIB) β DFT Cathode Data</div>',
|
| 896 |
unsafe_allow_html=True)
|
| 897 |
st.markdown(
|
| 898 |
+
"DFT-computed data for two sodium-ion cathode materials: **NaFePOβ** and **NaβMnNiOβ**. "
|
| 899 |
+
"The 8-stage AI pipeline maps each DFT result to a specific AI workflow stage β "
|
| 900 |
+
"from structure encoding to intelligent cathode ranking."
|
|
|
|
| 901 |
)
|
| 902 |
|
| 903 |
# Sub-tabs within the SIB tab
|
|
|
|
| 914 |
|
| 915 |
# ββ SIB Sub-tab 1: DFT Database βββββββββββββββββββββββββββββββββββββββββββ
|
| 916 |
with sib_tabs[0]:
|
| 917 |
+
st.markdown("### Crystal Structure Database")
|
| 918 |
st.markdown(
|
| 919 |
+
"Four fully-relaxed DFT structures computed with VASP (GGA+U), "
|
| 920 |
+
"forming the **seed dataset** for the Battery Foundation Model."
|
| 921 |
)
|
| 922 |
|
| 923 |
# KPI row for SIB structures
|
|
|
|
| 976 |
with sib_tabs[1]:
|
| 977 |
st.markdown("### Formation Energy Analysis β Stage 3: Formation Energy Predictor")
|
| 978 |
st.markdown(
|
| 979 |
+
"Formation energies from DFT calculations are used to train an AI model that "
|
| 980 |
"can screen **millions of hypothetical cathodes** without running DFT."
|
| 981 |
)
|
| 982 |
col1, col2, col3, col4 = st.columns(4)
|
| 983 |
with col1:
|
| 984 |
+
st.metric("NaFePOβ Eform", "β2.38 eV/atom", "DFT")
|
| 985 |
with col2:
|
| 986 |
+
st.metric("NaβMnNiOβ Eform", "β1.542 eV/atom", "DFT")
|
| 987 |
with col3:
|
| 988 |
st.metric("NaβVβ(POβ)β Eform", "β2.85 eV/atom", "Literature reference")
|
| 989 |
with col4:
|
|
|
|
| 1011 |
with sib_tabs[2]:
|
| 1012 |
st.markdown("### Bader Charge Analysis β Stage 4: Charge Distribution Model")
|
| 1013 |
st.markdown(
|
| 1014 |
+
"Bader charges computed from DFT calculations are targets for the AI charge "
|
| 1015 |
"distribution model. These predict **oxidation state, charge transfer, and redox activity** "
|
| 1016 |
"β critical inputs to the voltage predictor."
|
| 1017 |
)
|
|
|
|
| 1053 |
st.dataframe(SIB_AVG_CHARGES, use_container_width=True)
|
| 1054 |
|
| 1055 |
st.info("""
|
| 1056 |
+
**Key charge insights:**
|
| 1057 |
- **NaβΊ in NaFePOβ:** +0.890 e β consistent with NaβΊ ionic character
|
| 1058 |
- **Fe in NaFePOβ:** +1.486 e β confirms FeΒ²βΊ oxidation state (partially covalent FeβO bonds)
|
| 1059 |
- **P in NaFePOβ:** +5.0 e β fully ionic Pβ΅βΊ (phosphate POβΒ³β» group)
|
|
|
|
| 1106 |
st.markdown("### AI Cathode Ranking β Stage 8: Intelligent Cathode Ranking")
|
| 1107 |
st.markdown(
|
| 1108 |
"The AI ranks cathode candidates using a weighted 5-property score. "
|
| 1109 |
+
"DFT-computed data (NaFePOβ: **89/100**, NaβMnNiOβ: **82/100**) anchors the ranking."
|
| 1110 |
)
|
| 1111 |
|
| 1112 |
r1, r2, r3 = st.columns(3)
|
|
|
|
| 1150 |
|
| 1151 |
# ββ SIB Sub-tab 6: AI Pipeline βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1152 |
with sib_tabs[5]:
|
| 1153 |
+
st.markdown("### 8-Stage AI Pipeline")
|
| 1154 |
st.markdown(
|
| 1155 |
+
"Each piece of DFT data maps to a specific AI pipeline stage. "
|
| 1156 |
+
"This view shows which stages are complete, ready, or in progress."
|
|
|
|
| 1157 |
)
|
| 1158 |
|
| 1159 |
st.plotly_chart(sib_pipeline_status(SIB_PIPELINE_STAGES),
|
|
|
|
| 1162 |
st.markdown("#### Detailed Pipeline Mapping")
|
| 1163 |
for _, row in SIB_PIPELINE_STAGES.iterrows():
|
| 1164 |
status_emoji = {
|
| 1165 |
+
"Done": "β
", "Ready": "π΅", "Trained": "π‘",
|
| 1166 |
"Predicted": "π£", "Training": "π΄",
|
| 1167 |
}.get(row["Status"], "βͺ")
|
| 1168 |
with st.expander(f"{status_emoji} Stage {row['Stage']}: {row['Name']} β {row['Status']}"):
|
| 1169 |
cols = st.columns(2)
|
| 1170 |
with cols[0]:
|
| 1171 |
+
st.markdown("**DFT Input:**")
|
| 1172 |
+
st.info(row["DFT Input"])
|
| 1173 |
with cols[1]:
|
| 1174 |
st.markdown("**AI Output:**")
|
| 1175 |
st.success(row["AI Output"])
|
|
|
|
| 1177 |
st.markdown("#### Legend")
|
| 1178 |
leg_cols = st.columns(5)
|
| 1179 |
for col, (color, label) in zip(leg_cols, [
|
| 1180 |
+
("π’", "Done β data already computed"),
|
| 1181 |
("π΅", "Ready β can run immediately"),
|
| 1182 |
("π‘", "Trained β model ready"),
|
| 1183 |
("π£", "Predicted β AI output available"),
|
|
|
|
| 1189 |
with sib_tabs[6]:
|
| 1190 |
st.markdown("### AI-Screened Hypothetical Cathodes β Stage 3 Output")
|
| 1191 |
st.markdown(
|
| 1192 |
+
"Once trained on the DFT-validated entries, the formation energy predictor "
|
| 1193 |
"screens hypothetical compositions. Below are the first 10 candidates including "
|
| 1194 |
"the two DFT-validated anchor points."
|
| 1195 |
)
|
|
|
|
| 1212 |
- **X-axis:** Predicted voltage vs Na/NaβΊ (higher β more energy dense)
|
| 1213 |
- **Y-axis:** Predicted capacity in mAh/g (higher β more charge storage)
|
| 1214 |
- **Bubble size:** Absolute value of formation energy (larger β more stable)
|
| 1215 |
+
- **Colour:** Red = DFT-verified, Green = AI-predicted
|
| 1216 |
|
| 1217 |
**Top AI candidate:** NaβMn0.5Co0.5Oβ β highest capacity (200 mAh/g) and voltage (3.55 V)
|
| 1218 |
but lower stability (Eform = β1.72 eV/atom). Needs DFT validation.
|
| 1219 |
""")
|
| 1220 |
|
| 1221 |
+
st.markdown("#### Next DFT Calculations Recommended")
|
| 1222 |
next_dft = pd.DataFrame({
|
| 1223 |
"Structure": [
|
| 1224 |
"Naβ.βββ
FePOβ (vacancy)", "Naβ.ββ
FePOβ (vacancy)",
|
|
|
|
| 1268 |
with v4:
|
| 1269 |
st.metric("NaβMnNiOβ Capacity", "195 mAh/g", "2 Na per formula unit")
|
| 1270 |
|
| 1271 |
+
st.markdown("#### Voltage State Table (DFT computed)")
|
| 1272 |
st.dataframe(SIB_VOLTAGE, use_container_width=True)
|
| 1273 |
|
| 1274 |
# Simple voltage vs capacity scatter
|
|
|
|
| 1279 |
size=[20] * len(SIB_SCREENED),
|
| 1280 |
text="Material",
|
| 1281 |
title="Voltage vs Capacity β All Cathode Candidates",
|
| 1282 |
+
color_discrete_map={"DFT": "#FF4757", "AI": "#4ade80"},
|
| 1283 |
labels={"Predicted Voltage (V)": "Voltage (V vs Na/NaβΊ)"},
|
| 1284 |
)
|
| 1285 |
fig_vc.update_traces(textposition="top center", textfont_size=8)
|
|
|
|
| 1305 |
|
| 1306 |
st.markdown("#### Industrial Vision β Battery Foundation Model")
|
| 1307 |
st.markdown("""
|
| 1308 |
+
The DFT-computed dataset is the **seed** for the Battery Foundation Model:
|
|
|
|
| 1309 |
|
| 1310 |
| Input | AI Engine Module | Output |
|
| 1311 |
|-------|-----------------|--------|
|
| 1312 |
+
| DFT structures | Structure Encoder (GNN) | Latent material representation |
|
| 1313 |
+
| Formation energies | Formation Energy Predictor | Screen 10βΆ candidates |
|
| 1314 |
+
| Bader charges | Charge Distribution Model | Voltage prediction |
|
| 1315 |
+
| Supercell structures | Diffusion Predictor | Na-ion conductivity |
|
| 1316 |
| MD trajectories | Cycle-Life Predictor | Degradation forecast |
|
| 1317 |
| Experimental data | Calibration layer | Validated recommendations |
|
| 1318 |
|
| 1319 |
+
**Recommended next steps:**
|
| 1320 |
1. Add vacancy structures (Naβ.βββ
FePOβ, Naβ.ββ
FePOβ)
|
| 1321 |
2. Run NEB calculations for both materials
|
| 1322 |
3. Compute elastic tensors and electronic bandgaps
|
| 1323 |
4. Integrate finite-temperature (300/500/700 K) MD trajectories
|
| 1324 |
+
5. Expand to full cathode library (10+ materials) for the production platform
|
| 1325 |
""")
|
| 1326 |
|
| 1327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|