delta-theory 6.10.5__py3-none-any.whl → 8.1.0__py3-none-any.whl

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.
core/__init__.py CHANGED
@@ -1,25 +1,91 @@
1
1
  """
2
2
  δ-Theory Core Library
3
3
  =====================
4
- Unified yield stress and fatigue life prediction based on geometric first principles.
4
+ Unified materials science prediction based on geometric first principles.
5
+
6
+ "Nature is Geometry" - All material properties emerge from crystal structure.
5
7
 
6
8
  Modules:
7
9
  - unified_yield_fatigue_v6_9: Main yield + fatigue model (v6.9b)
10
+ - unified_flc_v7: Forming Limit Curve + Forming-Fatigue Integration (v7.2/v8.0)
8
11
  - dbt_unified: Ductile-Brittle Transition Temperature prediction
9
12
  - materials: Material database
10
13
  - fatigue_redis_api: FatigueData-AM2022 Redis API (optional)
14
+
15
+ Version History:
16
+ v5.0 - Yield stress from δ-theory (f_d, E_bond, crystal geometry)
17
+ v6.9b - Unified yield + fatigue with multiaxial (τ/σ, R)
18
+ v6.10 - Universal fatigue validation (2472 points, 5 AM materials)
19
+ v7.2 - FLC from free volume consumption
20
+ v8.0 - Forming-Fatigue integration (η → r_th_eff)
21
+
22
+ Example:
23
+ >>> from delta_theory import calc_sigma_y, MATERIALS
24
+ >>> sigma_y = calc_sigma_y(MATERIALS['Fe'])
25
+
26
+ >>> from delta_theory import FLCPredictor
27
+ >>> flc = FLCPredictor()
28
+ >>> Em = flc.predict(beta=0.0, material='SPCC')
29
+
30
+ >>> from delta_theory import FormingFatigueIntegrator
31
+ >>> integrator = FormingFatigueIntegrator()
32
+ >>> r_th_eff = integrator.effective_r_th(eta_forming=0.4, structure='BCC')
11
33
  """
12
34
 
35
+ # ==============================================================================
36
+ # Core: Yield + Fatigue (v6.9b)
37
+ # ==============================================================================
13
38
  from .unified_yield_fatigue_v6_9 import (
39
+ # Material dataclass
14
40
  Material,
15
41
  MATERIALS,
42
+
43
+ # Yield stress
16
44
  calc_sigma_y,
45
+ sigma_base_delta,
46
+ delta_sigma_ss,
47
+ delta_sigma_taylor,
48
+ delta_sigma_ppt,
49
+
50
+ # Fatigue
17
51
  fatigue_life_const_amp,
18
52
  generate_sn_curve,
19
- yield_by_mode,
20
53
  FATIGUE_CLASS_PRESET,
54
+
55
+ # Multiaxial (τ/σ, R)
56
+ yield_by_mode,
57
+ T_TWIN,
58
+ R_COMP,
21
59
  )
22
60
 
