Cody

Solution 1734594

Submitted on 24 Feb 2019 by William
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
% The following properties are measured at room temperature and are tensile % in a single direction. Some materials, such as metals are generally % isotropic, whereas others, like composite are highly anisotropic % (different properties in different directions). Also, property values can % range depending on the material grade. Finally, thermal or environmental % changes can alter these properties, sometimes drastically.

2   Pass
S_y = 250e6; %Pa S_u = 400e6; %Pa e_y = 0.00125; e_u = 0.35; nu = 0.26; %Poisson's ratio G = 79.3e9; %Pa (shear modulus) E = 200e9; %Pa (elastic modulus) density = 7.85; %g/cm^3 sh_exp = 0.14; %strain-hardening exponent sh_coeff = 463e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 1.5625e5, 5.096e7, 2.548e10, 12.28e7, 12.26e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

3   Pass
S_y = 830e6; %Pa S_u = 900e6; %Pa e_y = 0.00728; e_u = 0.14; nu = 0.342; G = 44e9; %Pa E = 114e9; %Pa density = 4.51; %g/cm^3 sh_exp = 0.04; %strain-hardening exponent sh_coeff = 974e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 3.0212e6, 19.96e7, 2.528e10, 12.12e7, 11.82e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

4   Pass
S_y = 1172e6; %Pa S_u = 1407e6; %Pa e_y = 0.00563; e_u = 0.027; nu = 0.29; G = 11.6e9; %Pa E = 208e9; %Pa density = 8.19; %g/cm^3 sh_exp = 0.075; %strain-hardening exponent sh_coeff = 1845e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 3.29918e6, 17.18e7, 2.540e10, 3.535e7, 3.205e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

5   Pass
S_y = 241e6; %Pa S_u = 300e6; %Pa e_y = 0.0035; e_u = 0.15; nu = 0.33; G = 26e9; %Pa E = 68.9e9; %Pa density = 2.7; %g/cm^3 sh_exp = 0.042; %strain-hardening exponent sh_coeff = 325e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 4.2175e5, 11.11e7, 2.552e10, 4.321e7, 4.279e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

6   Pass
S_y = 70e6; %Pa S_u = 220e6; %Pa e_y = 0.00054; e_u = 0.48; nu = 0.34; G = 48e9; %Pa E = 130e9; %Pa density = 8.92; %g/cm^3 sh_exp = 0.44; %strain-hardening exponent sh_coeff = 304e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 1.89e4, 2.466e7, 1.457e10, 7.342e7, 7.340e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

7   Pass
S_y = 317e6; %Pa S_u = 1130e6; %Pa e_y = 0.000685; e_u = 0.24; nu = 0.3; G = 178e9; %Pa E = 463e9; %Pa density = 21.02; %g/cm^3 sh_exp = 0.353; %strain-hardening exponent sh_coeff = 1870e6; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 1.085725e5, 5.376e7, 2.203e10, 20.06e7, 20.05e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

8   Pass
S_y = 82e6; %Pa S_u = 82e6; %Pa e_y = 0.0265; e_u = 0.45; nu = 0.41; G = 2.8e9; %Pa E = 3.1e9; %Pa density = 1.14; %g/cm^3 sh_exp = 0; %strain-hardening exponent sh_coeff = 0; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 1.0865e6, 7.193e7, 0.272e10, 3.581e7, 3.473e7]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; diffs(isnan(diffs)) = 0; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

9   Pass
S_y = 230e6; %Pa S_u = 230e6; %Pa e_y = 0.016; e_u = 0.016; nu = 0.35; G = 13.0e9; %Pa E = 14.5e9; %Pa density = 1.51; %g/cm^3 sh_exp = 0; %strain-hardening exponent sh_coeff = 0; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 1.84e6, 15.23e7, 0.960e10, 0.184e7, 0]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; diffs(isnan(diffs)) = 0; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end

10   Pass
S_y = 1200e6; %Pa S_u = 1200e6; %Pa e_y = 0.001; e_u = 0.001; nu = 0.20; G = 478e9; %Pa E = 1200e9; %Pa density = 3.51; %g/cm^3 sh_exp = 0; %strain-hardening exponent sh_coeff = 0; %strain-hardening coefficient [arr_vals] = stress_strain8(S_y,S_u,e_y,e_u,nu,G,E,density,sh_exp,sh_coeff); arr_vals_corr = [S_y, e_y, S_u, e_u, nu, G, E, density, sh_exp, sh_coeff,... 6e5, 34.19e7, 34.19e10, 0.06e7, 0]; diffs = abs(arr_vals-arr_vals_corr)./arr_vals_corr; diffs(isnan(diffs)) = 0; for i = 1:numel(diffs) assert(diffs(i)<1e-2) end