%22%22%22Apply%20the%20published%20FAC-1%20stress%20intensities%20to%20a%20complete%20Paris%20analysis.%22%22%22%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.26.0%22%0Aapp%20%3D%20marimo.App(css_file%3D%22..%2F..%2Fdocs%2Fstylesheets%2Fcustom.css%22)%0A%0A%0A%40app.cell%0Adef%20model()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20from%20notebooks._examples.afgrow%20import%20(%0A%20%20%20%20%20%20%20%20FAC1_CRACK_RATIOS%2C%0A%20%20%20%20%20%20%20%20FAC1_SIF%2C%0A%20%20%20%20%20%20%20%20MERC3_COEFFICIENT%2C%0A%20%20%20%20%20%20%20%20MERC3_EXPONENT%2C%0A%20%20%20%20%20%20%20%20crack_history%2C%0A%20%20%20%20%20%20%20%20fac1_totals%2C%0A%20%20%20%20%20%20%20%20native_paris_growth%2C%0A%20%20%20%20%20%20%20%20paris_reference_cycles%2C%0A%20%20%20%20)%0A%20%20%20%20from%20notebooks._examples.synthetic%20import%20(%0A%20%20%20%20%20%20%20%20display_indices%2C%0A%20%20%20%20%20%20%20%20plot_views%2C%0A%20%20%20%20%20%20%20%20synthetic_peaks%2C%0A%20%20%20%20)%0A%20%20%20%20from%20py_fatigue%20import%20ParisCurve%0A%20%20%20%20from%20py_fatigue.geometry%20import%20TabulatedGeometryFactor%0A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%20%20%20%20%23%20AFGROW%20FAC-1%20%C2%B7%20From%20a%20loaded-hole%20K%20table%20to%20crack%20growth%0A%0A%20%20%20%20%20%20%20%20Use%20the%2010%20in%20wide%2C%201%20in%20thick%20plate%20and%20centered%201%20in%20hole%20from%0A%20%20%20%20%20%20%20%20FAC-1%20Example%201.%20At%20the%20reference%20load%2C%20the%20bypass%20stress%20is%0A%20%20%20%20%20%20%20%2010%20ksi%20and%20the%20pin%20force%20is%2010%20kip.%20A%20single%20through%20crack%20grows%0A%20%20%20%20%20%20%20%20radially%20from%20the%20hole%20toward%20the%20plate%20edge.%0A%0A%20%20%20%20%20%20%20%20FAC-1%20supplies%20the%20stress%20intensities.%20This%20tutorial%20adds%20an%0A%20%20%20%20%20%20%20%20illustrative%20life%20analysis%20using%20the%20independently%20published%0A%20%20%20%20%20%20%20%207075-T6%20Paris%20fit%20from%20MERC-3.%20The%20reported%20lives%20compare%20the%0A%20%20%20%20%20%20%20%20three%20tabular%20K%20inputs%20under%20this%20tutorial's%20load%20history.%0A%20%20%20%20%20%20%20%20Compare%20the%20published%20K%20values%20with%20the%20Py-Fatigue%20geometry%0A%20%20%20%20%20%20%20%20model%2C%20then%20compare%20two%20independently%20integrated%20growth%20histories.%0A%20%20%20%20%20%20%20%20%5BFAC-1%20geometry%20and%20K%20tables%5D(https%3A%2F%2Fwww.afgrow.net%2Fapplications%2FDTDHandbook%2FExamples%2Fpage1_0.aspx)%0A%20%20%20%20%20%20%20%20%C2%B7%20%5BMERC-3%20material%20fit%5D(https%3A%2F%2Fwww.afgrow.net%2Fapplications%2FDTDHandbook%2FExamples%2Fpage2_2.aspx)%0A%20%20%20%20%20%20%20%20%22%22%22)%0A%20%20%20%20width%2C%20diameter%20%3D%2010.0%2C%201.0%20%20%23%20in%0A%20%20%20%20bypass_reference%20%3D%2010.0%20%20%23%20ksi%0A%20%20%20%20bearing_reference%20%3D%2010.0%20%20%23%20kip%20applied%20through%20pin%0A%20%20%20%20curve%20%3D%20ParisCurve(%0A%20%20%20%20%20%20%20%20slope%3DMERC3_EXPONENT%2C%20intercept%3DMERC3_COEFFICIENT%2C%20unit_string%3D%22ksi%20%E2%88%9Ain%22%0A%20%20%20%20)%0A%20%20%20%20%23%20Cycle%20peaks%20scale%20both%20reference%20loads.%20Minima%20are%20zero.%0A%20%20%20%20load_fraction%20%3D%20synthetic_peaks()%20%2F%20100.0%0A%20%20%20%20table_length%20%3D%20FAC1_CRACK_RATIOS%20*%20diameter%0A%20%20%20%20length%20%3D%20np.union1d(%0A%20%20%20%20%20%20%20%20np.linspace(table_length%5B0%5D%2C%20table_length%5B-1%5D%2C%201001)%2C%20table_length%0A%20%20%20%20)%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20FAC1_SIF%2C%0A%20%20%20%20%20%20%20%20MERC3_COEFFICIENT%2C%0A%20%20%20%20%20%20%20%20MERC3_EXPONENT%2C%0A%20%20%20%20%20%20%20%20TabulatedGeometryFactor%2C%0A%20%20%20%20%20%20%20%20bearing_reference%2C%0A%20%20%20%20%20%20%20%20bypass_reference%2C%0A%20%20%20%20%20%20%20%20crack_history%2C%0A%20%20%20%20%20%20%20%20curve%2C%0A%20%20%20%20%20%20%20%20diameter%2C%0A%20%20%20%20%20%20%20%20display_indices%2C%0A%20%20%20%20%20%20%20%20fac1_totals%2C%0A%20%20%20%20%20%20%20%20length%2C%0A%20%20%20%20%20%20%20%20load_fraction%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20%20%20%20%20native_paris_growth%2C%0A%20%20%20%20%20%20%20%20np%2C%0A%20%20%20%20%20%20%20%20paris_reference_cycles%2C%0A%20%20%20%20%20%20%20%20plot_views%2C%0A%20%20%20%20%20%20%20%20plt%2C%0A%20%20%20%20%20%20%20%20table_length%2C%0A%20%20%20%20%20%20%20%20width%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell%0Adef%20analysis(%0A%20%20%20%20FAC1_SIF%2C%0A%20%20%20%20MERC3_COEFFICIENT%2C%0A%20%20%20%20MERC3_EXPONENT%2C%0A%20%20%20%20TabulatedGeometryFactor%2C%0A%20%20%20%20bearing_reference%2C%0A%20%20%20%20bypass_reference%2C%0A%20%20%20%20crack_history%2C%0A%20%20%20%20curve%2C%0A%20%20%20%20diameter%2C%0A%20%20%20%20display_indices%2C%0A%20%20%20%20fac1_totals%2C%0A%20%20%20%20length%2C%0A%20%20%20%20load_fraction%2C%0A%20%20%20%20mo%2C%0A%20%20%20%20native_paris_growth%2C%0A%20%20%20%20np%2C%0A%20%20%20%20paris_reference_cycles%2C%0A%20%20%20%20plot_views%2C%0A%20%20%20%20plt%2C%0A%20%20%20%20table_length%2C%0A%20%20%20%20width%2C%0A)%3A%0A%20%20%20%20_fig%2C%20axes%20%3D%20plt.subplots(3%2C%202%2C%20figsize%3D(11%2C%2011)%2C%20layout%3D%22constrained%22)%0A%20%20%20%20curve.plot(ax%3Daxes%5B0%2C%200%5D%2C%20scale%3D%22loglog%22)%0A%20%20%20%20axes%5B0%2C%200%5D.set(ylabel%3D%22Growth%20rate%20(in%2Fcycle)%22)%0A%20%20%20%20samples%20%3D%20display_indices(load_fraction.size)%0A%20%20%20%20axes%5B0%2C%201%5D.plot(samples%20%2B%201%2C%20load_fraction%5Bsamples%5D)%0A%20%20%20%20axes%5B0%2C%201%5D.set(%0A%20%20%20%20%20%20%20%20xlabel%3D%22Applied%20cycles%22%2C%20ylabel%3D%22Fraction%20of%20reference%20loads%22%0A%20%20%20%20)%0A%20%20%20%20components%2C%20totals%2C%20growth%2C%20profile%20%3D%20(%0A%20%20%20%20%20%20%20%20axes%5B1%2C%200%5D%2C%0A%20%20%20%20%20%20%20%20axes%5B1%2C%201%5D%2C%0A%20%20%20%20%20%20%20%20axes%5B2%2C%200%5D%2C%0A%20%20%20%20%20%20%20%20axes%5B2%2C%201%5D%2C%0A%20%20%20%20)%0A%20%20%20%20radius%20%3D%20diameter%20%2F%202%0A%20%20%20%20angle%20%3D%20np.linspace(0%2C%202%20*%20np.pi%2C%20101)%0A%20%20%20%20profile.plot(%0A%20%20%20%20%20%20%20%20radius%20*%20np.cos(angle)%2C%20radius%20*%20np.sin(angle)%2C%20%22k-%22%2C%20label%3D%22Hole%22%0A%20%20%20%20)%0A%20%20%20%20profile.axvline(width%20%2F%202%2C%20color%3D%22grey%22%2C%20label%3D%22Plate%20edge%22)%0A%20%20%20%20profile.plot(%0A%20%20%20%20%20%20%20%20%5Bradius%2C%20radius%20%2B%20length%5B0%5D%5D%2C%0A%20%20%20%20%20%20%20%20%5B0%2C%200%5D%2C%0A%20%20%20%20%20%20%20%20%22k--%22%2C%0A%20%20%20%20%20%20%20%20label%3D%22Initial%20crack%22%2C%0A%20%20%20%20%20%20%20%20zorder%3D5%2C%0A%20%20%20%20)%0A%0A%20%20%20%20rows%20%3D%20%5B%5D%0A%20%20%20%20for%20case%2C%20total%20in%20fac1_totals().items()%3A%0A%20%20%20%20%20%20%20%20published_total%20%3D%20FAC1_SIF%5Bcase%5D%5B2%5D%0A%20%20%20%20%20%20%20%20delta_k%20%3D%20np.interp(length%2C%20table_length%2C%20total)%0A%20%20%20%20%20%20%20%20reference%20%3D%20paris_reference_cycles(%0A%20%20%20%20%20%20%20%20%20%20%20%20length%2C%20delta_k%2C%20MERC3_COEFFICIENT%2C%20MERC3_EXPONENT%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20factors%20%3D%20delta_k%20%2F%20(bypass_reference%20*%20np.sqrt(np.pi%20*%20length))%0A%20%20%20%20%20%20%20%20geometry%20%3D%20TabulatedGeometryFactor(length%5B0%5D%2C%20length%2C%20factors)%0A%20%20%20%20%20%20%20%20result%20%3D%20native_paris_growth(%0A%20%20%20%20%20%20%20%20%20%20%20%20geometry%2C%20curve%2C%20bypass_reference%20*%20load_fraction%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20history%2C%20reached%20%3D%20crack_history(%0A%20%20%20%20%20%20%20%20%20%20%20%20length%2C%20reference%2C%20load_fraction%2C%20MERC3_EXPONENT%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20saved%20%3D%20display_indices(history.size)%0A%20%20%20%20%20%20%20%20sampled%20%3D%20display_indices(result.crack_depth.size)%0A%20%20%20%20%20%20%20%20native_k%20%3D%20result.sif%20%2F%20load_fraction%5B%3A%20result.sif.size%5D%0A%20%20%20%20%20%20%20%20(k_line%2C)%20%3D%20totals.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20result.crack_depth%5Bsampled%5D%2C%20native_k%5Bsampled%5D%2C%20label%3Dcase%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20color%20%3D%20k_line.get_color()%0A%20%20%20%20%20%20%20%20totals.plot(length%2C%20delta_k%2C%20%22--%22%2C%20color%3Dcolor)%0A%20%20%20%20%20%20%20%20totals.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20table_length%2C%20published_total%2C%20%22o%22%2C%20color%3Dcolor%2C%20markersize%3D3%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20growth.plot(saved%2C%20history%5Bsaved%5D%2C%20%22--%22%2C%20color%3Dcolor)%0A%20%20%20%20%20%20%20%20depths%20%3D%20result.crack_depth%0A%20%20%20%20%20%20%20%20if%20result.termination%20%3D%3D%20%22geometry_limit%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20depths%20%3D%20np.r_%5Bdepths%2C%20length%5B-1%5D%5D%0A%20%20%20%20%20%20%20%20native_samples%20%3D%20display_indices(depths.size)%0A%20%20%20%20%20%20%20%20growth.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20native_samples%2C%20depths%5Bnative_samples%5D%2C%20color%3Dcolor%2C%20label%3Dcase%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20profile.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Bradius%2C%20radius%20%2B%20depths%5B-1%5D%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B0%2C%200%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20label%3Df%22%7Bcase%7D%20final%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20alpha%3D0.65%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20color%3Dcolor%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20rows.append(%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22K%20source%22%3A%20case%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Max%20rounding%20difference%20(ksi%20%E2%88%9Ain)%22%3A%20round(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20float(np.max(np.abs(total%20-%20published_total)))%2C%202%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Max%20Py-Fatigue%20K%20difference%20(ksi%20%E2%88%9Ain)%22%3A%20round(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20float(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20np.max(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20np.abs(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20native_k%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%20np.interp(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20result.crack_depth%2C%20table_length%2C%20total%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%206%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Reference%20cycles%22%3A%20history.size%20-%201%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Py-Fatigue%20cycles%22%3A%20int(result.final_cycles)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Py-Fatigue%20%E2%88%92%20reference%20(cycles)%22%3A%20int(result.final_cycles)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%20(history.size%20-%201)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Py-Fatigue%20last%20length%20(in)%22%3A%20round(depths%5B-1%5D%2C%203)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Reference%20outcome%22%3A%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22End%20of%20K%20table%22%20if%20reached%20else%20%22Spectrum%20ended%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Py-Fatigue%20stop%22%3A%20result.termination.replace(%22_%22%2C%20%22%20%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20bypass%2C%20bearing%2C%20_%20%3D%20FAC1_SIF%5B%22NASGRO%20TC03%22%5D%0A%20%20%20%20components.plot(table_length%2C%20bypass%2C%20%22o-%22%2C%20label%3D%22Bypass%22)%0A%20%20%20%20components.plot(table_length%2C%20bearing%2C%20%22o-%22%2C%20label%3D%22Bearing%22)%0A%20%20%20%20components.set(xlabel%3D%22Crack%20length%20(in)%22%2C%20ylabel%3D%22Component%20K%20(ksi%20%E2%88%9Ain)%22)%0A%20%20%20%20totals.set(xlabel%3D%22Crack%20length%20(in)%22%2C%20ylabel%3D%22Combined%20K%20(ksi%20%E2%88%9Ain)%22)%0A%20%20%20%20growth.set(xlabel%3D%22Applied%20cycles%22%2C%20ylabel%3D%22Crack%20length%20(in)%22)%0A%20%20%20%20profile.set(%0A%20%20%20%20%20%20%20%20xlabel%3D%22Position%20across%20plate%20(in)%22%2C%0A%20%20%20%20%20%20%20%20ylabel%3D%22Position%20along%20plate%20(in)%22%2C%0A%20%20%20%20%20%20%20%20aspect%3D%22equal%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Hole%20and%20crack%20path%20%C2%B7%20plan%20view%22%2C%0A%20%20%20%20)%0A%20%20%20%20for%20axis%20in%20(components%2C%20totals%2C%20growth%2C%20profile)%3A%0A%20%20%20%20%20%20%20%20axis.legend(fontsize%3D%22small%22)%0A%20%20%20%20mo.vstack(%0A%20%20%20%20%20%20%20%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%23%20Superpose%20the%20loads%20and%20integrate%20growth%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20Each%20of%20the%20**%7Bload_fraction.size%3A%2C%7D%20cycles**%20scales%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20%7Bbypass_reference%3Ag%7D%20ksi%20bypass%20stress%20and%20%7Bbearing_reference%3Ag%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20kip%20pin%20force%20by%20the%20same%20fraction.%20The%20minima%20are%20zero%2C%20so%0A%20%20%20%20%20%20%20%20%20%20%20%20the%20scaled%20sum%20of%20the%20two%20K%20components%20is%20%CE%94K.%20The%20two%0A%20%20%20%20%20%20%20%20%20%20%20%20FRANC2D%20meshes%20and%20NASGRO%20TC03%20give%20three%20reference%20curves.%0A%20%20%20%20%20%20%20%20%20%20%20%20The%20dots%20show%20the%20handbook's%20separately%20rounded%20totals.%0A%20%20%20%20%20%20%20%20%20%20%20%20Divide%20each%20Py-Fatigue%20K%20value%20by%20its%20applied%20load%20fraction%0A%20%20%20%20%20%20%20%20%20%20%20%20to%20compare%20the%20history%20at%20the%20same%20reference%20load.%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20Integrate%20cycles%20versus%20crack%20length%20at%20full%20reference%20load.%0A%20%20%20%20%20%20%20%20%20%20%20%20For%20each%20applied%20cycle%2C%20advance%20the%20reference%20history%20by%0A%20%20%20%20%20%20%20%20%20%20%20%20the%20load%20fraction%20raised%20to%20the%20Paris%20exponent.%20For%0A%20%20%20%20%20%20%20%20%20%20%20%20Py-Fatigue%2C%20express%20the%20combined%20K%20table%20as%20a%20dimensionless%0A%20%20%20%20%20%20%20%20%20%20%20%20geometry%20factor%20against%20the%20reference%20bypass%20stress.%20Run%0A%20%20%20%20%20%20%20%20%20%20%20%20%60get_crack_growth%60%20with%20the%20resulting%20factor%20table%20and%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20applied%20bypass%20ranges.%20The%20tabulated%20factor%20incorporates%0A%20%20%20%20%20%20%20%20%20%20%20%20pin%20bearing%20because%20both%20loads%20scale%20together.%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20Dashed%20lines%20show%20the%20independent%20integration.%20Solid%20lines%0A%20%20%20%20%20%20%20%20%20%20%20%20show%20Py-Fatigue's%20cycle-by-cycle%20integration.%20Both%20stop%20at%0A%20%20%20%20%20%20%20%20%20%20%20%20c%2FD%20%3D%201.35%20or%20at%20the%20end%20of%20the%20spectrum.%20The%20K%20table%0A%20%20%20%20%20%20%20%20%20%20%20%20controls%20the%20range%20of%20this%20analysis.%20The%20end%20of%20the%20table%0A%20%20%20%20%20%20%20%20%20%20%20%20is%20a%20model%20limit%2C%20with%20no%20inferred%20failure%20criterion.%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%22%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.ui.table(rows)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20plot_views(_fig)%2C%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20)%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
7b6b379f6f2896d57f91a7d16de73b1c