"""Evaluate published equations only; no original raw observations or FE solver. Python 3 + numpy + scipy. Put beside the two coefficient CSV files. """ from pathlib import Path import csv import numpy as np from scipy.optimize import brentq root=Path(__file__).resolve().parent rows=[] for r in csv.DictReader((root/'brehm-tableA3-coefficients.csv').open()): k,st,e0,nom=map(float,[r['kappa'],r['sigma_t_MPa'],r['e0'],r['nominal_MPa']]);a=(1+e0)/k f=lambda x:st*((2*a*x+1)*np.exp(a*x)-1) lo,hi=[brentq(lambda x:f(x)-s,0,.25) for s in [nom-.2,nom+.2]] for ep in np.linspace(lo,hi,101):rows.append([r['material'],r['rate_equivalent_C'],nom,ep,f(ep)]) with (root/'brehm-rerun.csv').open('w') as h: w=csv.writer(h);w.writerow(['material','rate_equivalent_C','nominal_MPa','strain','stress_MPa']);w.writerows(rows) rows=[] for r in csv.DictReader((root/'gupta-prony-parameters.csv').open()): win,ei,e1,t1,e2,t2=map(float,[r['fit_window_s'],r['Einf_GPa'],r['E1_GPa'],r['tau1_s'],r['E2_GPa'],r['tau2_s']]) for t in np.unique(np.r_[0,np.geomspace(.1,win,240)]):rows.append([r['mode'],win,t,ei+e1*np.exp(-t/t1)+e2*np.exp(-t/t2)]) with (root/'gupta-rerun.csv').open('w') as h: w=csv.writer(h);w.writerow(['mode','fit_window_s','time_s','E_GPa']);w.writerows(rows) print('Equation evaluation complete. Not experimental validation.')