damocles 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. damocles-0.2.0/LICENSE +21 -0
  2. damocles-0.2.0/PKG-INFO +314 -0
  3. damocles-0.2.0/README.md +297 -0
  4. damocles-0.2.0/pyproject.toml +34 -0
  5. damocles-0.2.0/setup.cfg +4 -0
  6. damocles-0.2.0/src/damocles/__init__.py +33 -0
  7. damocles-0.2.0/src/damocles/ac3314.py +342 -0
  8. damocles-0.2.0/src/damocles/allowables.py +53 -0
  9. damocles-0.2.0/src/damocles/cli.py +47 -0
  10. damocles-0.2.0/src/damocles/data/ac3314_anomalies.json +1062 -0
  11. damocles-0.2.0/src/damocles/data/ac3314_pod.json +59 -0
  12. damocles-0.2.0/src/damocles/data/materials.json +63 -0
  13. damocles-0.2.0/src/damocles/fracture.py +318 -0
  14. damocles-0.2.0/src/damocles/inspection.py +131 -0
  15. damocles-0.2.0/src/damocles/materials.py +97 -0
  16. damocles-0.2.0/src/damocles/nasgro.py +137 -0
  17. damocles-0.2.0/src/damocles/newman_raju.py +163 -0
  18. damocles-0.2.0/src/damocles/plots.py +84 -0
  19. damocles-0.2.0/src/damocles/random_vars.py +137 -0
  20. damocles-0.2.0/src/damocles/reliability.py +117 -0
  21. damocles-0.2.0/src/damocles/sampling.py +57 -0
  22. damocles-0.2.0/src/damocles/sensitivity.py +51 -0
  23. damocles-0.2.0/src/damocles/spectrum.py +159 -0
  24. damocles-0.2.0/src/damocles/study.py +231 -0
  25. damocles-0.2.0/src/damocles.egg-info/PKG-INFO +314 -0
  26. damocles-0.2.0/src/damocles.egg-info/SOURCES.txt +42 -0
  27. damocles-0.2.0/src/damocles.egg-info/dependency_links.txt +1 -0
  28. damocles-0.2.0/src/damocles.egg-info/entry_points.txt +2 -0
  29. damocles-0.2.0/src/damocles.egg-info/requires.txt +7 -0
  30. damocles-0.2.0/src/damocles.egg-info/top_level.txt +1 -0
  31. damocles-0.2.0/tests/test_ac3314.py +111 -0
  32. damocles-0.2.0/tests/test_allowables.py +51 -0
  33. damocles-0.2.0/tests/test_coin_grating.py +41 -0
  34. damocles-0.2.0/tests/test_fracture.py +133 -0
  35. damocles-0.2.0/tests/test_inspection.py +96 -0
  36. damocles-0.2.0/tests/test_materials.py +71 -0
  37. damocles-0.2.0/tests/test_nasgro.py +96 -0
  38. damocles-0.2.0/tests/test_newman_raju.py +89 -0
  39. damocles-0.2.0/tests/test_random_vars.py +63 -0
  40. damocles-0.2.0/tests/test_reliability.py +71 -0
  41. damocles-0.2.0/tests/test_sampling.py +51 -0
  42. damocles-0.2.0/tests/test_sensitivity.py +47 -0
  43. damocles-0.2.0/tests/test_spectrum.py +115 -0
  44. damocles-0.2.0/tests/test_study.py +106 -0
