https://raw.githubusercontent.com/MatthewReid854/reliability/master/docs/images/logo.png

SN_diagram

class reliability.PoF.SN_diagram

This function will plot the stress vs number of cycles (S-N) diagram when supplied with data from a series of fatigue tests.

Inputs: stress - an array or list of stress values at failure cycles - an array or list of cycles values at failure stress_runout - an array or list of stress values that did not result in failure Optional cycles_runout - an array or list of cycles values that did not result in failure. Optional xscale - ‘log’ or ‘linear’. Default is ‘log’. stress_trace - an array or list of stress values to be traced across to cycles values. cycles_trace - an array or list of cycles values to be traced across to stress values. show_endurance_limit - This will adjust all lines of best fit to be greater than or equal to the average stress_runout. Defaults to False if stress_runout is not specified. Defaults to True if stress_runout is specified. method_for_bounds - ‘statistical’, ‘residual’, or None. Defaults to ‘statistical’. If set to ‘statistical’ the CI value is used, otherwise it is not used for the ‘residual’ method. Residual uses the maximum residual datapoint for symmetric bounds. Setting the method for bounds to None will turn off the confidence bounds. CI - Must be between 0 and 1. Default is 0.95 for 95% confidence interval. Only used if method_for_bounds = ‘statistical’ Other plotting keywords (eg. color, linestyle, etc) are accepted for the line of best fit.

Outputs: The plot is the only output. All calculated values are shown on the plot.

Example usage: stress = [340, 300, 290, 275, 260, 255, 250, 235, 230, 220, 215, 210] cycles = [15000, 24000, 36000, 80000, 177000, 162000, 301000, 290000, 361000, 881000, 1300000, 2500000] stress_runout = [210, 210, 205, 205, 205] cycles_runout = [10 ** 7, 10 ** 7, 10 ** 7, 10 ** 7, 10 ** 7] SN_diagram(stress=stress, cycles=cycles, stress_runout=stress_runout, cycles_runout=cycles_runout,method_for_bounds=’residual’,cycles_trace=[5 * 10 ** 5], stress_trace=[260]) plt.show()