main
John Lauer Document unchanged-limit thermal margin and concrete physical qualification dependencies bbb7af8
#!/usr/bin/env python3
"""Conditional thermal budget, not an installed-performance prediction."""
from pathlib import Path
import json,hashlib,math
ROOT=Path(__file__).resolve().parents[1]
power=5.5;ambient=40.;limit=55.;interface=.52731;catalog=1.522
maximum=(limit-ambient)/power-interface
rows=[]
for rcs in [.3,.52731,.75,1.,1.25]:
 for factor in [1.,1.1,1.25,1.4,1.5,2.]:
  rsa=catalog*factor;case=ambient+power*(rcs+rsa)
  rows.append({'assumedCaseToSinkKPerW':rcs,'assumedSinkDegradationFactor':factor,'assumedSinkToAmbientKPerW':rsa,'calculatedCaseC':case,'marginToCaseCeilingC':limit-case,'withinCeilingUnderAssumptions':case<=limit})
r={'status':'conditional-budget-not-qualification','accepted':False,'boardSha256':hashlib.sha256((ROOT/'aiflow/run/board-32.kicad_pcb').read_bytes()).hexdigest(),'powerW':power,'ambientC':ambient,'caseCeilingC':limit,'assumedCaseToSinkKPerW':interface,'catalogSinkToAmbientKPerW':catalog,'maximumInstalledSinkToAmbientKPerWUnderAssumedInterface':maximum,'maximumDegradationFactorUnderAssumedInterface':maximum/catalog,'conditionalCaseAtCatalogC':ambient+power*(interface+catalog),'catalogSources':['https://wakefieldthermal.com/wakefield-thermal-3x12-in-extrusion-9099-125319/','https://wakefieldthermal.com/content/Short-Length-Single-Sheets/Short-Length_WFT_125319%20%26%20125320.pdf'],'limitations':['Catalog identifies natural convection for a three-inch specimen but does not establish the temperature rise, heat-source footprint or orientation applicable here.','Do not assume constant thermal resistance at low temperature rise. No convection scaling law is asserted for this product.','Carrier, stopped fan, wire and workcell obstruction are unmeasured.','Case-to-sink value includes assumed interface and spreading; clamp, flatness, grease and contact area are unqualified.','No allowance for measurement uncertainty or sensor lag is consumed by this mathematical boundary. Bench acceptance must include those uncertainties.','No operating limit, material, assembly or AIFlow gate was changed.'],'scenarios':rows}
out=ROOT/'mechanical/passive-assembly-study/thermal-margin.json';out.write_text(json.dumps(r,indent=2)+'\n')
print(json.dumps({k:v for k,v in r.items() if k!='scenarios'},indent=2))