%22%22%22Assess%20a%20surface%20crack%20and%20a%20through%20crack%20under%20ordered%20tensile%20loads.%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%20inputs()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20from%20notebooks._examples.synthetic%20import%20(%0A%20%20%20%20%20%20%20%20MINIMUM_STRESS%2C%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.crack_growth%20import%20(%0A%20%20%20%20%20%20%20%20CenterThroughCrack%2C%0A%20%20%20%20%20%20%20%20LoadBlock%2C%0A%20%20%20%20%20%20%20%20NasgroCurve%2C%0A%20%20%20%20%20%20%20%20SemiEllipticalSurfaceCrack%2C%0A%20%20%20%20%20%20%20%20simulate_crack_growth%2C%0A%20%20%20%20)%0A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%20%20%20%20%23%20Ordered%20fatigue%20crack%20growth%20in%20a%20plate%0A%0A%20%20%20%20%20%20%20%20Assess%20two%20initial%20defects%20in%20a%20100%20mm%20wide%2C%2010%20mm%20thick%20plate.%0A%20%20%20%20%20%20%20%20The%20center%20through%20crack%20advances%20one%20half-length.%20The%0A%20%20%20%20%20%20%20%20semi-elliptical%20surface%20crack%20advances%20in%20depth%20and%20along%20the%0A%20%20%20%20%20%20%20%20surface.%20Both%20see%20the%20same%20nominal%20tensile%20stress%20history.%0A%0A%20%20%20%20%20%20%20%20The%20material%20fit%20and%20loading%20are%20synthetic.%20Compare%20the%0A%20%20%20%20%20%20%20%20last%20admissible%20profiles%20and%20the%20reasons%20each%20run%20stopped.%0A%20%20%20%20%20%20%20%20%22%22%22)%0A%20%20%20%20geometries%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22TC01%22%3A%20CenterThroughCrack(half_width%3D50.0%2C%20half_length%3D5.0)%2C%0A%20%20%20%20%20%20%20%20%22SC01%22%3A%20SemiEllipticalSurfaceCrack(%0A%20%20%20%20%20%20%20%20%20%20%20%20half_width%3D50.0%2C%20thickness%3D10.0%2C%20depth%3D2.0%2C%20half_length%3D10.0%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%7D%0A%20%20%20%20curve%20%3D%20NasgroCurve(%0A%20%20%20%20%20%20%20%20coefficient%3D1e-10%2C%0A%20%20%20%20%20%20%20%20exponent%3D2.0%2C%0A%20%20%20%20%20%20%20%20p%3D0.5%2C%0A%20%20%20%20%20%20%20%20q%3D1.0%2C%0A%20%20%20%20%20%20%20%20threshold_zero%3D25.0%2C%0A%20%20%20%20%20%20%20%20threshold_fanning%3D0.0%2C%0A%20%20%20%20%20%20%20%20toughness%3D500.0%2C%0A%20%20%20%20%20%20%20%20constraint%3D2.0%2C%0A%20%20%20%20%20%20%20%20peak_to_flow%3D0.3%2C%0A%20%20%20%20)%0A%20%20%20%20peaks%20%3D%20synthetic_peaks()%0A%20%20%20%20loads%20%3D%20%5BLoadBlock(MINIMUM_STRESS%2C%20float(peak)%2C%201.0)%20for%20peak%20in%20peaks%5D%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20MINIMUM_STRESS%2C%0A%20%20%20%20%20%20%20%20curve%2C%0A%20%20%20%20%20%20%20%20display_indices%2C%0A%20%20%20%20%20%20%20%20geometries%2C%0A%20%20%20%20%20%20%20%20loads%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20%20%20%20%20peaks%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%20simulate_crack_growth%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell%0Adef%20material_and_load(%0A%20%20%20%20MINIMUM_STRESS%2C%0A%20%20%20%20curve%2C%0A%20%20%20%20display_indices%2C%0A%20%20%20%20mo%2C%0A%20%20%20%20peaks%2C%0A%20%20%20%20plot_views%2C%0A%20%20%20%20plt%2C%0A)%3A%0A%20%20%20%20_fig%2C%20(_law%2C%20_load)%20%3D%20plt.subplots(%0A%20%20%20%20%20%20%20%202%2C%201%2C%20figsize%3D(8%2C%207)%2C%20layout%3D%22constrained%22%0A%20%20%20%20)%0A%20%20%20%20curve.plot(ax%3D_law%2C%20scale%3D%22loglog%22)%0A%20%20%20%20_indices%20%3D%20display_indices(peaks.size)%0A%20%20%20%20_load.plot(_indices%20%2B%201%2C%20peaks%5B_indices%5D%2C%20label%3D%22Peak%22)%0A%20%20%20%20_load.axhline(MINIMUM_STRESS%2C%20linestyle%3D%22--%22%2C%20label%3D%22Minimum%22)%0A%20%20%20%20_load.set(xlabel%3D%22Applied%20cycles%22%2C%20ylabel%3D%22Tensile%20stress%20(MPa)%22)%0A%20%20%20%20_load.legend()%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(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%23%23%20Material%20and%20load%20history%5Cn%5CnApply%20**%7Bpeaks.size%3A%2C%7D%20cycles**%20in%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22generator%20order.%20The%20material%20plot%20shows%20the%20long-crack%20reference%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22at%20R%20%3D%200.%20The%20solver%20uses%20each%20tip%E2%80%99s%20actual%20minimum%20and%20maximum%20K.%22%0A%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%20plot_views(_fig)%2C%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20)%0A%0A%0A%40app.cell%0Adef%20analysis(%0A%20%20%20%20curve%2C%0A%20%20%20%20display_indices%2C%0A%20%20%20%20geometries%2C%0A%20%20%20%20loads%2C%0A%20%20%20%20mo%2C%0A%20%20%20%20plot_views%2C%0A%20%20%20%20plt%2C%0A%20%20%20%20simulate_crack_growth%2C%0A)%3A%0A%20%20%20%20_fig%2C%20_axes%20%3D%20plt.subplots(2%2C%203%2C%20figsize%3D(15%2C%207)%2C%20layout%3D%22constrained%22)%0A%20%20%20%20rows%20%3D%20%5B%5D%0A%20%20%20%20for%20(case%2C%20geometry)%2C%20(profile%2C%20evolution%2C%20intensity)%20in%20zip(%0A%20%20%20%20%20%20%20%20geometries.items()%2C%20_axes%0A%20%20%20%20)%3A%0A%20%20%20%20%20%20%20%20result%20%3D%20simulate_crack_growth(%0A%20%20%20%20%20%20%20%20%20%20%20%20geometry%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20curve%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20loads%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20max_cycle_step%3D1.0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20length_tolerance%3D1e-6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20cycle_tolerance%3D1e-4%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20max_trials%3D2%20*%20len(loads)%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20geometry.plot(ax%3Dprofile%2C%20result%3Dresult)%0A%20%20%20%20%20%20%20%20points%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20result.history%5Bi%5D%20for%20i%20in%20display_indices(len(result.history))%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20cycles%20%3D%20%5Bpoint.cycles%20for%20point%20in%20points%5D%0A%20%20%20%20%20%20%20%20for%20index%2C%20label%20in%20enumerate(result.dimension_names)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20evolution.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cycles%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bpoint.sizes%5Bindex%5D%20for%20point%20in%20points%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20label%3Dlabel%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20intensity.plot(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cycles%2C%20%5Bpoint.k_max%5Bindex%5D%20for%20point%20in%20points%5D%2C%20label%3Dlabel%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20intensity.axhline(%0A%20%20%20%20%20%20%20%20%20%20%20%20curve.toughness%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20color%3D%22firebrick%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20linestyle%3D%22--%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20label%3D%22Toughness%22%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20evolution.set(%0A%20%20%20%20%20%20%20%20%20%20%20%20title%3Df%22%7Bcase%7D%20crack%20dimensions%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xlabel%3D%22Applied%20cycles%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ylabel%3D%22Crack%20dimension%20(mm)%22%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20intensity.set(%0A%20%20%20%20%20%20%20%20%20%20%20%20title%3Df%22%7Bcase%7D%20peak%20stress%20intensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20xlabel%3D%22Applied%20cycles%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ylabel%3D%22K%E2%82%98%E2%82%90%E2%82%93%20(MPa%20%E2%88%9Amm)%22%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20evolution.legend()%0A%20%20%20%20%20%20%20%20intensity.legend()%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%22Case%22%3A%20case%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Cycles%20accepted%22%3A%20round(result.final_cycles%2C%202)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Stop%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%20%20%20%20%22Final%20dimensions%20(mm)%22%3A%20%22%2C%20%22.join(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7Bsize%3A.3f%7D%22%20for%20size%20in%20result.history%5B-1%5D.sizes%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%7D%0A%20%20%20%20%20%20%20%20)%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(%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%23%20Propagate%20and%20interpret%20the%20stop%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20The%20solver%20checks%20both%20toughness%20and%20geometry%20limits%20as%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20cracks%20grow.%20The%20trial%20budget%20scales%20with%20the%20supplied%20load%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20and%20allows%20step%20refinement.%20The%20profiles%20show%20the%0A%20%20%20%20%20%20%20%20%20%20%20%20last%20accepted%20step%2C%20which%20is%20on%20the%20admissible%20side%20of%20a%0A%20%20%20%20%20%20%20%20%20%20%20%20terminal%20boundary.%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
268e22df24d4b2dca80bb6c825a7411f