61
+ # ==============================================================================
62
+ # FLC + Forming-Fatigue (v7.2 / v8.0)
63
+ # ==============================================================================
64
+ from .unified_flc_v7 import (
65
+ # FLC prediction (v7.2)
66
+ FLCPredictor,
67
+ FLCParams,
68
+ FLCMaterial,
69
+ FLC_MATERIALS,
70
+
71
+ # Forming-Fatigue integration (v8.0)
72
+ FormingFatigueIntegrator,
73
+ FormingState,
74
+ DeltaFormingAnalyzer,
75
+
76
+ # Convenience functions
77
+ predict_flc,
78
+ effective_fatigue_threshold,
79
+ critical_forming_consumption,
80
+
81
+ # Constants
82
+ R_TH_VIRGIN,
83
+ N_SLIP,
84
+ )
85
+
86
+ # ==============================================================================
87
+ # DBT: Ductile-Brittle Transition
88
+ # ==============================================================================
23
89
  from .dbt_unified import (
24
90
  DBTUnified,
25
91
  DBTCore,
@@ -29,35 +95,102 @@ from .dbt_unified import (
29
95
  MATERIAL_FE,
30
96
  )
31
97
 
98
+ # ==============================================================================
99
+ # Materials Database (GPU-accelerated)
100
+ # ==============================================================================
32
101
  from .materials import MaterialGPU
33
102
 
103
+ # ==============================================================================
34
104
  # Optional: FatigueDB (requires upstash-redis)
105
+ # ==============================================================================
35
106
  try:
36
107
  from .fatigue_redis_api import FatigueDB
37
108
  except ImportError:
38
109
  FatigueDB = None # upstash-redis not installed
39
110
 
40
- __version__ = "6.10.1"
111
+ # ==============================================================================
112
+ # Package Metadata
113
+ # ==============================================================================
114
+ __version__ = "8.0.0"
41
115
  __author__ = "Masamichi Iizumi & Tamaki"
42
116
 
43
117
  __all__ = [
44
- # v6.9
118
+ # === v6.9 Yield + Fatigue ===
45
119
  "Material",
46
- "MATERIALS",
120
+ "MATERIALS",
47
121
  "calc_sigma_y",
122
+ "sigma_base_delta",
123
+ "delta_sigma_ss",
124
+ "delta_sigma_taylor",
125
+ "delta_sigma_ppt",
48
126
  "fatigue_life_const_amp",
49
127
  "generate_sn_curve",
50
128
  "yield_by_mode",
51
129
  "FATIGUE_CLASS_PRESET",
52
- # DBT
130
+ "T_TWIN",
131
+ "R_COMP",
132
+
133
+ # === v7.2 FLC ===
134
+ "FLCPredictor",
135
+ "FLCParams",
136
+ "FLCMaterial",
137
+ "FLC_MATERIALS",
138
+ "predict_flc",
139
+ "R_TH_VIRGIN",
140
+ "N_SLIP",
141
+
142
+ # === v8.0 Forming-Fatigue ===
143
+ "FormingFatigueIntegrator",
144
+ "FormingState",
145
+ "DeltaFormingAnalyzer",
146
+ "effective_fatigue_threshold",
147
+ "critical_forming_consumption",
148
+
149
+ # === DBT ===
53
150
  "DBTUnified",
54
151
  "DBTCore",
55
152
  "GrainSizeView",
56
153
  "TemperatureView",
57
154
  "SegregationView",
58
155
  "MATERIAL_FE",
59
- # Materials
156
+
157
+ # === Materials ===
60
158
  "MaterialGPU",
61
- # FatigueDB (optional)
159
+
160
+ # === FatigueDB (optional) ===
62
161
  "FatigueDB",
63
162
  ]
163
+
164
+
165
+ # ==============================================================================
166
+ # Quick Reference
167
+ # ==============================================================================
168
+ def info():
169
+ """Print δ-Theory library overview."""
170
+ print(f"""
171
+ ╔══════════════════════════════════════════════════════════════════════╗
172
+ ║ δ-Theory Core Library v{__version__} ║
173
+ ║ "Nature is Geometry" ║
174
+ ╠══════════════════════════════════════════════════════════════════════╣
175
+ ║ ║
176
+ ║ YIELD STRESS (v5.0) ║
177
+ ║ σ_y = f(crystal_structure, f_d, E_bond, T) ║
178
+ ║ >>> calc_sigma_y(MATERIALS['Fe']) ║
179
+ ║ ║
180
+ ║ FATIGUE LIFE (v6.10) ║
181
+ ║ N = f(r, r_th, structure) | r_th: BCC=0.65, FCC=0.02, HCP=0.20 ║
182
+ ║ >>> fatigue_life_const_amp(sigma_a, MATERIALS['Fe']) ║
183
+ ║ ║
184
+ ║ FLC - FORMING LIMIT (v7.2) ║
185
+ ║ FLC(β) = FLC₀ × (1-η) × h(β, R, τ/σ) ║
186
+ ║ >>> FLCPredictor().predict(beta=0.0, material='SPCC') ║
187
+ ║ ║
188
+ ║ FORMING-FATIGUE (v8.0) ║
189
+ ║ r_th_eff = r_th_virgin × (1 - η_forming) ║
190
+ ║ >>> FormingFatigueIntegrator().effective_r_th(0.4, 'BCC') ║
191
+ ║ ║
192
+ ║ DBT TEMPERATURE ║
193
+ ║ >>> DBTUnified().predict_dbtt(material, grain_size) ║
194
+ ║ ║
195
+ ╚══════════════════════════════════════════════════════════════════════╝
196
+ """)
core/__main__.py ADDED
@@ -0,0 +1,290 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ δ-Theory CLI Entry Point
4
+
5
+ Usage:
6
+ python -m core # Show quick reference
7
+ python -m core info # Show detailed info
8
+ python -m core flc SPCC # Quick FLC prediction
9
+ python -m core fatigue Fe 150 # Quick fatigue life
10
+ """
11
+
12
+ import sys
13
+
14
+ QUICK_REFERENCE = """
15
+
16
+ ███████╗██╗ ██╗██████╗ ███████╗██╗ ██╗ █████╗ ██╗
17
+ ██╔════╝██║ ██║██╔══██╗██╔════╝██║ ██╔╝██╔══██╗██║
18
+ █████╗ ██║ ██║██████╔╝█████╗ █████╔╝ ███████║██║
19
+ ██╔══╝ ██║ ██║██╔══██╗██╔══╝ ██╔═██╗ ██╔══██║╚═╝
20
+ ███████╗╚██████╔╝██║ ██║███████╗██║ ██╗██║ ██║██╗
21
+ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
22
+ δ-Theory v8.0.0
23
+ "Nature is Geometry"
24
+
25
+ ╔══════════════════════════════════════════════════════════════════════════════╗
26
+ ║ δ-Theory v8.0.0 — CLI Quick Reference ║
27
+ ║ "Nature is Geometry" ║
28
+ ╠══════════════════════════════════════════════════════════════════════════════╣
29
+ ║ ║
30
+ ║ INSTALLATION OK! ✓ ║
31
+ ║ ║
32
+ ╠══════════════════════════════════════════════════════════════════════════════╣
33
+ ║ 🔧 YIELD STRESS ║
34
+ ╠══════════════════════════════════════════════════════════════════════════════╣
35
+ ║ ║
36
+ ║ from core import calc_sigma_y, MATERIALS ║
37
+ ║ result = calc_sigma_y(MATERIALS['Fe'], T_K=300) ║
38
+ ║ print(f"σ_y = {result['sigma_y']:.1f} MPa") ║
39
+ ║ ║
40
+ ╠══════════════════════════════════════════════════════════════════════════════╣
41
+ ║ 🔄 FATIGUE LIFE ║
42
+ ╠══════════════════════════════════════════════════════════════════════════════╣
43
+ ║ ║
44
+ ║ from core import fatigue_life_const_amp, MATERIALS ║
45
+ ║ result = fatigue_life_const_amp(MATERIALS['Fe'], sigma_a_MPa=150, ║
46
+ ║ sigma_y_tension_MPa=200) ║
47
+ ║ print(f"N = {result['N_fail']:.2e} cycles") ║
48
+ ║ ║
49
+ ║ # CLI: ║
50
+ ║ python -m core.unified_yield_fatigue_v6_9 point --metal Fe --sigma_a 150 ║
51
+ ║ python -m core.unified_yield_fatigue_v6_9 sn --metal Fe ║
52
+ ║ ║
53
+ ╠══════════════════════════════════════════════════════════════════════════════╣
54
+ ║ 📐 FLC (Forming Limit Curve) — NEW in v8.0! ║
55
+ ╠══════════════════════════════════════════════════════════════════════════════╣
56
+ ║ ║
57
+ ║ from core import FLCPredictor ║
58
+ ║ flc = FLCPredictor() ║
59
+ ║ Em = flc.predict(beta=0.0, material='SPCC') # → 0.251 ║
60
+ ║ ║
61
+ ║ # Full curve: ║
62
+ ║ for b in [-0.5, 0, 1.0]: ║
63
+ ║ print(f"β={b:+.1f}: {flc.predict(b, 'SPCC'):.3f}") ║
64
+ ║ ║
65
+ ║ # Available materials: ║
66
+ ║ SPCC, DP590, Al, SUS304, Ti, Mg_AZ31, SECD-E16, Cu ║
67
+ ║ ║
68
+ ╠══════════════════════════════════════════════════════════════════════════════╣
69
+ ║ 🔗 FORMING-FATIGUE INTEGRATION — NEW in v8.0! ║
70
+ ╠══════════════════════════════════════════════════════════════════════════════╣
71
+ ║ ║
72
+ ║ from core import FormingFatigueIntegrator ║
73
+ ║ integrator = FormingFatigueIntegrator() ║
74
+ ║ ║
75
+ ║ # Effective fatigue threshold after forming: ║
76
+ ║ r_th_eff = integrator.effective_r_th(eta_forming=0.4, structure='BCC') ║
77
+ ║ # Virgin: 0.65 → After 40% forming: 0.39 ║
78
+ ║ ║
79
+ ║ # Critical forming consumption: ║
80
+ ║ from core import critical_forming_consumption ║
81
+ ║ eta_crit = critical_forming_consumption(r_applied=0.5, structure='BCC') ║
82
+ ║ # → 23.1% (beyond this, infinite life becomes finite!) ║
83
+ ║ ║
84
+ ╠══════════════════════════════════════════════════════════════════════════════╣
85
+ ║ 🌡️ DBT (Ductile-Brittle Transition) ║
86
+ ╠══════════════════════════════════════════════════════════════════════════════╣
87
+ ║ ║
88
+ ║ from core import DBTUnified ║
89
+ ║ model = DBTUnified() ║
90
+ ║ result = model.temp_view.find_DBTT(d=30e-6, c=0.005) ║
91
+ ║ print(f"DBTT = {result['T_star']:.0f} K") ║
92
+ ║ ║
93
+ ║ # CLI: ║
94
+ ║ python -m core.dbt_unified point --d 30 --c 0.5 --T 300 ║
95
+ ║ ║
96
+ ╠══════════════════════════════════════════════════════════════════════════════╣
97
+ ║ 📊 FATIGUE THRESHOLDS (r_th) ║
98
+ ╠══════════════════════════════════════════════════════════════════════════════╣
99
+ ║ ║
100
+ ║ Structure │ r_th │ Fatigue Limit │ Examples ║
101
+ ║ ──────────┼───────┼───────────────┼───────────── ║
102
+ ║ BCC │ 0.65 │ ✓ Clear │ Fe, W, Mo, SPCC, DP590 ║
103
+ ║ FCC │ 0.02 │ ✗ None │ Cu, Al, Ni, SUS304 ║
104
+ ║ HCP │ 0.20 │ △ Weak │ Ti, Mg, Zn ║
105
+ ║ ║
106
+ ╠══════════════════════════════════════════════════════════════════════════════╣
107
+ ║ 📚 MORE INFO ║
108
+ ╠══════════════════════════════════════════════════════════════════════════════╣
109
+ ║ ║
110
+ ║ python -m core info # Detailed module info ║
111
+ ║ python -m core flc SPCC # Quick FLC for material ║
112
+ ║ python -m core flc SPCC -0.5 # FLC at specific β ║
113
+ ║ ║
114
+ ║ Docs: https://github.com/miosync/delta-theory ║
115
+ ║ PyPI: https://pypi.org/project/delta-theory/ ║
116
+ ║ ║
117
+ ╚══════════════════════════════════════════════════════════════════════════════╝
118
+ """
119
+
120
+ DETAILED_INFO = """
121
+ ╔══════════════════════════════════════════════════════════════════════════════╗
122
+ ║ δ-Theory v8.0.0 — Detailed Module Information ║
123
+ ╚══════════════════════════════════════════════════════════════════════════════╝
124
+
125
+ 📦 INSTALLED MODULES
126
+ ═══════════════════════════════════════════════════════════════════════════════
127
+
128
+ core/
129
+ ├── unified_yield_fatigue_v6_9.py # Yield + Fatigue (v6.9b)
130
+ ├── unified_flc_v7.py # FLC + Forming-Fatigue (v7.2/v8.0)
131
+ ├── dbt_unified.py # Ductile-Brittle Transition
132
+ ├── materials.py # Material database
133
+ └── fatigue_redis_api.py # FatigueData-AM2022 API
134
+
135
+
136
+ 🔬 THEORY SUMMARY
137
+ ═══════════════════════════════════════════════════════════════════════════════
138
+
139
+ Core Equation: Λ = K / |V|_eff
140
+
141
+ K = Destructive energy (stress, thermal, EM...)
142
+ |V|_eff = Cohesive energy (bond strength)
143
+ Λ = 1 → Critical condition (fracture/transition)
144
+
145
+
146
+ 📐 FLC MODEL (v7.2)
147
+ ═══════════════════════════════════════════════════════════════════════════════
148
+
149
+ FLC(β) = FLC₀_pure × (1 - η_total) × h(β, R, τ/σ)
150
+
151
+ η_total = Free volume consumption:
152
+ - η_ss: Solid solution
153
+ - η_ppt: Precipitate/martensite
154
+ - η_wh: Work hardening (dislocations)
155
+ - η_HP: Hall-Petch (grain refinement)
156
+
157
+ Example: SPCC (90.6% FV) vs DP590 (71.4% FV)
158
+ Same crystal, different formability!
159
+
160
+
161
+ 🔗 FORMING-FATIGUE (v8.0)
162
+ ═══════════════════════════════════════════════════════════════════════════════
163
+
164
+ r_th_eff = r_th_virgin × (1 - η_forming)
165
+
166
+ "How much fatigue life did you lose when you pressed that part?"
167
+
168
+ η_forming │ r_th_eff (BCC) │ Status
169
+ ──────────┼────────────────┼────────────────
170
+ 0% │ 0.65 │ Virgin
171
+ 20% │ 0.52 │ Light forming
172
+ 40% │ 0.39 │ Heavy forming
173
+ 60% │ 0.26 │ Severe forming
174
+
175
+ Critical η: r=0.5 → η_crit=23.1%
176
+ (Beyond this, "infinite life" becomes "finite life"!)
177
+
178
+
179
+ 📊 VALIDATION
180
+ ═══════════════════════════════════════════════════════════════════════════════
181
+
182
+ Yield (v5.0): 10 pure metals, 2.6% mean error
183
+ Fatigue (v6.10): 2,472 points (5 AM materials), 4-7% error
184
+ FLC (v7.2): 36 points (6 materials), 2.7% error
185
+
186
+
187
+ 👥 AUTHORS
188
+ ═══════════════════════════════════════════════════════════════════════════════
189
+
190
+ Masamichi Iizumi — Miosync, Inc. CEO
191
+ Tamaki — Sentient Digital Partner
192
+
193
+ "Nature is Geometry" 🔬
194
+ """
195
+
196
+
197
+ def cmd_flc(args):
198
+ """Quick FLC prediction."""
199
+ from .unified_flc_v7 import FLCPredictor, FLC_MATERIALS
200
+
201
+ if len(args) == 0:
202
+ print("Available materials:", ", ".join(FLC_MATERIALS.keys()))
203
+ return
204
+
205
+ material = args[0]
206
+ beta = float(args[1]) if len(args) > 1 else None
207
+
208
+ flc = FLCPredictor()
209
+
210
+ if beta is not None:
211
+ Em = flc.predict(beta, material)
212
+ print(f"{material} FLC(β={beta:+.2f}) = {Em:.3f}")
213
+ else:
214
+ print(f"\n{material} FLC Curve:")
215
+ print("-" * 25)
216
+ for b in [-0.5, -0.25, 0.0, 0.25, 0.5, 1.0]:
217
+ Em = flc.predict(b, material)
218
+ print(f" β={b:+5.2f}: {Em:.3f}")
219
+
220
+
221
+ def cmd_eta(args):
222
+ """Critical η calculation."""
223
+ from .unified_flc_v7 import FormingFatigueIntegrator
224
+
225
+ if len(args) < 1:
226
+ print("Usage: python -m core eta <r_applied> [structure]")
227
+ print("Example: python -m core eta 0.5 BCC")
228
+ return
229
+
230
+ r_applied = float(args[0])
231
+ structure = args[1] if len(args) > 1 else 'BCC'
232
+
233
+ integrator = FormingFatigueIntegrator()
234
+ eta_crit = integrator.critical_eta(r_applied, structure)
235
+
236
+ print(f"\nCritical η for {structure} at r = {r_applied:.2f}")
237
+ print("-" * 40)
238
+ print(f" η_critical = {eta_crit*100:.1f}%")
239
+ print(f" → Beyond this, infinite life becomes finite!")
240
+
241
+
242
+ def cmd_rth(args):
243
+ """Effective r_th after forming."""
244
+ from .unified_flc_v7 import FormingFatigueIntegrator
245
+
246
+ if len(args) < 1:
247
+ print("Usage: python -m core rth <eta_forming> [structure]")
248
+ print("Example: python -m core rth 0.4 BCC")
249
+ return
250
+
251
+ eta = float(args[0])
252
+ structure = args[1] if len(args) > 1 else 'BCC'
253
+
254
+ integrator = FormingFatigueIntegrator()
255
+ r_th_eff = integrator.effective_r_th(eta, structure)
256
+ r_th_virgin = {'BCC': 0.65, 'FCC': 0.02, 'HCP': 0.20}[structure]
257
+
258
+ print(f"\nEffective r_th for {structure} after η = {eta:.0%} forming")
259
+ print("-" * 45)
260
+ print(f" Virgin r_th: {r_th_virgin:.3f}")
261
+ print(f" Effective r_th: {r_th_eff:.3f}")
262
+ print(f" Reduction: {(1 - r_th_eff/r_th_virgin)*100:.1f}%")
263
+
264
+
265
+ def main():
266
+ args = sys.argv[1:]
267
+
268
+ if len(args) == 0:
269
+ print(QUICK_REFERENCE)
270
+ return
271
+
272
+ cmd = args[0].lower()
273
+
274
+ if cmd == 'info':
275
+ print(DETAILED_INFO)
276
+ elif cmd == 'flc':
277
+ cmd_flc(args[1:])
278
+ elif cmd == 'eta':
279
+ cmd_eta(args[1:])
280
+ elif cmd == 'rth':
281
+ cmd_rth(args[1:])
282
+ elif cmd in ['help', '-h', '--help']:
283
+ print(QUICK_REFERENCE)
284
+ else:
285
+ print(f"Unknown command: {cmd}")
286
+ print("Try: python -m core help")
287
+
288
+
289
+ if __name__ == '__main__':
290
+ main()