damocles-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexandros Marinopoulos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.4
2
+ Name: damocles
3
+ Version: 0.2.0
4
+ Summary: Probabilistic damage tolerance: Monte Carlo fatigue crack growth, inspection planning and fleet risk
5
+ Author-email: Alexandros Marinopoulos <alexandros.marino@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: numpy>=1.24
11
+ Requires-Dist: scipy>=1.11
12
+ Requires-Dist: matplotlib>=3.7
13
+ Requires-Dist: pyyaml>=6.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7; extra == "dev"
16
+ Dynamic: license-file
17
+
18
+ # DAmage tolerance MOnte Carlo Life Estimation Suite (DAMOCLES)
19
+
20
+ Monte Carlo fatigue crack growth for safety-critical metallic structure,
21
+ with the NASGRO equation, Newman-Raju stress intensity solutions,
22
+ inspection planning against probability-of-detection curves, and the FAA
23
+ AC 33.14-1 hard alpha rotor assessment. Every physics and statistics
24
+ module is verified against an exact or published reference, and the
25
+ package reproduces the FAA's own calibration test case inside the
26
+ acceptance bands the Advisory Circular publishes for qualifying
27
+ probabilistic rotor codes.
28
+
29
+ ## What it does
30
+
31
+ You describe a component as distributions instead of point values:
32
+ initial flaw size, stress per cycle (constant amplitude or a rainflow
33
+ counted spectrum), fracture toughness, growth rate coefficient. For each
34
+ study DAMOCLES produces:
35
+
36
+ - probability of failure over the service life, with an exact
37
+ Clopper-Pearson confidence interval and the equivalent reliability
38
+ index beta
39
+ - the same number with a scheduled inspection program applied: residual
40
+ risk, risk reduction, and expected detections per part, given an NDT
41
+ capability stated as a POD curve (lognormal a50/a90 or the digitized
42
+ AC 33.14-1 curves)
43
+ - the probability-of-failure history over cycles, for setting intervals
44
+ - total and first-order Sobol indices on log life, so the input scatter
45
+ that actually drives the answer is identified before money is spent
46
+ characterising one that does not
47
+ - for titanium rotors: the zone-based AC 33.14-1 hard alpha assessment
48
+ with the published anomaly exceedance curves and ultrasonic POD
49
+
50
+ The sampling engine offers plain Monte Carlo, Latin hypercube and
51
+ scrambled Sobol sequences, plus importance sampling with likelihood
52
+ reweighting for failure probabilities of 1e-5 and below, where plain
53
+ sampling wastes nearly every draw.
54
+
55
+ ## Why the calibration test case matters
56
+
57
+ AC 33.14-1 Section 3 requires each engine manufacturer to calibrate its
58
+ probabilistic tools against the Appendix 1 test case, a titanium ring
59
+ disk with fully specified geometry, loading, material and anomaly
60
+ distribution: "Test case results in the ranges from 1.27E-09 to 1.93E-09
61
+ (for the 'no inspection' case) and from 8.36E-10 to 1.53E-09 (for the
62
+ 'with in-service inspection' case) are considered acceptable." That is
63
+ the qualification gate the FAA wrote for codes like DARWIN. DAMOCLES runs
64
+ the test case in closed form (the test case physics is deterministic
65
+ given anomaly size, so the risk reduces to a one-dimensional integral
66
+ over the exceedance curve) and again by Monte Carlo through its own
67
+ sampling engine, and lands inside both bands. The run is a unit test, so
68
+ the claim is re-verified on every commit.
69
+
70
+ One detail discovered on the way: the 2017 Change 1 tabulation of the
71
+ anomaly distribution (Table A3-1) differs from the original 2001 figure
72
+ A3-7 by factors of several in the 1,000 to 5,000 square mil region that
73
+ dominates the test case risk. The acceptance band predates Change 1, so
74
+ the calibration must run on the 2001 curve. DAMOCLES bundles both vintages,
75
+ digitized from the official PDFs, and documents which one each
76
+ assessment uses.
77
+
78
+ ## The data
79
+
80
+ Everything numeric ships with provenance:
81
+
82
+ - NASGRO 4.0 equation fits for 2024-T3 sheet, 7075-T651 plate, 2014-T6
83
+ sheet and 7475-T7351 plate, read from DOT/FAA/AR-05/15 (the FAA
84
+ fatigue crack growth database report, Forman et al., 2005), with
85
+ Walker fits where published. Stored in the printed US customary units
86
+ and converted to SI on load.
87
+ - The generic Ti-6Al-4V average-air Paris fit specified by the AC
88
+ 33.14-1 test case (MCIC-HB-01R via the AC).
89
+ - The complete AC 33.14-1 Change 1 Table A3-1 hard alpha exceedance
90
+ table (184 rows, four billet/forging inspection levels), verbatim,
91
+ plus the 2001 figure A3-7 curve digitized from the official PDF's
92
+ vector art.
93
+ - The five AC 33.14-1 Appendix 5 POD curves (UT at three calibration
94
+ levels, FPI, eddy current), digitized the same way; the AC publishes
95
+ them only as graphs.
96
+
97
+ None of this is design data. The sources are public; check them, and
98
+ substitute your own basis values for anything that matters.
99
+
100
+ ## How the numbers hold up
101
+
102
+ Every claim is enforced by the test suite on each commit (CI on Linux
103
+ and Windows, Python 3.10 to 3.14). Measured results:
104
+
105
+ | Check | Reference | Result |
106
+ | --- | --- | --- |
107
+ | AC 33.14-1 calibration, no inspection | acceptance 1.27e-9 to 1.93e-9 events/cycle | 1.44e-9, PASS |
108
+ | AC 33.14-1 calibration, with inspection at 10,000 cycles | acceptance 8.36e-10 to 1.53e-9 | 1.28e-9, PASS |
109
+ | Quadrature vs the Monte Carlo engine on the inspected test case | internal cross-check | agree within 0.5% |
110
+ | Crack growth life integration | closed-form Paris solution, two exponents | within 0.5% |
111
+ | Failure probability estimator | exact normal R-S problem, pof = 2.035e-4 | CI brackets truth |
112
+ | Importance sampling | same reference, equal sample count | estimator CoV 5x below plain MC |
113
+ | Sobol sensitivity indices | Ishigami closed-form values | within 0.03 absolute |
114
+ | Tolerance factors kB, kA | published MMPDS/CMH-17 values (n=10: 2.355, 3.981) | match to 0.005 |
115
+ | B-basis confidence | simulation across 2,000 datasets | 95% coverage confirmed |
116
+ | NASGRO rates, 2024-T3 | the FCGD spline fits of the same data | within a factor of 1.8 |
117
+ | Newman-Raju limit cases | published F = 1.04 and 1.11 limits, NASA TM-85793 | match within 1% |
118
+ | Rainflow counting | ASTM E1049-85 worked example | exact cycle table |
119
+ | Hoop stress of the AC test disk | AC quoted bore stress 572.4 MPa | 574.2 MPa analytic |
120
+
121
+ ## Quickstart
122
+
123
+ Needs Python 3.10+.
124
+
125
+ ```
126
+ pip install -e .
127
+ damocles examples/ti64_disk_bore.yaml --sensitivity --plot out/
128
+ python examples/ac3314_test_case.py
129
+ python -m pytest -q
130
+ ```
131
+
132
+ The first command runs a corner crack study at a compressor disk bore on
133
+ the AC Ti-6-4 material and prints:
134
+
135
+ ```
136
+ P(failure), no inspection : 9.295e-03
137
+ 95% CI : [8.879e-03, 9.725e-03]
138
+ reliability index beta : 2.35
139
+
140
+ inspections at : 4,000, 8,000, 12,000, 16,000
141
+ P(failure), inspected : 8.221e-05
142
+ risk reduction : 99.1%
143
+ expected detections/part: 2.712e-01
144
+
145
+ target P(failure) : 1.0e-03 -> MEETS target
146
+
147
+ variance drivers (total Sobol index on log-life):
148
+ initial_flaw total=0.554
149
+ paris_c total=0.371
150
+ stress_range total=0.077
151
+ toughness total=0.000
152
+ ```
153
+
154
+ Read the bottom block before trusting the top one: here toughness
155
+ scatter is irrelevant and flaw size dominates, so the productive next
156
+ step is flaw characterisation, not more toughness coupons. A second
157
+ worked example covers a 2024-T3 fuselage skin panel on the FCGD NASGRO
158
+ fit with eddy current inspections.
159
+
160
+ ## Using it as a library
161
+
162
+ ```python
163
+ from damocles import (Lognormal, Normal, DamageToleranceStudy,
164
+ InspectionPlan, PODCurve, NewmanRajuCornerCrack,
165
+ material_growth_law)
166
+
167
+ study = DamageToleranceStudy(
168
+ "disk bore",
169
+ variables={
170
+ "initial_flaw": Lognormal(mean=1.2e-4, cov=0.6), # metres
171
+ "stress_range": Normal(mean=480.0, std=25.0), # MPa
172
+ "toughness": Normal(mean=64.5, std=4.0), # MPa sqrt(m)
173
+ },
174
+ geometry=NewmanRajuCornerCrack(thickness=0.025, width=0.08),
175
+ growth_law=material_growth_law("ti-6al-4v-ac33.14"),
176
+ service_cycles=20_000,
177
+ inspection_plan=InspectionPlan.at_interval(
178
+ 4_000, 20_000, PODCurve.from_a50_a90(0.4e-3, 1.0e-3)),
179
+ n_samples=200_000, method="lhs", seed=42)
180
+ print(study.run(sensitivity=True).summary())
181
+ ```
182
+
183
+ The pieces work standalone: `estimate_pof` takes any limit state over
184
+ named random variables (it is a general structural reliability engine),
185
+ `grow` and `grow_spectrum` integrate crack growth for arbitrary sample
186
+ arrays, `rainflow` counts a stress history per ASTM E1049, `b_basis`
187
+ and `a_basis` turn coupon data into allowables, and `ac3314.run_test_case`
188
+ is the calibration run. `CustomGeometry` accepts any Y(a) callable for
189
+ FE-derived solutions.
190
+
191
+ ## Interpreting the study output
192
+
193
+ | Field | Meaning |
194
+ | --- | --- |
195
+ | `pof`, `ci_low`, `ci_high` | failure probability at end of service, exact binomial CI |
196
+ | `reliability_index()` | equivalent beta, for comparing designs |
197
+ | `inspection.pof_inspected` | residual risk with the inspection plan applied |
198
+ | `inspection.risk_reduction` | 1 - inspected/unmitigated |
199
+ | `inspection.mean_detections` | expected detections per part over the life |
200
+ | `sensitivity[name]["total"]` | total Sobol index of that input on log life |
201
+ | `pof_curve_cycles`, `pof_curve` | the failure probability history |
202
+
203
+ Run-outs (cracks below threshold that never grow) carry infinite life
204
+ and are reported as such, not silently dropped.
205
+
206
+ ## Design allowables
207
+
208
+ `damocles.allowables` computes one-sided lower tolerance bounds from
209
+ measured samples: B-basis (90% coverage at 95% confidence) and A-basis
210
+ (99/95), using exact normal-theory factors from the noncentral t
211
+ distribution, on raw or log-transformed data. Use it to turn your own
212
+ coupon results into study inputs. The MMPDS/CMH-17 definitions apply;
213
+ the factors match the published tables and the confidence level is
214
+ verified by simulation in the test suite.
215
+
216
+ If you need the toughness input itself predicted from composition with
217
+ finite-sample guarantees, that is a different problem and a different
218
+ tool: FTQS (Fracture Toughness Qualification Suite). DAMOCLES consumes
219
+ toughness as a distribution; FTQS is one defensible way to get one for
220
+ alloys you have not tested.
221
+
222
+ ## Limitations, stated plainly
223
+
224
+ - LEFM with no load interaction: constant amplitude or repeating-block
225
+ spectra, no retardation. Order effects within a block are exactly
226
+ irrelevant under this assumption; overload retardation is not
227
+ modelled at all.
228
+ - One dominant crack per part. No multi-site damage, no continuing
229
+ damage after repair (detected parts leave the fleet).
230
+ - The AC 33.14 module covers the Appendix 1 ring disk class of problem:
231
+ axisymmetric stress, the AC's prescribed crack shapes, no surface
232
+ transition of subsurface cracks. It is a calibration-grade
233
+ implementation, not a general rotor risk code.
234
+ - The AC POD curves and the 2001 anomaly curve are digitized from the
235
+ official PDFs' vector art (the FAA never published them as numbers).
236
+ Estimated digitization accuracy is half a percent in POD and one to
237
+ two percent in size.
238
+ - NASGRO 4's threshold reparametrisation is not fully public; DK1 is
239
+ read as the long-crack R = 0 threshold per the NASA primary source,
240
+ which is the slightly conservative interpretation, and is documented
241
+ in nasgro.py.
242
+ - Inputs are independent random variables. Correlation requires a
243
+ custom limit state.
244
+ - This is not a certified tool and nothing here is design data. It is
245
+ built to certification-grade verification standards (every number
246
+ traced, every claim tested), which is a different statement.
247
+
248
+ ## Repository layout
249
+
250
+ ```
251
+ src/damocles/random_vars.py input distributions
252
+ src/damocles/sampling.py MC / LHS / Sobol sample generation
253
+ src/damocles/reliability.py pof estimation, exact CIs, importance sampling
254
+ src/damocles/fracture.py growth laws, geometry factors, life integration
255
+ src/damocles/newman_raju.py NASA TM-85793 surface and corner crack solutions
256
+ src/damocles/nasgro.py Forman-Mettu equation with Newman closure
257
+ src/damocles/spectrum.py ASTM E1049 rainflow, spectrum blocks
258
+ src/damocles/inspection.py POD curves, inspection plans, risk arithmetic
259
+ src/damocles/ac3314.py AC 33.14-1 hard alpha assessment + calibration
260
+ src/damocles/materials.py cited material database (data/materials.json)
261
+ src/damocles/sensitivity.py Sobol indices, Saltelli/Jansen estimators
262
+ src/damocles/allowables.py A- and B-basis tolerance bounds
263
+ src/damocles/study.py YAML-driven studies
264
+ src/damocles/cli.py command line entry point
265
+ docs/theory.md the equations and assumptions
266
+ docs/verification.md claim -> reference -> test matrix
267
+ examples/ disk bore, skin panel, AC test case, coin
268
+ tests/ 112 tests, all against external references
269
+ ```
270
+
271
+ The original repository was a high school Monte Carlo toy that dropped
272
+ hexagonal coins through a slotted grating. That problem is still here,
273
+ in `examples/coin_grating.py`, now solved on the reliability engine and
274
+ checked against quadrature; everything else was torn down and rebuilt.
275
+
276
+ ## Tests
277
+
278
+ ```
279
+ python -m pytest -q
280
+ ```
281
+
282
+ 112 tests, a few seconds. The verification matrix in
283
+ `docs/verification.md` maps each capability to its reference and its
284
+ test.
285
+
286
+ ## References
287
+
288
+ - FAA AC 33.14-1, Damage Tolerance for High Energy Turbine Engine
289
+ Rotors, 2001, and Change 1, 2017. Anomaly distributions, POD curves,
290
+ the calibration test case and its acceptance bands.
291
+ - Forman, Shivakumar, Cardinal, Williams, McKeighan. Fatigue Crack
292
+ Growth Database for Damage Tolerance Analysis. DOT/FAA/AR-05/15, 2005.
293
+ NASGRO and Walker fits with the underlying data.
294
+ - Newman, Raju. Stress-Intensity Factor Equations for Cracks in
295
+ Three-Dimensional Finite Bodies Subjected to Tension and Bending
296
+ Loads. NASA TM-85793, 1984. Also TP-1578 (1979) and TM-83200 (1981),
297
+ and Eng. Fract. Mech. 15 (1981) 185-192.
298
+ - Mettu, Shivakumar, Beek, Yeh, Williams, Forman, McMahon, Newman.
299
+ NASGRO 3.0: A software for analyzing aging aircraft. NASA NTRS
300
+ 19990028759. The NASGRO equation and threshold form.
301
+ - Newman. A crack opening stress equation for fatigue crack growth.
302
+ Int. J. Fracture 24 (1984). The closure function.
303
+ - Leverant, McClung, Millwater, Enright et al. Turbine Rotor Material
304
+ Design. DOT/FAA/AR-00/64, 2000. DARWIN's analysis of the AC test case.
305
+ - ASTM E1049-85, Standard Practices for Cycle Counting in Fatigue
306
+ Analysis. The rainflow rules and the worked example used as an
307
+ acceptance test.
308
+ - MIL-HDBK-1823A, Nondestructive Evaluation System Reliability
309
+ Assessment, 2009. The lognormal POD model.
310
+ - MMPDS / CMH-17 for the A- and B-basis definitions.
311
+
312
+ ## License
313
+
314
+ MIT.
@@ -0,0 +1,297 @@
1
+ # DAmage tolerance MOnte Carlo Life Estimation Suite (DAMOCLES)
2
+
3
+ Monte Carlo fatigue crack growth for safety-critical metallic structure,
4
+ with the NASGRO equation, Newman-Raju stress intensity solutions,
5
+ inspection planning against probability-of-detection curves, and the FAA
6
+ AC 33.14-1 hard alpha rotor assessment. Every physics and statistics
7
+ module is verified against an exact or published reference, and the
8
+ package reproduces the FAA's own calibration test case inside the
9
+ acceptance bands the Advisory Circular publishes for qualifying
10
+ probabilistic rotor codes.
11
+
12
+ ## What it does
13
+
14
+ You describe a component as distributions instead of point values:
15
+ initial flaw size, stress per cycle (constant amplitude or a rainflow
16
+ counted spectrum), fracture toughness, growth rate coefficient. For each
17
+ study DAMOCLES produces:
18
+
19
+ - probability of failure over the service life, with an exact
20
+ Clopper-Pearson confidence interval and the equivalent reliability
21
+ index beta
22
+ - the same number with a scheduled inspection program applied: residual
23
+ risk, risk reduction, and expected detections per part, given an NDT
24
+ capability stated as a POD curve (lognormal a50/a90 or the digitized
25
+ AC 33.14-1 curves)
26
+ - the probability-of-failure history over cycles, for setting intervals
27
+ - total and first-order Sobol indices on log life, so the input scatter
28
+ that actually drives the answer is identified before money is spent
29
+ characterising one that does not
30
+ - for titanium rotors: the zone-based AC 33.14-1 hard alpha assessment
31
+ with the published anomaly exceedance curves and ultrasonic POD
32
+
33
+ The sampling engine offers plain Monte Carlo, Latin hypercube and
34
+ scrambled Sobol sequences, plus importance sampling with likelihood
35
+ reweighting for failure probabilities of 1e-5 and below, where plain
36
+ sampling wastes nearly every draw.
37
+
38
+ ## Why the calibration test case matters
39
+
40
+ AC 33.14-1 Section 3 requires each engine manufacturer to calibrate its
41
+ probabilistic tools against the Appendix 1 test case, a titanium ring
42
+ disk with fully specified geometry, loading, material and anomaly
43
+ distribution: "Test case results in the ranges from 1.27E-09 to 1.93E-09
44
+ (for the 'no inspection' case) and from 8.36E-10 to 1.53E-09 (for the
45
+ 'with in-service inspection' case) are considered acceptable." That is
46
+ the qualification gate the FAA wrote for codes like DARWIN. DAMOCLES runs
47
+ the test case in closed form (the test case physics is deterministic
48
+ given anomaly size, so the risk reduces to a one-dimensional integral
49
+ over the exceedance curve) and again by Monte Carlo through its own
50
+ sampling engine, and lands inside both bands. The run is a unit test, so
51
+ the claim is re-verified on every commit.
52
+
53
+ One detail discovered on the way: the 2017 Change 1 tabulation of the
54
+ anomaly distribution (Table A3-1) differs from the original 2001 figure
55
+ A3-7 by factors of several in the 1,000 to 5,000 square mil region that
56
+ dominates the test case risk. The acceptance band predates Change 1, so
57
+ the calibration must run on the 2001 curve. DAMOCLES bundles both vintages,
58
+ digitized from the official PDFs, and documents which one each
59
+ assessment uses.
60
+
61
+ ## The data
62
+
63
+ Everything numeric ships with provenance:
64
+
65
+ - NASGRO 4.0 equation fits for 2024-T3 sheet, 7075-T651 plate, 2014-T6
66
+ sheet and 7475-T7351 plate, read from DOT/FAA/AR-05/15 (the FAA
67
+ fatigue crack growth database report, Forman et al., 2005), with
68
+ Walker fits where published. Stored in the printed US customary units
69
+ and converted to SI on load.
70
+ - The generic Ti-6Al-4V average-air Paris fit specified by the AC
71
+ 33.14-1 test case (MCIC-HB-01R via the AC).
72
+ - The complete AC 33.14-1 Change 1 Table A3-1 hard alpha exceedance
73
+ table (184 rows, four billet/forging inspection levels), verbatim,
74
+ plus the 2001 figure A3-7 curve digitized from the official PDF's
75
+ vector art.
76
+ - The five AC 33.14-1 Appendix 5 POD curves (UT at three calibration
77
+ levels, FPI, eddy current), digitized the same way; the AC publishes
78
+ them only as graphs.
79
+
80
+ None of this is design data. The sources are public; check them, and
81
+ substitute your own basis values for anything that matters.
82
+
83
+ ## How the numbers hold up
84
+
85
+ Every claim is enforced by the test suite on each commit (CI on Linux
86
+ and Windows, Python 3.10 to 3.14). Measured results:
87
+
88
+ | Check | Reference | Result |
89
+ | --- | --- | --- |
90
+ | AC 33.14-1 calibration, no inspection | acceptance 1.27e-9 to 1.93e-9 events/cycle | 1.44e-9, PASS |
91
+ | AC 33.14-1 calibration, with inspection at 10,000 cycles | acceptance 8.36e-10 to 1.53e-9 | 1.28e-9, PASS |
92
+ | Quadrature vs the Monte Carlo engine on the inspected test case | internal cross-check | agree within 0.5% |
93
+ | Crack growth life integration | closed-form Paris solution, two exponents | within 0.5% |
94
+ | Failure probability estimator | exact normal R-S problem, pof = 2.035e-4 | CI brackets truth |
95
+ | Importance sampling | same reference, equal sample count | estimator CoV 5x below plain MC |
96
+ | Sobol sensitivity indices | Ishigami closed-form values | within 0.03 absolute |
97
+ | Tolerance factors kB, kA | published MMPDS/CMH-17 values (n=10: 2.355, 3.981) | match to 0.005 |
98
+ | B-basis confidence | simulation across 2,000 datasets | 95% coverage confirmed |
99
+ | NASGRO rates, 2024-T3 | the FCGD spline fits of the same data | within a factor of 1.8 |
100
+ | Newman-Raju limit cases | published F = 1.04 and 1.11 limits, NASA TM-85793 | match within 1% |
101
+ | Rainflow counting | ASTM E1049-85 worked example | exact cycle table |
102
+ | Hoop stress of the AC test disk | AC quoted bore stress 572.4 MPa | 574.2 MPa analytic |
103
+
104
+ ## Quickstart
105
+
106
+ Needs Python 3.10+.
107
+
108
+ ```
109
+ pip install -e .
110
+ damocles examples/ti64_disk_bore.yaml --sensitivity --plot out/
111
+ python examples/ac3314_test_case.py
112
+ python -m pytest -q
113
+ ```
114
+
115
+ The first command runs a corner crack study at a compressor disk bore on
116
+ the AC Ti-6-4 material and prints:
117
+
118
+ ```
119
+ P(failure), no inspection : 9.295e-03
120
+ 95% CI : [8.879e-03, 9.725e-03]
121
+ reliability index beta : 2.35
122
+
123
+ inspections at : 4,000, 8,000, 12,000, 16,000
124
+ P(failure), inspected : 8.221e-05
125
+ risk reduction : 99.1%
126
+ expected detections/part: 2.712e-01
127
+
128
+ target P(failure) : 1.0e-03 -> MEETS target
129
+
130
+ variance drivers (total Sobol index on log-life):
131
+ initial_flaw total=0.554
132
+ paris_c total=0.371
133
+ stress_range total=0.077
134
+ toughness total=0.000
135
+ ```
136
+
137
+ Read the bottom block before trusting the top one: here toughness
138
+ scatter is irrelevant and flaw size dominates, so the productive next
139
+ step is flaw characterisation, not more toughness coupons. A second
140
+ worked example covers a 2024-T3 fuselage skin panel on the FCGD NASGRO
141
+ fit with eddy current inspections.
142
+
143
+ ## Using it as a library
144
+
145
+ ```python
146
+ from damocles import (Lognormal, Normal, DamageToleranceStudy,
147
+ InspectionPlan, PODCurve, NewmanRajuCornerCrack,
148
+ material_growth_law)
149
+
150
+ study = DamageToleranceStudy(
151
+ "disk bore",
152
+ variables={
153
+ "initial_flaw": Lognormal(mean=1.2e-4, cov=0.6), # metres
154
+ "stress_range": Normal(mean=480.0, std=25.0), # MPa
155
+ "toughness": Normal(mean=64.5, std=4.0), # MPa sqrt(m)
156
+ },
157
+ geometry=NewmanRajuCornerCrack(thickness=0.025, width=0.08),
158
+ growth_law=material_growth_law("ti-6al-4v-ac33.14"),
159
+ service_cycles=20_000,
160
+ inspection_plan=InspectionPlan.at_interval(
161
+ 4_000, 20_000, PODCurve.from_a50_a90(0.4e-3, 1.0e-3)),
162
+ n_samples=200_000, method="lhs", seed=42)
163
+ print(study.run(sensitivity=True).summary())
164
+ ```
165
+
166
+ The pieces work standalone: `estimate_pof` takes any limit state over
167
+ named random variables (it is a general structural reliability engine),
168
+ `grow` and `grow_spectrum` integrate crack growth for arbitrary sample
169
+ arrays, `rainflow` counts a stress history per ASTM E1049, `b_basis`
170
+ and `a_basis` turn coupon data into allowables, and `ac3314.run_test_case`
171
+ is the calibration run. `CustomGeometry` accepts any Y(a) callable for
172
+ FE-derived solutions.
173
+
174
+ ## Interpreting the study output
175
+
176
+ | Field | Meaning |
177
+ | --- | --- |
178
+ | `pof`, `ci_low`, `ci_high` | failure probability at end of service, exact binomial CI |
179
+ | `reliability_index()` | equivalent beta, for comparing designs |
180
+ | `inspection.pof_inspected` | residual risk with the inspection plan applied |
181
+ | `inspection.risk_reduction` | 1 - inspected/unmitigated |
182
+ | `inspection.mean_detections` | expected detections per part over the life |
183
+ | `sensitivity[name]["total"]` | total Sobol index of that input on log life |
184
+ | `pof_curve_cycles`, `pof_curve` | the failure probability history |
185
+
186
+ Run-outs (cracks below threshold that never grow) carry infinite life
187
+ and are reported as such, not silently dropped.
188
+
189
+ ## Design allowables
190
+
191
+ `damocles.allowables` computes one-sided lower tolerance bounds from
192
+ measured samples: B-basis (90% coverage at 95% confidence) and A-basis
193
+ (99/95), using exact normal-theory factors from the noncentral t
194
+ distribution, on raw or log-transformed data. Use it to turn your own
195
+ coupon results into study inputs. The MMPDS/CMH-17 definitions apply;
196
+ the factors match the published tables and the confidence level is
197
+ verified by simulation in the test suite.
198
+
199
+ If you need the toughness input itself predicted from composition with
200
+ finite-sample guarantees, that is a different problem and a different
201
+ tool: FTQS (Fracture Toughness Qualification Suite). DAMOCLES consumes
202
+ toughness as a distribution; FTQS is one defensible way to get one for
203
+ alloys you have not tested.
204
+
205
+ ## Limitations, stated plainly
206
+
207
+ - LEFM with no load interaction: constant amplitude or repeating-block
208
+ spectra, no retardation. Order effects within a block are exactly
209
+ irrelevant under this assumption; overload retardation is not
210
+ modelled at all.
211
+ - One dominant crack per part. No multi-site damage, no continuing
212
+ damage after repair (detected parts leave the fleet).
213
+ - The AC 33.14 module covers the Appendix 1 ring disk class of problem:
214
+ axisymmetric stress, the AC's prescribed crack shapes, no surface
215
+ transition of subsurface cracks. It is a calibration-grade
216
+ implementation, not a general rotor risk code.
217
+ - The AC POD curves and the 2001 anomaly curve are digitized from the
218
+ official PDFs' vector art (the FAA never published them as numbers).
219
+ Estimated digitization accuracy is half a percent in POD and one to
220
+ two percent in size.
221
+ - NASGRO 4's threshold reparametrisation is not fully public; DK1 is
222
+ read as the long-crack R = 0 threshold per the NASA primary source,
223
+ which is the slightly conservative interpretation, and is documented
224
+ in nasgro.py.
225
+ - Inputs are independent random variables. Correlation requires a
226
+ custom limit state.
227
+ - This is not a certified tool and nothing here is design data. It is
228
+ built to certification-grade verification standards (every number
229
+ traced, every claim tested), which is a different statement.
230
+
231
+ ## Repository layout
232
+
233
+ ```
234
+ src/damocles/random_vars.py input distributions
235
+ src/damocles/sampling.py MC / LHS / Sobol sample generation
236
+ src/damocles/reliability.py pof estimation, exact CIs, importance sampling
237
+ src/damocles/fracture.py growth laws, geometry factors, life integration
238
+ src/damocles/newman_raju.py NASA TM-85793 surface and corner crack solutions
239
+ src/damocles/nasgro.py Forman-Mettu equation with Newman closure
240
+ src/damocles/spectrum.py ASTM E1049 rainflow, spectrum blocks
241
+ src/damocles/inspection.py POD curves, inspection plans, risk arithmetic
242
+ src/damocles/ac3314.py AC 33.14-1 hard alpha assessment + calibration
243
+ src/damocles/materials.py cited material database (data/materials.json)
244
+ src/damocles/sensitivity.py Sobol indices, Saltelli/Jansen estimators
245
+ src/damocles/allowables.py A- and B-basis tolerance bounds
246
+ src/damocles/study.py YAML-driven studies
247
+ src/damocles/cli.py command line entry point
248
+ docs/theory.md the equations and assumptions
249
+ docs/verification.md claim -> reference -> test matrix
250
+ examples/ disk bore, skin panel, AC test case, coin
251
+ tests/ 112 tests, all against external references
252
+ ```
253
+
254
+ The original repository was a high school Monte Carlo toy that dropped
255
+ hexagonal coins through a slotted grating. That problem is still here,
256
+ in `examples/coin_grating.py`, now solved on the reliability engine and
257
+ checked against quadrature; everything else was torn down and rebuilt.
258
+
259
+ ## Tests
260
+
261
+ ```
262
+ python -m pytest -q
263
+ ```
264
+
265
+ 112 tests, a few seconds. The verification matrix in
266
+ `docs/verification.md` maps each capability to its reference and its
267
+ test.
268
+
269
+ ## References
270
+
271
+ - FAA AC 33.14-1, Damage Tolerance for High Energy Turbine Engine
272
+ Rotors, 2001, and Change 1, 2017. Anomaly distributions, POD curves,
273
+ the calibration test case and its acceptance bands.
274
+ - Forman, Shivakumar, Cardinal, Williams, McKeighan. Fatigue Crack
275
+ Growth Database for Damage Tolerance Analysis. DOT/FAA/AR-05/15, 2005.
276
+ NASGRO and Walker fits with the underlying data.
277
+ - Newman, Raju. Stress-Intensity Factor Equations for Cracks in
278
+ Three-Dimensional Finite Bodies Subjected to Tension and Bending
279
+ Loads. NASA TM-85793, 1984. Also TP-1578 (1979) and TM-83200 (1981),
280
+ and Eng. Fract. Mech. 15 (1981) 185-192.
281
+ - Mettu, Shivakumar, Beek, Yeh, Williams, Forman, McMahon, Newman.
282
+ NASGRO 3.0: A software for analyzing aging aircraft. NASA NTRS
283
+ 19990028759. The NASGRO equation and threshold form.
284
+ - Newman. A crack opening stress equation for fatigue crack growth.
285
+ Int. J. Fracture 24 (1984). The closure function.
286
+ - Leverant, McClung, Millwater, Enright et al. Turbine Rotor Material
287
+ Design. DOT/FAA/AR-00/64, 2000. DARWIN's analysis of the AC test case.
288
+ - ASTM E1049-85, Standard Practices for Cycle Counting in Fatigue
289
+ Analysis. The rainflow rules and the worked example used as an
290
+ acceptance test.
291
+ - MIL-HDBK-1823A, Nondestructive Evaluation System Reliability
292
+ Assessment, 2009. The lognormal POD model.
293
+ - MMPDS / CMH-17 for the A- and B-basis definitions.
294
+
295
+ ## License
296
+
297
+ MIT.
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "damocles"
7
+ version = "0.2.0"
8
+ description = "Probabilistic damage tolerance: Monte Carlo fatigue crack growth, inspection planning and fleet risk"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Alexandros Marinopoulos", email = "alexandros.marino@gmail.com" }]
13
+ dependencies = [
14
+ "numpy>=1.24",
15
+ "scipy>=1.11",
16
+ "matplotlib>=3.7",
17
+ "pyyaml>=6.0",
18
+ ]
19
+
20
+ [project.optional-dependencies]
21
+ dev = ["pytest>=7"]
22
+
23
+ [project.scripts]
24
+ damocles = "damocles.cli:main"
25
+
26
+ [tool.setuptools.packages.find]
27
+ where = ["src"]
28
+
29
+ [tool.setuptools.package-data]
30
+ damocles = ["data/*.json"]
31
+
32
+ [tool.pytest.ini_options]
33
+ testpaths = ["tests"]
34
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+