main
John Lauer Review cooling stack tolerance sensitivity and prototype spacer selection 8718929
"""Prototype worksheet only: calculate spacer target from supplied measurements."""
import argparse,json,math
p=argparse.ArgumentParser(description=__doc__)
p.add_argument('--case-to-sink-mm',type=float,required=True)
p.add_argument('--isolator-mm',type=float,required=True)
p.add_argument('--film-mm',type=float,default=.020,help='Assumed thickness of each of three films; not a measurement')
p.add_argument('--measurement-uncertainty-mm',type=float,required=True)
a=p.parse_args()
assert all(math.isfinite(v) and v>=0 for v in vars(a).values()),'Inputs must be finite and nonnegative'
assert a.case_to_sink_mm>0 and a.isolator_mm>0
thickness=a.case_to_sink_mm-a.isolator_mm-3*a.film_mm
assert thickness>0,'Stack has no room for a positive spacer; revise geometry'
print(json.dumps({'status':'worksheet-not-assembly-approval','inputs':vars(a),'spacerTargetMm':thickness,'targetRangeFromSeparationMeasurementOnlyMm':[thickness-a.measurement_uncertainty_mm,thickness+a.measurement_uncertainty_mm],'limitations':['Measurement uncertainty is only for case-to-sink separation; isolator, film and spacer manufacturing errors are additional.','Maintain independent sink support. Do not use Q1 leads to establish the sink datum.','Actual film thickness/contact pressure and flatness must be established; this arithmetic does not qualify contact or electrical insulation.','Recalculate thermal resistance and re-run formal gates if the adopted stack differs from design/spec.json.']},indent=2))