def random_samples_profiles(n): w = np.linspace(0, .5, 2) x = np.linspace(-50., 20., 100) P = CBEMClampedFiberSP() spirrid = SPIRRID(q = P, sampling_type = 'LHS', evars = dict(w = w, x = x), tvars = dict(Ll = Ll, Lr = Lr, tau = RV('uniform', 0.0, .2), l = RV('uniform', 5.0, 15.0), A_f = Af, E_f = Ef, theta = RV('uniform', 0.0, .02), xi = xi,#RV('weibull_min', scale = 0.0179, shape = 5, n_int = 10), phi = phi, E_m = Em, A_m = Am, Nf = Nf ), n_int = 20) for i in range(n): if i == n - 1: plt.plot(x, P(0.0, x, *spirrid.get_samples(n)[:, i]), color = 'black', label = 'random filament response') plt.plot(x, P(0.0, x, *spirrid.get_samples(n)[:, i]), color = 'black') plt.plot(x, spirrid.mu_q_arr[1, :], lw = 4, color = 'black', ls = '--', label = 'normalized yarn repsonse') #plt.xlabel( '$\mathrm{position}{[mm]}$', fontsize = 24 ) #plt.ylabel( '$\mathrm{force} \, P_\mathrm{y}/N_\mathrm{f} \mathrm{[N]}$', fontsize = 24 ) #plt.title( '$\mathrm{yarn \, crack \, bridge}$' , fontsize = 20 ) plt.xticks(fontsize = 20) plt.yticks(fontsize = 20) plt.legend(loc = 'lower right') plt.ylim(0, 0.35) plt.show()
def random_samples_Pw(n): w = np.linspace(0, 1.7, 300) P = CBEMClampedFiber() spirrid = SPIRRID(q = P, sampling_type = 'LHS', evars = dict(w = w ), tvars = dict(Ll = 50., Lr = 20., tau = RV('uniform', 0.05, .15), l = RV('uniform', 5.0, 10.0), A_f = Af, E_f = Ef, theta = RV('uniform', 0.0, .02), xi = RV('weibull_min', scale = 0.017, shape = 5, n_int = 10), phi = phi, E_m = Em, A_m = 50., Nf = 1700. ), n_int = 20) for i in range(n): if i == n - 1: plt.plot(w, P(w, *spirrid.get_samples(n)[:, i]), color = 'black', label = 'random filament response') plt.plot(w, P(w, *spirrid.get_samples(n)[:, i]), color = 'black') plt.plot(w, spirrid.mu_q_arr, lw = 4, color = 'black', ls = '--', label = 'normalized yarn repsonse') plt.xlabel('$\mathrm{crack width} \, w \mathrm{[mm]}$', fontsize = 24) plt.ylabel('$\mathrm{force} \, P_\mathrm{y,0}/N_\mathrm{f} \mathrm{[N]}$', fontsize = 24) plt.xticks(fontsize = 20) plt.yticks(fontsize = 20) #plt.title( '$\mathrm{yarn \, crack \, bridge}$' , fontsize = 20 ) plt.legend(loc = 'best') plt.show()