lcf-strain-life
Readme | Physics Review | Agent Usage | Changelog | MIT License
An AI-agent-native toolkit for fatigue analysis of materials. It is a Python library plus an MCP server, so AI agents can run the whole analysis by calling tools.
Provide your own strain-controlled fatigue test data and get the standardized reduction, fitted material constants, life predictions, and plots. Results are reproducible and are saved for recall.
Why this exists: plenty of fatigue software exists, but none is built for AI agents to drive directly. The agent-native design over MCP is the point. Every capability is reachable through tools an agent can call.
Convention: all analysis uses true stress and true strain. Engineering input is converted at ingestion. The fatigue exponents
bandcare negative throughout.
What it does
| Stage | What happens |
|---|---|
| Ingest and normalize | raw time, strain, force plus parameters become true stress-strain, reading the delimited exports labs actually produce, with ASTM E606 metadata and one-call batch analysis of a whole test series |
| Cycle reduction | peak and valley per cycle, half-life cycle, cycles-to-failure N_f |
| Per-cycle metrics | stress amplitude, plastic strain amplitude, mean stress, T/C ratio, hysteresis energy |
| Strain-life fits | Basquin, Coffin-Manson, Ramberg-Osgood, transition life |
| Constant estimation | five published methods estimate the constants from tensile properties or hardness when no fatigue data exists |
| Mean stress | Morrow, modified Morrow, SWT, Walker corrections |
| Variable amplitude | rainflow, level-crossing, and peak counting (ASTM E1049), racetrack filter, spectrum life, and a Masing-memory local-strain engine (strain or load-input Neuber) validated against published SAE datasets |
| Damage | Miner, DLDR, Corten-Dolan, Woehler knee variants including Haibach |
| Notch and multiaxial | Neuber and Glinka local strain, tensor critical-plane search (Fatemi-Socie, Brown-Miller, SWT) |
| Statistics | design curves, censored maximum likelihood with lognormal or Weibull scatter, profile-likelihood design bounds, outlier screening, Dixon-Mood staircase, A/B-basis values, the random fatigue limit model |
| High temperature | frequency-modified Coffin-Manson, time-fraction creep-fatigue |
| Surface | FKM roughness factor, and the FKM size-factor formula |
| Interchange and reports | versioned material documents, pyLife and py-fatigue adapters, one-call markdown lab reports |
| Provenance | every method maps to its published source through the citations registry |
| Save and recall | results persisted per test or material, recalled without recomputation, rendered as plots |
The toolkit is general purpose and material agnostic. It centers on strain-life reduction of raw strain-controlled test data and per-cycle evolution, end to end from lab exports. Other open libraries cover parts of this ground. pyLife and reliability implement strain-life equations, and py-fatigue and fatpack cover cycle counting and stress-life. None of them focus on reducing raw LCF test data or on driving the analysis from an AI agent. It is input compatible with the pandas data shapes of pyLife and py-fatigue.
Install
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -e ".[mcp,dev]"
Requires Python 3.11 or newer.
Quick start, library
import lcf
# fit strain-life constants from per-test reduced data, here SAE 1137
fit = lcf.fit_strain_life(
total_strain_amp=[0.009, 0.007, 0.005, 0.003, 0.002, 0.00175],
stress_amp=[553, 522, 464, 405, 350, 319], # MPa, half-life
reversals=[4234, 7398, 14768, 77104, 437498, 3327958],
E=208000, # MPa
min_plastic_strain=5e-4, # exclude near-runout points from the plastic branch
)
print(fit.coffin_manson.eps_f, fit.coffin_manson.c) # about 1.11, -0.62
print(fit.basquin.sigma_f, fit.basquin.b) # about 1073 MPa, -0.084
print(fit.transition_reversals) # about 22,000 reversals
Quick start, MCP server
The MCP server is the point of this project: it is how an AI agent drives the whole analysis by calling tools.
lcf-mcp # runs the stdio MCP server
# or
python -m lcf
Register with Claude Code or Claude Desktop over stdio:
{ "mcpServers": {
"lcf": { "command": "lcf-mcp" } } }
Quick start, graphical interface (no code)
A secondary, optional interface for people who do not program and are not using an AI agent. The agent-native MCP server above is the primary way to use this toolkit. The graphical app is a thin convenience layer over the same library functions, adding no capability the tools do not already expose.
It is a guided local app in the browser: upload test files or type in reduced data, fit the constants, predict life, export plots and a report. Everything runs on your machine and no data leaves it.
pip install "lcf-strain-life[gui]"
lcf-gui
The gui extra ships with the next PyPI release. Until then, install from a
clone of this repository with pip install -e ".[gui]".
The app walks through the workflow in order: analyze raw test files, fit strain-life constants, predict life, estimate constants when no fatigue data exists, and export. A bundled published example dataset (SAE 1137) lets you try the whole flow without any files.
A standalone Windows exe (no Python needed) is attached to GitHub releases starting with the next release. Download it, double-click, and the app opens in the browser. Two honest caveats: the exe unpacks itself on every launch, so starting takes a while, and it is currently unsigned, so Windows SmartScreen will warn on first run. Choose "More info", then "Run anyway".
Documentation
- The documentation site renders installation, usage, a tutorial reproducing a published SAE 1137 analysis, the statistics guide, and the API reference.
- docs/PHYSICS_REVIEW.md is the science-only physics record: every equation defined and cited, no software detail. docs/PHYSICS_REVIEW.pdf is the same content typeset with a reviewer sign-off table, the file to share with a materials scientist for review.
- examples/ holds runnable scripts: a strain-life fit and a machine-style CSV ingestion.
- docs/AGENT_USAGE.md describes the MCP tools and the compute, save, recall pattern for AI agents using the toolkit.
- CHANGELOG.md is the chronological log of changes.
Open data
The toolkit defines versioned, machine-readable interchange formats for
strain-life data, specified in docs/INTERCHANGE.md
with JSON Schemas in docs/schemas/. A citable seed
collection ships at
docs/data/seed_collection.json, six
published SAE 1137 tests and three verified constant sets, every value
re-tabulated from its cited source. It is a schema-reference seed, not yet
a database at scale. Contributions of strain-controlled data, especially
with per-cycle evolution, are welcome under the rules in
docs/CONTRIBUTING-DATA.md, and lcf-validate
checks any document from the command line.
Project layout
src/lcf/ core library and MCP server
tests/ unit tests including golden-value validation, SAE 1137
examples/ runnable example scripts
docs/ documentation site sources, physics PDF, interchange
spec, JSON Schemas, and the seed data collection
website/ the landing page, plain HTML and CSS
Authors and citation
David Fieser and Hugh Shortt. Both authors contributed equally to this project. To cite the software, use the "Cite this repository" button on GitHub or CITATION.cff.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lcf_strain_life-0.2.0.tar.gz.
File metadata
- Download URL: lcf_strain_life-0.2.0.tar.gz
- Upload date:
- Size: 605.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a9b7bd665ab8d3f2939cee524b42d86fc74cae7929cd0d7b0acc4b558817ba
|
|
| MD5 |
0c4e713c2ec327eab025a31f3991239f
|
|
| BLAKE2b-256 |
f46a3f9435ad6f1884e8d875687295511bb924673a731a4e9052dfbc4aa984e9
|
Provenance
The following attestation bundles were made for lcf_strain_life-0.2.0.tar.gz:
Publisher:
publish.yml on dfieser/lcf-strain-life
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcf_strain_life-0.2.0.tar.gz -
Subject digest:
93a9b7bd665ab8d3f2939cee524b42d86fc74cae7929cd0d7b0acc4b558817ba - Sigstore transparency entry: 2228783513
- Sigstore integration time:
-
Permalink:
dfieser/lcf-strain-life@965892f344e3ca7b50750d74a1b9fb2fbbfda4a6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dfieser
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@965892f344e3ca7b50750d74a1b9fb2fbbfda4a6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lcf_strain_life-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lcf_strain_life-0.2.0-py3-none-any.whl
- Upload date:
- Size: 146.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44e3add1e8e9dd4ab14e319ee90307dd2fbf2406ddffc9bf7831ab0b0a9da757
|
|
| MD5 |
d5dcab53fcc481047e40fbd2a90c7eb6
|
|
| BLAKE2b-256 |
4f3a9827dbbf48d5410e68e80ce422e1f6ff2ced485bfa3b7361c21e129d2133
|
Provenance
The following attestation bundles were made for lcf_strain_life-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on dfieser/lcf-strain-life
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcf_strain_life-0.2.0-py3-none-any.whl -
Subject digest:
44e3add1e8e9dd4ab14e319ee90307dd2fbf2406ddffc9bf7831ab0b0a9da757 - Sigstore transparency entry: 2228783776
- Sigstore integration time:
-
Permalink:
dfieser/lcf-strain-life@965892f344e3ca7b50750d74a1b9fb2fbbfda4a6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dfieser
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@965892f344e3ca7b50750d74a1b9fb2fbbfda4a6 -
Trigger Event:
push
-
Statement type: