engineeringkit.materials#
Crystal structures, packing factor, theoretical density and Bragg
diffraction; Fick’s laws, the Arrhenius diffusivity and carburizing with
the error function (scipy.special.erf); the lever rule and Avrami
kinetics; Brinell and Vickers hardness; normal stress and strain, Hooke’s law, Lamé’s isotropic constants and
Duhamel’s thermal stress; resilience, toughness and the measured
stress-strain curve with its offset yield strength; principal stresses and
the Tresca and von Mises yield criteria in three dimensions; the Voigt,
Reuss and Halpin-Tsai composite moduli and classical laminate theory;
Basquin’s S-N law, the Gerber, Goodman and Soderberg mean-stress lines,
Marin’s endurance-limit factors, the Coffin-Manson strain-life curve and
Palmgren-Miner damage; stress concentration, notch sensitivity and Neuber’s
rule; Weibull’s strength of brittle materials; Griffith’s fracture stress, Irwin’s stress intensity
factor and Paris crack growth integrated over a crack’s life
(scipy.integrate.cumulative_trapezoid); Norton creep and the
Larson-Miller parameter; Frenkel’s ideal shear strength, the Peierls stress,
Hall-Petch strengthening and the Ramberg-Osgood curve.
engineeringkit.materials: structure, diffusion, phases, elasticity, yielding, fatigue, fracture, creep and composites.
Crystal packing, theoretical density and Bragg diffraction; Fick’s laws and carburizing; the lever rule and Avrami kinetics; Young’s modulus, Lamé’s isotropic constants and Duhamel’s thermal stress; Brinell and Vickers hardness; principal stresses and Tresca’s and von Mises’s yield criteria; the Voigt, Reuss and Halpin-Tsai composite moduli and classical laminate theory; Basquin’s S-N law, the Gerber, Goodman and Soderberg mean-stress lines, Marin’s endurance-limit factors, the Coffin-Manson strain-life law and Palmgren-Miner damage; stress concentration, notch sensitivity and Neuber’s rule; Griffith’s and Irwin’s fracture mechanics, Paris’s crack growth and Weibull’s brittle strength; Norton creep and the Larson-Miller parameter; Frenkel’s ideal strength, the Peierls stress, Hall-Petch strengthening and the Ramberg-Osgood curve. Models are hand-written closed forms; SciPy’s trapezoid rules integrate measured curves and crack growth.
- class engineeringkit.materials.CrackGrowthResult(crack_length, cycles)[source]#
Bases:
objectFatigue crack length against cycles, from
crack_growth_life().- Parameters:
crack_length (ndarray)
cycles (ndarray)
- crack_length: ndarray#
Crack lengths, increasing [m].
- Type:
ndarray
- cycles: ndarray#
Cycles needed to grow from the first crack length to each one.
- Type:
ndarray
- cycles_to(a)[source]#
Cycles to reach a crack length, interpolated along the growth history.
- Parameters:
a (float or array_like) – Crack length [m], between the initial and final lengths.
- Returns:
Load cycles [-].
- Return type:
float or ndarray
- property life: float#
Cycles to grow from the initial to the final crack length.
- Type:
float
- class engineeringkit.materials.Laminate(angles, z, Q, Qbar, A, B, D)[source]#
Bases:
objectA stack of orthotropic plies, from
classical_laminate().Forces per unit width
N = (Nx, Ny, Nxy)[N/m] and moments per unit widthM = (Mx, My, Mxy)[N] act on midplane strainseps0and curvatureskappa[1/m] through[N; M] = [[A, B], [B, D]] [eps0; kappa].- Parameters:
angles (ndarray)
z (ndarray)
Q (ndarray)
Qbar (ndarray)
A (ndarray)
B (ndarray)
D (ndarray)
- A: ndarray#
Extensional stiffness [N/m].
- Type:
ndarray
- B: ndarray#
Bending-extension coupling [N]; zero for a symmetric laminate.
- Type:
ndarray
- D: ndarray#
Bending stiffness [N m].
- Type:
ndarray
- Q: ndarray#
Reduced stiffness of a ply in its material axes [Pa].
- Type:
ndarray
- Qbar: ndarray#
Stiffness of each ply in laminate axes, shape
(n, 3, 3)[Pa].- Type:
ndarray
- property abd: ndarray#
The 6 x 6 matrix
[[A, B], [B, D]].- Type:
ndarray
- angles: ndarray#
Fibre angle of each ply, bottom to top [rad].
- Type:
ndarray
- effective_moduli()[source]#
In-plane engineering constants of a balanced, symmetric laminate.
- Returns:
Ex,Ey,Gxy[Pa] andnuxy[-], from the inverse ofAtimes the thickness. They ignore any bending coupling.- Return type:
dict
- midplane_response(N=(0.0, 0.0, 0.0), M=(0.0, 0.0, 0.0))[source]#
Midplane strains and curvatures under in-plane loads.
- Parameters:
N (array_like, optional) –
(Nx, Ny, Nxy)force resultants [N/m].M (array_like, optional) –
(Mx, My, Mxy)moment resultants [N].
- Returns:
(eps0, kappa): midplane strains(ex, ey, gxy)[-] and curvatures [1/m].- Return type:
tuple of ndarray
- plot(ax=None)[source]#
Plot each ply’s stiffness Qbar_11 [GPa] through the thickness; return
(fig, ax).
- ply_stresses(N=(0.0, 0.0, 0.0), M=(0.0, 0.0, 0.0))[source]#
Stresses at each ply’s mid-height, in the ply’s material axes.
- Parameters:
N (array_like, optional) – Force and moment resultants, as in
midplane_response().M (array_like, optional) – Force and moment resultants, as in
midplane_response().
- Returns:
(sigma_1, sigma_2, tau_12)[Pa] for each ply, shape(n, 3).- Return type:
ndarray
- summary()[source]#
Ply count, thickness [m], symmetry and the effective moduli [Pa].
- Return type:
dict
- property thickness: float#
Total thickness [m].
- Type:
float
- z: ndarray#
Ply interface heights from the midplane, increasing [m].
- Type:
ndarray
- class engineeringkit.materials.StressStrainCurve(strain, stress)[source]#
Bases:
objectA sampled engineering stress-strain curve from a tensile test.
The arrays are validated (matching vectors, strictly increasing strain) and copied on construction.
- Parameters:
strain (ndarray)
stress (ndarray)
- offset_yield_strength(offset=0.002, n=5)[source]#
Stress where the curve crosses the elastic line shifted by
offsetstrain.- Parameters:
offset (float, optional) – Plastic strain offset [-], positive (0.2% by default).
n (int, optional) – Samples used for the elastic slope, as in
young_modulus().
- Returns:
Offset yield strength [Pa].
- Return type:
float
- Raises:
ValueError – If the curve never crosses the offset line.
- strain: ndarray#
Engineering strain, strictly increasing [-].
- Type:
ndarray
- stress: ndarray#
Engineering stress at each strain [Pa].
- Type:
ndarray
- engineeringkit.materials.arrhenius_creep_rate(A, Q, R, T, sigma, n=1)[source]#
Steady-state (secondary) creep rate, Norton’s law with an Arrhenius factor.
\[\dot\varepsilon = A\,\sigma^n e^{-Q/RT}\]- Parameters:
A (float or array_like) – Material constant [1/(s Pa^n)], nonnegative.
Q (float or array_like) – Activation energy for creep [J/mol], nonnegative.
R (float or array_like) – Gas constant [J/(mol K)], positive (8.314).
T (float or array_like) – Absolute temperature [K], positive.
sigma (float or array_like) – Applied stress [Pa], nonnegative.
n (float or array_like) – Stress exponent [-], positive (1 for diffusion creep, 3 to 8 for dislocation creep).
- Returns:
Creep strain rate [1/s].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
F. H. Norton, The Creep of Steel at High Temperatures (McGraw-Hill, New York, 1929).
- engineeringkit.materials.atomic_packing_factor(structure)[source]#
Fraction of a unit cell’s volume filled by its hard-sphere atoms.
\[\mathrm{APF} = \frac{n\,\tfrac43\pi R^3}{V_c}\]- Parameters:
structure ({"sc", "bcc", "fcc", "hcp"}) – Crystal structure;
"hcp"uses the ideal ratio \(c/a = \sqrt{8/3}\).- Returns:
Packing factor [-]: 0.52, 0.68, 0.74 and 0.74.
- Return type:
float
Notes
FCC and ideal HCP reach Kepler’s close-packing limit \(\pi/\sqrt{18}\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(atomic_packing_factor("bcc"), 4) 0.6802
- engineeringkit.materials.avrami_fit(t, fraction)[source]#
Fit
kandnto transformation data on Avrami axes.\(\ln(-\ln(1 - y)) = \ln k + n \ln t\) is a straight line, so a power-law fit of \(-\ln(1 - y)\) against \(t\) gives both constants.
- Parameters:
t (array_like) – Times [s], positive, at least two distinct.
fraction (array_like) – Matching fractions transformed [-], in (0, 1).
- Returns:
(k, n): the rate constant [1/s^n] and the exponent [-].- Return type:
tuple of float
Notes
Points near 0 and 1 carry the most scatter; trim them before fitting. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.avrami_fraction(t, k, n)[source]#
Transformed fraction from the Avrami (Johnson-Mehl-Avrami-Kolmogorov) equation.
\[y = 1 - e^{-k t^n}\]- Parameters:
t (float or array_like) – Time since the transformation began [s], nonnegative.
k (float or array_like) – Rate constant [1/s^n], positive.
n (float or array_like) – Avrami exponent [-], positive (1 to 4: 4 for constant nucleation and three-dimensional growth, 3 for site-saturated growth).
- Returns:
Fraction transformed [-].
- Return type:
float or ndarray
Notes
Isothermal transformation only. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
M. Avrami, “Kinetics of phase change. I. General theory,” J. Chem. Phys. 7 (1939) 1103-1112.
Examples
>>> round(float(avrami_fraction(10.0, 1e-3, 3.0)), 4) 0.6321
- engineeringkit.materials.avrami_time(fraction, k, n)[source]#
Time to transform a given fraction, \(t = \left(-\ln(1 - y)/k\right)^{1/n}\).
- Parameters:
fraction (float or array_like) – Fraction transformed \(y\) [-], in (0, 1); 0.5 gives the half time whose inverse Callister calls the rate.
k (float or array_like) – Rate constant [1/s^n], positive.
n (float or array_like) – Avrami exponent [-], positive.
- Returns:
Time [s].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(avrami_time(0.5, 1e-3, 3.0)), 3) 8.85
- engineeringkit.materials.basquin_cycles(stress_amplitude, sigma_f, b)[source]#
Cycles to failure from Basquin’s stress-life law.
\[\sigma_a = \sigma_f'(2N)^b \quad\Rightarrow\quad N = \tfrac{1}{2}\left(\sigma_a/\sigma_f'\right)^{1/b}\]- Parameters:
stress_amplitude (float or array_like) – Fully reversed stress amplitude \(\sigma_a\) [Pa], positive.
sigma_f (float or array_like) – Fatigue strength coefficient \(\sigma_f'\) [Pa], positive.
b (float or array_like) – Fatigue strength exponent [-], negative (typically -0.05 to -0.12).
- Returns:
Cycles to failure \(N\) (not reversals \(2N\)).
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
O. H. Basquin, “The exponential law of endurance tests,” Proc. Am. Soc. Test. Mater. 10 (1910) 625-630.
Examples
>>> float(basquin_cycles(500e6, 1000e6, -0.1)) 512.0
- engineeringkit.materials.bragg_angle(d, wavelength, order=1)[source]#
Bragg angle \(\theta\) from \(n\lambda = 2d\sin\theta\).
- Parameters:
d (float or array_like) – Interplanar spacing [m], positive.
wavelength (float or array_like) – X-ray wavelength \(\lambda\) [m], positive.
order (int, optional) – Order of reflection \(n\), at least 1.
- Returns:
Angle between the beam and the planes [rad]; the diffractometer reads \(2\theta\).
- Return type:
float or ndarray
- Raises:
ValueError – If \(n\lambda > 2d\), when the planes cannot reflect.
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
W. L. Bragg, “The diffraction of short electromagnetic waves by a crystal,” Proc. Camb. Phil. Soc. 17 (1913) 43-57.
Examples
>>> round(float(np.degrees(2 * bragg_angle(0.1013e-9, 0.1790e-9))), 1) 124.1
- engineeringkit.materials.brinell_hardness(load, ball_diameter, indent_diameter)[source]#
Brinell hardness number from the indentation diameter.
\[\mathrm{HB} = \frac{2P}{\pi D\left(D - \sqrt{D^2 - d^2}\right)}\]with \(P\) in kgf and \(D\), \(d\) in mm.
- Parameters:
load (float or array_like) – Test load [N], positive (29.4 kN, i.e. 3000 kgf, for steel).
ball_diameter (float or array_like) – Ball diameter \(D\) [m], positive (10 mm standard).
indent_diameter (float or array_like) – Diameter of the dent \(d\) [m], positive and less than
D.
- Returns:
HB [kgf/mm^2, conventionally written without units].
- Return type:
float or ndarray
Notes
Valid for \(0.24D < d < 0.6D\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. A. Brinell, “Mémoire sur les épreuves à bille en acier,” Congrès International des Méthodes d’Essai des Matériaux de Construction (Paris, 1900), vol. 2, 83-94.
Examples
>>> round(float(brinell_hardness(500 * 9.80665, 10e-3, 1.62e-3)), 1) 241.0
- engineeringkit.materials.brinell_tensile_strength(HB, factor=3450000.0)[source]#
Tensile strength estimated from Brinell hardness, \(S_{ut} \approx 3.45\,\mathrm{HB}\) MPa.
- Parameters:
HB (float or array_like) – Brinell hardness number, positive.
factor (float, optional) – Strength per hardness point [Pa], positive: 3.45 MPa for most steels (Callister, Eq. 6.20a); brass and cast iron need their own factors.
- Returns:
Ultimate tensile strength [Pa].
- Return type:
float or ndarray
Notes
An empirical correlation, good to about 10% for plain carbon and low-alloy steels below 500 HB. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> float(brinell_tensile_strength(200.0)) / 1e6 690.0
- engineeringkit.materials.bulk_modulus(E, nu)[source]#
Isotropic bulk modulus \(K = E / (3(1 - 2\nu))\).
- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
nu (float or array_like) – Poisson’s ratio [-], in (-1, 0.5); \(K \to \infty\) as \(\nu \to 1/2\).
- Returns:
Bulk modulus [Pa].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.classical_laminate(E1, E2, nu12, G12, angles, ply_thickness)[source]#
Assemble the ABD matrix of a laminate by classical laminate theory.
\[(A, B, D)_{ij} = \sum_k \bar Q_{ij}^{(k)}\, \left(z_k - z_{k-1},\ \tfrac12(z_k^2 - z_{k-1}^2),\ \tfrac13(z_k^3 - z_{k-1}^3)\right)\]- Parameters:
E1 (float) – Ply properties, as in
lamina_stiffness().E2 (float) – Ply properties, as in
lamina_stiffness().nu12 (float) – Ply properties, as in
lamina_stiffness().G12 (float) – Ply properties, as in
lamina_stiffness().angles (array_like) – Fibre angle of each ply [rad], listed from the bottom (most negative z) to the top.
ply_thickness (float or array_like) – Thickness of every ply, or of each [m], positive.
- Returns:
The stacking sequence, the A, B and D matrices and the midplane and ply-stress solvers.
- Return type:
Notes
Kirchhoff plate kinematics (straight normals) and perfect bonding are assumed; interlaminar stresses near free edges are not modelled. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
E. Reissner and Y. Stavsky, “Bending and stretching of certain types of heterogeneous aeolotropic elastic plates,” J. Appl. Mech. 28 (1961) 402-408.
Examples
>>> lam = classical_laminate(140e9, 10e9, 0.3, 5e9, [0.0, np.pi / 2, np.pi / 2, 0.0], 0.125e-3) >>> bool(np.allclose(lam.B, 0)) True
- engineeringkit.materials.coffin_manson_cycles(plastic_strain_amplitude, epsilon_f, c)[source]#
Cycles to failure from the Coffin-Manson low-cycle fatigue law.
\[\frac{\Delta\varepsilon_p}{2} = \varepsilon_f'(2N)^c \quad\Rightarrow\quad N = \tfrac{1}{2}\left(\frac{\Delta\varepsilon_p/2}{\varepsilon_f'}\right)^{1/c}\]- Parameters:
plastic_strain_amplitude (float or array_like) – Plastic strain amplitude \(\Delta\varepsilon_p/2\) [-], positive.
epsilon_f (float or array_like) – Fatigue ductility coefficient \(\varepsilon_f'\) [-], positive.
c (float or array_like) – Fatigue ductility exponent [-], negative (typically -0.5 to -0.7).
- Returns:
Cycles to failure \(N\).
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
L. F. Coffin Jr., “A study of the effects of cyclic thermal stresses on a ductile metal,” Trans. ASME 76 (1954) 931-950; S. S. Manson, “Behavior of materials under conditions of thermal stress,” NACA Report 1170 (1954).
Examples
>>> float(coffin_manson_cycles(0.01, 0.64, -0.5)) 2048.0
- engineeringkit.materials.constrained_thermal_stress(E, alpha, dT)[source]#
Stress in a bar held at fixed length while its temperature changes.
\[\sigma = -E\alpha\,\Delta T\]- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
alpha (float or array_like) – Linear expansion coefficient [1/K].
dT (float or array_like) – Temperature change [K].
- Returns:
Stress [Pa], compressive (negative) on heating.
- Return type:
float or ndarray
Notes
Uniaxial restraint only; a plate restrained in two directions carries \(-E\alpha\Delta T/(1 - \nu)\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J.-M.-C. Duhamel, “Mémoire sur le calcul des actions moléculaires développées par les changements de température dans les corps solides,” Mém. Divers Savants Acad. R. Sci. Inst. France 5 (1838) 440-498.
- engineeringkit.materials.crack_growth_life(C, m, delta_sigma, a0, af, Y=1.0, points=2001)[source]#
Integrate Paris’s law from an initial to a final crack length.
\[N = \int_{a_0}^{a_f} \frac{da}{C\,(Y(a)\,\Delta\sigma\sqrt{\pi a})^m}\]- Parameters:
C (float) – Paris coefficient [m/cycle per (Pa sqrt(m))^m], positive.
m (float) – Paris exponent [-], positive.
delta_sigma (float) – Stress range [Pa], positive.
a0 (float) – Initial crack length [m], positive.
af (float) – Final crack length [m], greater than
a0; oftencritical_crack_length()at the peak stress.Y (
float|Callable) – Geometry factor [-], a positive constant or a functionY(a)of crack length [m] (for example a finite-width correction).points (int) – Number of geometrically spaced crack lengths, at least 2.
- Returns:
Crack length against cycles.
- Return type:
Notes
All parameters are scalar-only: the result is one integrated crack-growth history.
The trapezoid rule on a geometric grid; with a constant
Yand \(m \ne 2\) the closed form \(N = 2(a_0^{1-m/2} - a_f^{1-m/2}) / ((m - 2) C (Y\Delta\sigma\sqrt\pi)^m)\) checks it. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.critical_crack_length(Kic, sigma, Y=1.0)[source]#
Crack length at which \(K_I\) reaches the toughness, \(a_c = (K_{Ic}/Y\sigma)^2/\pi\).
- Parameters:
Kic (float or array_like) – Plane-strain fracture toughness [Pa sqrt(m)], positive.
sigma (float or array_like) – Remote tensile stress [Pa], positive.
Y (float or array_like) – Geometry factor [-], positive.
- Returns:
Critical crack length [m].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.cubic_lattice_parameter(atomic_radius, structure)[source]#
Edge length of a cubic unit cell of touching hard spheres.
\[a_{sc} = 2R, \quad a_{bcc} = \frac{4R}{\sqrt3}, \quad a_{fcc} = 2\sqrt2\,R\]- Parameters:
atomic_radius (float or array_like) – Atomic radius \(R\) [m], positive.
structure ({"sc", "bcc", "fcc"}) – Cubic crystal structure. Atoms touch along the cube edge, the body diagonal and the face diagonal respectively.
- Returns:
Lattice parameter \(a\) [m].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(cubic_lattice_parameter(0.128e-9, "fcc")) * 1e9, 4) 0.362
- engineeringkit.materials.density_rule_of_mixtures(rhof, rhom, Vf)[source]#
Composite density \(\rho = V_f\rho_f + (1 - V_f)\rho_m\).
- Parameters:
rhof (float or array_like) – Fibre density [kg/m^3], positive.
rhom (float or array_like) – Matrix density [kg/m^3], positive.
Vf (float or array_like) – Fibre volume fraction [-], in [0, 1].
- Returns:
Density [kg/m^3], exact for a void-free composite.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.diffraction_peaks(a, wavelength, structure, max_index=4)[source]#
First-order powder diffraction peaks of a cubic crystal, in order of angle.
Planes whose atoms scatter out of phase give no peak: in BCC \(h + k + l\) must be even, and in FCC \(h, k, l\) must be all odd or all even.
- Parameters:
a (float) – Lattice parameter [m], positive.
wavelength (float) – X-ray wavelength [m], positive.
structure ({"sc", "bcc", "fcc"}) – Cubic crystal structure.
max_index (int, optional) – Largest Miller index searched, at least 1.
- Returns:
(planes, two_theta): one \((hkl)\) row with \(h \ge k \ge l \ge 0\) per peak, shape(n, 3), and the diffraction angles \(2\theta\) [rad], increasing. Families with the same \(h^2 + k^2 + l^2\), such as (300) and (221), share a peak and are listed once.- Return type:
tuple of ndarray
Notes
Families with \(\lambda > 2d\) are dropped. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> planes, _ = diffraction_peaks(0.2866e-9, 0.1790e-9, "bcc") >>> planes[:3].tolist() [[1, 1, 0], [2, 0, 0], [2, 1, 1]]
- engineeringkit.materials.diffusion_coefficient(D0, Qd, T)[source]#
Arrhenius diffusion coefficient \(D = D_0\,e^{-Q_d/RT}\).
- Parameters:
D0 (float or array_like) – Pre-exponential factor [m^2/s], positive.
Qd (float or array_like) – Activation energy for diffusion [J/mol], nonnegative.
T (float or array_like) – Absolute temperature [K], positive.
- Returns:
Diffusion coefficient [m^2/s].
- Return type:
float or ndarray
Notes
Uses the molar gas constant 8.314 J/(mol K). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> f"{float(diffusion_coefficient(1.2e-4, 130e3, 823.0)):.2e}" '6.74e-13'
- engineeringkit.materials.diffusion_time(x, concentration, D, C0, Cs)[source]#
Time for a semi-infinite solid to reach
concentrationat depthx.Inverts
semi_infinite_concentration(): \(t = x^2 / (4Dz^2)\) with \(\operatorname{erf} z = (C_s - C)/(C_s - C_0)\).- Parameters:
x (float or array_like) – Depth [m], positive.
concentration (float or array_like) – Target concentration [any unit], strictly between
C0andCs.D (float or array_like) – Diffusion coefficient [m^2/s], positive.
C0 (float or array_like) – Initial and surface concentrations [same unit], different.
Cs (float or array_like) – Initial and surface concentrations [same unit], different.
- Returns:
Time [s].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(diffusion_time(5e-4, 0.80, 1.6e-11, 0.25, 1.20)) / 3600, 2) 7.05
- engineeringkit.materials.elliptical_hole_concentration(a, b)[source]#
Inglis’s stress concentration at an elliptical hole in a wide plate, \(K_t = 1 + 2a/b\).
- Parameters:
a (float or array_like) – Semi-axis across the load [m], positive.
b (float or array_like) – Semi-axis along the load [m], positive.
- Returns:
\(K_t\) [-]: 3 for a circular hole, unbounded as the ellipse closes into a crack.
- Return type:
float or ndarray
Notes
Equivalently \(K_t = 1 + 2\sqrt{a/\rho}\) with the root radius \(\rho = b^2/a\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
C. E. Inglis, “Stresses in a plate due to the presence of cracks and sharp corners,” Trans. Inst. Naval Archit. 55 (1913) 219-241.
Examples
>>> float(elliptical_hole_concentration(1.0, 1.0)) 3.0
- engineeringkit.materials.endurance_limit_estimate(Sut)[source]#
Rotating-beam endurance limit of a steel estimated from its strength.
\[S_e' = 0.5\,S_{ut} \ (S_{ut} \le 1400\ \mathrm{MPa}), \qquad S_e' = 700\ \mathrm{MPa}\ \text{above}\]- Parameters:
Sut (float or array_like) – Ultimate tensile strength [Pa], positive.
- Returns:
Endurance limit of a polished specimen [Pa].
- Return type:
float or ndarray
Notes
For steels only; aluminium and copper alloys have no endurance limit. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> float(endurance_limit_estimate(600e6)) / 1e6 300.0
- engineeringkit.materials.factor_of_safety(strength, stress)[source]#
Factor of safety \(n = S / \sigma\).
- Parameters:
strength (float or array_like) – Material strength [Pa], positive.
stress (float or array_like) – Equivalent working stress [Pa], positive.
- Returns:
Safety factor [-].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.fatigue_notch_factor(Kt, q)[source]#
Fatigue stress concentration \(K_f = 1 + q(K_t - 1)\).
- Parameters:
Kt (float or array_like) – Elastic stress concentration factor [-], at least 1.
q (float or array_like) – Notch sensitivity [-], in [0, 1].
- Returns:
\(K_f\) [-], between 1 and \(K_t\).
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> float(fatigue_notch_factor(3.0, 0.5)) 2.0
- engineeringkit.materials.fick_flux(D, concentration_gradient)[source]#
Fick’s first law, the steady diffusion flux \(J = -D\,dC/dx\).
- Parameters:
D (float or array_like) – Diffusion coefficient [m^2/s], positive.
concentration_gradient (float or array_like) – \(dC/dx\) [kg/m^4] (or [mol/m^4]).
- Returns:
Flux [kg/(m^2 s)] (or [mol/(m^2 s)]), positive down the gradient.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
Fick, “Ueber Diffusion,” Ann. Phys. 170 (1855) 59-86.
Examples
>>> f"{float(fick_flux(3e-11, (0.8 - 1.2) / 5e-3)):.1e}" '2.4e-09'
- engineeringkit.materials.gerber_safety_factor(sa, sm, Se, Sut)[source]#
Safety factor against fatigue on Gerber’s mean-stress parabola.
\[\frac{n\sigma_a}{S_e} + \left(\frac{n\sigma_m}{S_{ut}}\right)^2 = 1 \quad\Rightarrow\quad n = \frac{2}{\sigma_a/S_e + \sqrt{(\sigma_a/S_e)^2 + 4(\sigma_m/S_{ut})^2}}\]- Parameters:
sa (float or array_like) – Alternating stress amplitude [Pa], nonnegative.
sm (float or array_like) – Mean stress [Pa], nonnegative (tensile).
Se (float or array_like) – Endurance limit [Pa], positive.
Sut (float or array_like) – Ultimate tensile strength [Pa], positive.
- Returns:
Safety factor [-] along a load line through the origin; never below Goodman’s.
- Return type:
float or ndarray
- Raises:
ValueError – If both stresses are zero.
Notes
Gerber’s parabola runs through the middle of ductile-steel test data, so it is a best estimate rather than a design line. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
H. Gerber, “Bestimmung der zulässigen Spannungen in Eisen-Constructionen,” Z. Bayer. Archit. Ing.-Ver. 6 (1874) 101-110.
Examples
>>> round(float(gerber_safety_factor(100e6, 0.0, 200e6, 600e6)), 6) 2.0
- engineeringkit.materials.goodman_safety_factor(sa, sm, Se, Sut)[source]#
Safety factor against fatigue on Goodman’s mean-stress line.
\[\frac{1}{n} = \frac{\sigma_a}{S_e} + \frac{\sigma_m}{S_{ut}}\]- Parameters:
sa (float or array_like) – Alternating stress amplitude [Pa], nonnegative.
sm (float or array_like) – Mean stress [Pa], nonnegative (tensile).
Se (float or array_like) – Endurance limit or fully reversed fatigue strength [Pa], positive.
Sut (float or array_like) – Ultimate tensile strength [Pa], positive.
- Returns:
Safety factor [-], the factor by which both stresses can grow proportionally before reaching the Goodman line.
- Return type:
float or ndarray
- Raises:
ValueError – If both stresses are zero.
Notes
Compressive mean stresses, where the line is usually replaced by \(\sigma_a = S_e\), are not accepted. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. Goodman, Mechanics Applied to Engineering (Longmans, Green, London, 1899).
- engineeringkit.materials.griffith_fracture_stress(E, gamma, a)[source]#
Griffith’s fracture stress of a brittle plate with a central crack.
\[\sigma_f = \sqrt{\frac{2E\gamma_s}{\pi a}}\]- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
gamma (float or array_like) – Surface energy \(\gamma_s\) [J/m^2], positive.
a (float or array_like) – Half-length of the crack [m], positive.
- Returns:
Remote tensile stress at fracture [Pa], plane stress.
- Return type:
float or ndarray
Notes
Ideally brittle solid; plastic work at the tip, which dominates in metals, is left out. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
A. A. Griffith, “The phenomena of rupture and flow in solids,” Phil. Trans. R. Soc. Lond. A 221 (1921) 163-198.
- engineeringkit.materials.hall_petch(sigma0, k, d)[source]#
Hall-Petch yield strength \(\sigma_y = \sigma_0 + k\,d^{-1/2}\).
- Parameters:
sigma0 (float or array_like) – Friction stress of a single crystal [Pa], nonnegative.
k (float or array_like) – Strengthening coefficient [Pa sqrt(m)], nonnegative.
d (float or array_like) – Mean grain diameter [m], positive.
- Returns:
Yield strength [Pa].
- Return type:
float or ndarray
Notes
Holds down to grain sizes of tens of nanometres, below which grain boundary sliding softens the metal (the inverse Hall-Petch effect). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
E. O. Hall, “The deformation and ageing of mild steel: III Discussion of results,” Proc. Phys. Soc. B 64 (1951) 747-753; N. J. Petch, “The cleavage strength of polycrystals,” J. Iron Steel Inst. 174 (1953) 25-28.
- engineeringkit.materials.halpin_tsai(Pf, Pm, Vf, xi)[source]#
Halpin-Tsai estimate of a composite modulus.
\[\frac{P}{P_m} = \frac{1 + \xi\eta V_f}{1 - \eta V_f}, \qquad \eta = \frac{P_f/P_m - 1}{P_f/P_m + \xi}\]- Parameters:
Pf (float or array_like) – Fibre modulus [Pa], positive (Young’s or shear).
Pm (float or array_like) – Matrix modulus [Pa], positive (the same kind).
Vf (float or array_like) – Fibre volume fraction [-], in [0, 1].
xi (float or array_like) – Reinforcement parameter [-], nonnegative: 2 for the transverse modulus \(E_2\) of circular fibres, 1 for \(G_{12}\), \(2\ell/d\) for \(E_1\) of short fibres.
- Returns:
Composite modulus [Pa]. \(\xi = 0\) gives the Reuss bound and \(\xi \to \infty\) the Voigt bound.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. C. Halpin and S. W. Tsai, “Effects of environmental factors on composite materials,” AFML-TR-67-423, Air Force Materials Laboratory (1969); J. C. Halpin and J. L. Kardos, “The Halpin-Tsai equations: a review,” Polym. Eng. Sci. 16 (1976) 344-352.
Examples
>>> round(float(halpin_tsai(72e9, 3.5e9, 0.6, 2.0)) / 1e9, 2) 14.89
- engineeringkit.materials.hooke_stress(E, strain)[source]#
Uniaxial Hooke’s law \(\sigma = E\varepsilon\).
- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
strain (float or array_like) – Normal strain [-].
- Returns:
Stress [Pa].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
T. Young, A Course of Lectures on Natural Philosophy and the Mechanical Arts (Johnson, London, 1807), vol. 1, lecture XIII.
- engineeringkit.materials.ideal_shear_strength(G, b, a)[source]#
Frenkel’s theoretical shear strength of a perfect crystal.
\[\tau_{max} = \frac{G\,b}{2\pi a}\]- Parameters:
G (float or array_like) – Shear modulus [Pa], positive.
b (float or array_like) – Atomic spacing in the slip direction [m], positive.
a (float or array_like) – Spacing of the slip planes [m], positive.
- Returns:
Stress to slide one plane rigidly over the next [Pa].
- Return type:
float or ndarray
Notes
A sinusoidal resistance whose initial slope is \(G\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. Frenkel, “Zur Theorie der Elastizitätsgrenze und der Festigkeit kristallinischer Körper,” Z. Phys. 37 (1926) 572-609.
Examples
>>> round(float(ideal_shear_strength(2 * np.pi, 1.0, 1.0)), 12) 1.0
- engineeringkit.materials.interplanar_spacing(a, h, k, l)[source]#
Spacing of the \((hkl)\) planes of a cubic crystal, \(d = a/\sqrt{h^2 + k^2 + l^2}\).
- Parameters:
a (float or array_like) – Lattice parameter [m], positive.
h (int or array_like) – Miller indices, integers not all zero.
k (int or array_like) – Miller indices, integers not all zero.
l (int or array_like) – Miller indices, integers not all zero.
- Returns:
Interplanar spacing \(d_{hkl}\) [m].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(interplanar_spacing(0.2866e-9, 2, 2, 0)) * 1e9, 4) 0.1013
- engineeringkit.materials.lame_parameters(E, nu)[source]#
Lamé’s constants \(\lambda\) and \(\mu = G\) from \(E\) and \(\nu\).
\[\lambda = \frac{E\nu}{(1 + \nu)(1 - 2\nu)}, \qquad \mu = \frac{E}{2(1 + \nu)}\]so that \(\sigma_{ij} = \lambda\,\varepsilon_{kk}\delta_{ij} + 2\mu\,\varepsilon_{ij}\).
- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
nu (float or array_like) – Poisson’s ratio [-], in (-1, 0.5).
- Returns:
(lambda, mu)[Pa].- Return type:
tuple
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
G. Lamé, Leçons sur la théorie mathématique de l’élasticité des corps solides (Bachelier, Paris, 1852).
- engineeringkit.materials.lamina_stiffness(E1, E2, nu12, G12)[source]#
Reduced stiffness matrix \(\mathbf Q\) of an orthotropic ply in plane stress.
\[Q_{11} = \frac{E_1}{1 - \nu_{12}\nu_{21}}, \quad Q_{22} = \frac{E_2}{1 - \nu_{12}\nu_{21}}, \quad Q_{12} = \nu_{12} Q_{22}, \quad Q_{66} = G_{12}\]with \(\nu_{21} = \nu_{12} E_2/E_1\).
- Parameters:
E1 (float) – Moduli along and across the fibres [Pa], positive.
E2 (float) – Moduli along and across the fibres [Pa], positive.
nu12 (float) – Major Poisson’s ratio [-], with \(\nu_{12}^2 < E_1/E_2\).
G12 (float) – In-plane shear modulus [Pa], positive.
- Returns:
\(3 \times 3\) matrix [Pa] relating \((\sigma_1, \sigma_2, \tau_{12})\) to \((\varepsilon_1, \varepsilon_2, \gamma_{12})\).
- Return type:
ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.larson_miller_parameter(T, rupture_time, C=20.0)[source]#
Larson-Miller parameter \(P = T\,(C + \log_{10} t_r)\) with \(t_r\) in hours.
- Parameters:
T (float or array_like) – Absolute temperature [K], positive.
rupture_time (float or array_like) – Time to rupture [s], positive; converted to hours inside, the unit the constant
Cis defined for.C (float) – Larson-Miller constant [-], positive (about 20 for steels).
- Returns:
Parameter [K], in the conventional K log10(h) units.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
F. R. Larson and J. Miller, “A time-temperature relationship for rupture and creep stresses,” Trans. ASME 74 (1952) 765-775.
Examples
>>> float(larson_miller_parameter(1000.0, 3600.0 * 1000)) 23000.0
- engineeringkit.materials.larson_miller_rupture_time(P, T, C=20.0)[source]#
Time to rupture at temperature \(T\) for a given Larson-Miller parameter.
\[t_r = 10^{P/T - C}\ \text{hours}\]- Parameters:
P (float or array_like) – Larson-Miller parameter [K], positive, read from a master curve at the working stress.
T (float or array_like) – Absolute temperature [K], positive.
C (float) – Larson-Miller constant [-], positive.
- Returns:
Time to rupture [s].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.lever_rule(C0, C_alpha, C_beta)[source]#
Mass fractions of two coexisting phases from the tie line.
\[W_\alpha = \frac{C_\beta - C_0}{C_\beta - C_\alpha}, \qquad W_\beta = \frac{C_0 - C_\alpha}{C_\beta - C_\alpha}\]- Parameters:
C0 (float or array_like) – Overall alloy composition [wt fraction or wt%].
C_alpha (float or array_like) – Compositions of the two phases at the ends of the tie line [same unit], different;
C0must lie between them.C_beta (float or array_like) – Compositions of the two phases at the ends of the tie line [same unit], different;
C0must lie between them.
- Returns:
(W_alpha, W_beta), mass fractions [-] summing to one.- Return type:
tuple of float or ndarray
Notes
Compositions in weight percent give mass fractions; atom percent gives mole fractions. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> W_L, W_alpha = lever_rule(35.0, 31.5, 42.5) >>> round(float(W_L), 2), round(float(W_alpha), 2) (0.68, 0.32)
- engineeringkit.materials.marin_endurance_limit(Se_prime, ka=1.0, kb=1.0, kc=1.0, kd=1.0, ke=1.0, kf=1.0)[source]#
Endurance limit of a part, \(S_e = k_a k_b k_c k_d k_e k_f\,S_e'\).
- Parameters:
Se_prime (float or array_like) – Rotating-beam endurance limit of a polished specimen [Pa], positive.
ka (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
kb (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
kc (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
kd (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
ke (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
kf (float or array_like, optional) – Surface, size, load, temperature, reliability and miscellaneous factors [-], positive.
- Returns:
Endurance limit of the part [Pa].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. Marin, Mechanical Behavior of Engineering Materials (Prentice-Hall, Englewood Cliffs, 1962).
Examples
>>> float(marin_endurance_limit(300e6, ka=0.8, kb=0.9)) / 1e6 216.0
- engineeringkit.materials.marin_load_factor(loading)[source]#
Marin load factor \(k_c\): 1 in bending, 0.85 axial, 0.59 in torsion.
- Parameters:
loading ({"bending", "axial", "torsion"}) – Type of loading.
- Returns:
\(k_c\) [-]. The torsion value is the von Mises shear ratio \(1/\sqrt3\).
- Return type:
float
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.marin_reliability_factor(reliability)[source]#
Marin reliability factor \(k_e = 1 - 0.08\,z_R\).
- Parameters:
reliability (float or array_like) – Required probability of survival [-], in [0.5, 1).
- Returns:
\(k_e\) [-]: 1 at 50%, 0.814 at 99%, assuming endurance limits scatter normally with an 8% coefficient of variation.
- Return type:
float or ndarray
Notes
\(z_R\) is the standard normal quantile of the reliability. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(marin_reliability_factor(0.99)), 3) 0.814
- engineeringkit.materials.marin_size_factor(diameter)[source]#
Marin size factor of a round bar in rotating bending or torsion.
\[k_b = 1.24\,d^{-0.107}\ (2.79 \le d \le 51\ \mathrm{mm}), \qquad k_b = 1.51\,d^{-0.157}\ (51 < d \le 254\ \mathrm{mm})\]- Parameters:
diameter (float or array_like) – Bar diameter [m], between 2.79 mm and 254 mm.
- Returns:
\(k_b\) [-]; about one at the 7.6 mm test-bar size.
- Return type:
float or ndarray
Notes
Use \(k_b = 1\) for axial loading. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(marin_size_factor(32e-3)), 3) 0.856
- engineeringkit.materials.marin_surface_factor(Sut, finish)[source]#
Marin surface factor \(k_a = a\,S_{ut}^b\) (Sut in MPa).
- Parameters:
Sut (float or array_like) – Ultimate tensile strength [Pa], positive.
finish ({"ground", "machined", "hot-rolled", "forged"}) – Surface finish;
"machined"also covers cold-drawn.
- Returns:
\(k_a\) [-], below one and falling with strength.
- Return type:
float or ndarray
Notes
Constants from Shigley’s Mechanical Engineering Design, Table 6-2. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
J. Marin, Mechanical Behavior of Engineering Materials (Prentice-Hall, Englewood Cliffs, 1962).
Examples
>>> round(float(marin_surface_factor(520e6, "machined")), 3) 0.86
- engineeringkit.materials.miner_damage(cycles, cycles_to_failure)[source]#
Palmgren-Miner cumulative damage \(D = \sum_i n_i / N_i\).
- Parameters:
cycles (array_like) – Applied cycles \(n_i\) at each amplitude, nonnegative.
cycles_to_failure (array_like) – Matching lives \(N_i\) at those amplitudes, positive.
- Returns:
Damage [-]; failure is predicted at \(D = 1\).
- Return type:
float
Notes
The sum ignores the order of the blocks. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
A. Palmgren, “Die Lebensdauer von Kugellagern,” Z. Ver. Dtsch. Ing. 68 (1924) 339-341; M. A. Miner, “Cumulative damage in fatigue,” J. Appl. Mech. 12 (1945) A159-A164.
- engineeringkit.materials.neuber_notch_sensitivity(radius, rho)[source]#
Neuber’s notch sensitivity \(q = 1/(1 + \sqrt{\rho/r})\).
- Parameters:
radius (float or array_like) – Notch root radius \(r\) [m], positive.
rho (float or array_like) – Neuber’s material length \(\rho\) [m], positive.
- Returns:
Notch sensitivity [-], between 0 and 1.
- Return type:
float or ndarray
Notes
Shigley tabulates \(\sqrt{\rho}\) against ultimate strength. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.neuber_notch_stress(nominal_stress, Kt, E, sigma_y, n, offset=0.002)[source]#
Local notch-root stress and strain by Neuber’s rule on a Ramberg-Osgood curve.
Solves \(\sigma\varepsilon = (K_t S)^2/E\) together with \(\varepsilon = \sigma/E + \varepsilon_0(\sigma/\sigma_y)^n\).
- Parameters:
nominal_stress (float or array_like) – Nominal (net-section) stress \(S\) [Pa], elastic; its sign is kept.
Kt (float or array_like) – Elastic stress concentration factor [-], at least 1 (use \(K_f\) for fatigue).
E (float or array_like) – Young’s modulus [Pa], positive.
sigma_y (float or array_like) – Offset yield strength of the (cyclic) curve [Pa], positive.
n (float or array_like) – Ramberg-Osgood hardening exponent [-], at least 1.
offset (float, optional) – Plastic strain at
sigma_y[-], positive.
- Returns:
(stress, strain)at the notch root [Pa], [-]. The stress is at most \(K_t S\) and the strain at least \(K_t S/E\).- Return type:
tuple of float or ndarray
Notes
Newton’s method in \(\ln\sigma\) from the elastic stress \(K_t S\) converges monotonically and in a few steps for any \(n\), since \(\ln(\sigma\varepsilon)\) is increasing, convex and nearly linear in \(\ln\sigma\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
H. Neuber, “Theory of stress concentration for shear-strained prismatical bodies with arbitrary nonlinear stress-strain law,” J. Appl. Mech. 28 (1961) 544-550.
Examples
>>> s, e = neuber_notch_stress(100e6, 2.0, 200e9, 1e9, 10) >>> round(float(s) / 1e6, 3) 200.0
- engineeringkit.materials.normal_strain(delta_length, length)[source]#
Engineering normal strain \(\varepsilon = \Delta L / L_0\).
- Parameters:
delta_length (float or array_like) – Change of length \(\Delta L\) [m], positive in extension.
length (float or array_like) – Original gauge length \(L_0\) [m], positive.
- Returns:
Strain [-].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.normal_stress(force, area)[source]#
Engineering normal stress \(\sigma = F/A_0\).
- Parameters:
force (float or array_like) – Axial force \(F\) [N], positive in tension.
area (float or array_like) – Original cross-sectional area \(A_0\) [m^2], positive.
- Returns:
Normal stress [Pa].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> float(normal_stress(1000.0, 1e-4)) 10000000.0
- engineeringkit.materials.paris_crack_growth(C, m, delta_K)[source]#
Fatigue crack growth rate from Paris’s law, \(da/dN = C\,\Delta K^m\).
- Parameters:
C (float or array_like) – Paris coefficient [m/cycle per (Pa sqrt(m))^m], nonnegative. Values quoted for MPa sqrt(m) must be multiplied by \(10^{-6m}\).
m (float or array_like) – Paris exponent [-], positive (about 3 for steels).
delta_K (float or array_like) – Stress intensity range [Pa sqrt(m)], nonnegative.
- Returns:
Growth per cycle [m/cycle].
- Return type:
float or ndarray
Notes
The stable (Region II) regime only: neither the threshold \(\Delta K_{th}\) nor the acceleration near \(K_{Ic}\) is modelled. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
P. Paris and F. Erdogan, “A critical analysis of crack propagation laws,” J. Basic Eng. 85 (1963) 528-533.
- engineeringkit.materials.peierls_stress(G, nu, b, a)[source]#
Peierls-Nabarro stress to move an edge dislocation through a perfect lattice.
\[\tau_P = \frac{2G}{1 - \nu}\exp\!\left(-\frac{2\pi a}{(1 - \nu)\,b}\right)\]- Parameters:
G (float or array_like) – Shear modulus [Pa], positive.
nu (float or array_like) – Poisson’s ratio [-], in (-1, 0.5).
b (float or array_like) – Burgers vector [m], positive.
a (float or array_like) – Slip-plane spacing [m], positive.
- Returns:
Lattice friction stress [Pa].
- Return type:
float or ndarray
Notes
The exponential makes the estimate a guide to trends (wide, close-packed planes slip easily) rather than an accurate value. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
R. Peierls, “The size of a dislocation,” Proc. Phys. Soc. 52 (1940) 34-37; F. R. N. Nabarro, “Dislocations in a simple cubic lattice,” Proc. Phys. Soc. 59 (1947) 256-272.
- engineeringkit.materials.peterson_notch_sensitivity(radius, alpha)[source]#
Peterson’s notch sensitivity \(q = 1/(1 + \alpha/r)\).
- Parameters:
radius (float or array_like) – Notch root radius \(r\) [m], positive.
alpha (float or array_like) – Material characteristic length [m], positive (about 0.25 mm for normalised steels, falling with strength).
- Returns:
Notch sensitivity [-], between 0 and 1.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
R. E. Peterson, “Notch-sensitivity,” in G. Sines and J. L. Waisman (eds.), Metal Fatigue (McGraw-Hill, New York, 1959), 293-306.
- engineeringkit.materials.principal_stresses(sx, sy, sz, txy=0.0, tyz=0.0, tzx=0.0)[source]#
Principal stresses of a three-dimensional stress state, largest first.
The eigenvalues of
\[\begin{split}\boldsymbol\sigma = \begin{pmatrix} \sigma_x & \tau_{xy} & \tau_{zx} \\ \tau_{xy} & \sigma_y & \tau_{yz} \\ \tau_{zx} & \tau_{yz} & \sigma_z \end{pmatrix}\end{split}\]- Parameters:
sx (float or array_like) – Normal stresses [Pa].
sy (float or array_like) – Normal stresses [Pa].
sz (float or array_like) – Normal stresses [Pa].
txy (float or array_like, optional) – Shear stresses [Pa].
tyz (float or array_like, optional) – Shear stresses [Pa].
tzx (float or array_like, optional) – Shear stresses [Pa].
- Returns:
\((\sigma_1, \sigma_2, \sigma_3)\) [Pa] along the last axis, \(\sigma_1 \ge \sigma_2 \ge \sigma_3\); pass them to
tresca_equivalent().- Return type:
ndarray
Notes
numpy.linalg.eigvalshfinds the eigenvalues of each symmetric tensor, the roots of \(\sigma^3 - I_1\sigma^2 + I_2\sigma - I_3 = 0\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.Examples
>>> principal_stresses(0.0, 0.0, 0.0, txy=50.0).round(9).tolist() [50.0, 0.0, -50.0]
- engineeringkit.materials.ramberg_osgood_strain(stress, E, yield_strength, n, offset=0.002)[source]#
Total strain on a Ramberg-Osgood stress-strain curve.
\[\varepsilon = \frac{\sigma}{E} + \varepsilon_o\left(\frac{\sigma}{\sigma_y}\right)^n\]- Parameters:
stress (float or array_like) – Stress [Pa]; the curve is odd, so compression mirrors tension.
E (float or array_like) – Young’s modulus [Pa], positive.
yield_strength (float or array_like) – Offset yield strength \(\sigma_y\) [Pa], positive.
n (float or array_like) – Hardening exponent [-], at least 1 (large
nis nearly elastic-perfectly plastic).offset (float or array_like) – Plastic strain \(\varepsilon_o\) at \(\sigma_y\) [-], positive; 0.002 is the 0.2% proof stress.
- Returns:
Strain [-], elastic plus plastic.
- Return type:
float or ndarray
Notes
Ramberg and Osgood wrote \(\varepsilon = \sigma/E + K(\sigma/E)^n\); the offset form is the same curve with \(K = \varepsilon_o (E/\sigma_y)^n\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
W. Ramberg and W. R. Osgood, “Description of stress-strain curves by three parameters,” NACA Technical Note 902 (1943).
Examples
>>> round(float(ramberg_osgood_strain(400e6, 200e9, 400e6, 10)), 6) 0.004
- engineeringkit.materials.resilience_modulus(sigma_y, E)[source]#
Elastic strain energy per volume at yield, \(U_r = \sigma_y^2 / 2E\).
- Parameters:
sigma_y (float or array_like) – Yield strength [Pa], positive.
E (float or array_like) – Young’s modulus [Pa], positive.
- Returns:
Modulus of resilience [J/m^3].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.rule_of_mixtures_E_longitudinal(Ef, Em, Vf)[source]#
Voigt (equal-strain) modulus \(E_1 = V_f E_f + (1 - V_f) E_m\).
- Parameters:
Ef (float or array_like) – Fibre modulus [Pa], positive.
Em (float or array_like) – Matrix modulus [Pa], positive.
Vf (float or array_like) – Fibre volume fraction [-], in [0, 1].
- Returns:
Modulus along continuous aligned fibres [Pa], the upper bound.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
W. Voigt, “Ueber die Beziehung zwischen den beiden Elasticitätsconstanten isotroper Körper,” Ann. Phys. 274 (1889) 573-587.
- engineeringkit.materials.rule_of_mixtures_E_transverse(Ef, Em, Vf)[source]#
Reuss (equal-stress) modulus \(1/E_2 = V_f/E_f + (1 - V_f)/E_m\).
- Parameters:
Ef (float or array_like) – Fibre modulus [Pa], positive.
Em (float or array_like) – Matrix modulus [Pa], positive.
Vf (float or array_like) – Fibre volume fraction [-], in [0, 1].
- Returns:
Modulus across the fibres [Pa], the lower bound.
- Return type:
float or ndarray
Notes
Real transverse moduli lie above the Reuss value because the matrix between neighbouring fibres is not uniformly stressed. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
A. Reuss, “Berechnung der Fließgrenze von Mischkristallen auf Grund der Plastizitätsbedingung für Einkristalle,” Z. Angew. Math. Mech. 9 (1929) 49-58.
- engineeringkit.materials.semi_infinite_concentration(x, t, D, C0, Cs)[source]#
Fick’s second law in a semi-infinite solid with a fixed surface concentration.
\[\frac{C(x, t) - C_0}{C_s - C_0} = 1 - \operatorname{erf}\frac{x}{2\sqrt{Dt}}\]- Parameters:
x (float or array_like) – Depth below the surface [m], nonnegative.
t (float or array_like) – Time [s], positive.
D (float or array_like) – Diffusion coefficient [m^2/s], positive, independent of concentration.
C0 (float or array_like) – Initial uniform concentration [any unit].
Cs (float or array_like) – Surface concentration held from
t = 0[same unit].
- Returns:
Concentration at depth
x[same unit asC0].- Return type:
float or ndarray
Notes
The solid must be thicker than a few \(\sqrt{Dt}\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(semi_infinite_concentration(0.0, 1.0, 1e-11, 0.2, 1.0)), 6) 1.0
- engineeringkit.materials.shear_modulus(E, nu)[source]#
Isotropic shear modulus \(G = E / (2(1 + \nu))\).
- Parameters:
E (float or array_like) – Young’s modulus [Pa], positive.
nu (float or array_like) – Poisson’s ratio [-], in (-1, 0.5).
- Returns:
Shear modulus [Pa].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.soderberg_safety_factor(sa, sm, Se, Sy)[source]#
Safety factor on Soderberg’s line, \(1/n = \sigma_a/S_e + \sigma_m/S_y\).
- Parameters:
sa (float or array_like) – Alternating stress amplitude [Pa], nonnegative.
sm (float or array_like) – Mean stress [Pa], nonnegative (tensile).
Se (float or array_like) – Endurance limit [Pa], positive.
Sy (float or array_like) – Yield strength [Pa], positive.
- Returns:
Safety factor [-]; the line to the yield strength also guards against first-cycle yielding, and is the most conservative of the three.
- Return type:
float or ndarray
- Raises:
ValueError – If both stresses are zero.
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
C. R. Soderberg, “Factor of safety and working stress,” Trans. ASME 52 (1930) APM-52-2, 13-28.
Examples
>>> float(soderberg_safety_factor(50e6, 150e6, 200e6, 300e6)) 1.3333333333333333
- engineeringkit.materials.strain_life_amplitude(cycles, E, sigma_f, b, epsilon_f, c)[source]#
Total strain amplitude of the Basquin-Coffin-Manson strain-life curve.
\[\frac{\Delta\varepsilon}{2} = \frac{\sigma_f'}{E}(2N)^b + \varepsilon_f'(2N)^c\]- Parameters:
cycles (float or array_like) – Cycles to failure \(N\), positive.
E (float or array_like) – Young’s modulus [Pa], positive.
sigma_f (float or array_like) – Fatigue strength coefficient [Pa], positive.
b (float or array_like) – Fatigue strength exponent [-], negative.
epsilon_f (float or array_like) – Fatigue ductility coefficient [-], positive.
c (float or array_like) – Fatigue ductility exponent [-], negative.
- Returns:
(total, elastic, plastic)strain amplitudes [-].- Return type:
tuple of float or ndarray
Notes
The elastic and plastic lines cross at the transition life \(2N_t = (\varepsilon_f' E/\sigma_f')^{1/(b - c)}\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.stress_intensity(K_geometry, sigma, a)[source]#
Mode-I stress intensity factor \(K_I = Y\sigma\sqrt{\pi a}\).
- Parameters:
K_geometry (float or array_like) – Geometry factor \(Y\) [-], positive (1 for a central crack in an infinite plate, about 1.12 for an edge crack).
sigma (float or array_like) – Remote tensile stress [Pa], nonnegative.
a (float or array_like) – Crack length (edge) or half-length (central) [m], positive.
- Returns:
Stress intensity [Pa sqrt(m)].
- Return type:
float or ndarray
Notes
Linear-elastic fracture mechanics, valid while the plastic zone is small compared with the crack. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
G. R. Irwin, “Analysis of stresses and strains near the end of a crack traversing a plate,” J. Appl. Mech. 24 (1957) 361-364.
- engineeringkit.materials.theoretical_density(atoms_per_cell, molar_mass, cell_volume)[source]#
Density of a perfect crystal from its unit cell, \(\rho = nA/(V_c N_A)\).
- Parameters:
atoms_per_cell (float or array_like) – Atoms per unit cell \(n\) [-], positive (1, 2, 4 or 6).
molar_mass (float or array_like) – Molar mass \(A\) [kg/mol], positive.
cell_volume (float or array_like) – Unit cell volume \(V_c\) [m^3], positive (\(a^3\) for a cubic cell).
- Returns:
Density [kg/m^3].
- Return type:
float or ndarray
Notes
Vacancies and other defects make the measured density slightly lower. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> a = cubic_lattice_parameter(0.128e-9, "fcc") >>> round(float(theoretical_density(4, 63.5e-3, a**3))) 8888
- engineeringkit.materials.thermal_strain(alpha, dT)[source]#
Free thermal strain \(\varepsilon_T = \alpha\,\Delta T\).
- Parameters:
alpha (float or array_like) – Linear expansion coefficient [1/K].
dT (float or array_like) – Temperature change [K].
- Returns:
Strain [-].
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.toughness(strain, stress)[source]#
Area under a stress-strain curve, \(\int \sigma\,d\varepsilon\).
- Parameters:
strain (array_like) – Strictly increasing strains [-], at least two.
stress (array_like) – Matching stresses [Pa].
- Returns:
Energy absorbed per unit volume [J/m^3], by the trapezoid rule.
- Return type:
float
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.transformed_stiffness(Q, theta)[source]#
Ply stiffness \(\bar{\mathbf Q}\) in laminate axes, for fibres at angle \(\theta\) to x.
\[\bar{\mathbf Q} = \mathbf T^{-1}\mathbf Q\,\mathbf R\,\mathbf T\,\mathbf R^{-1}\]with \(\mathbf T\) the stress transformation and \(\mathbf R\) the Reuter matrix that converts engineering to tensor shear strain.
- Parameters:
Q (array_like) – \(3 \times 3\) reduced stiffness [Pa], from
lamina_stiffness().theta (float) – Fibre angle from the laminate x axis [rad], counterclockwise.
- Returns:
\(3 \times 3\) matrix [Pa] relating \((\sigma_x, \sigma_y, \tau_{xy})\) to \((\varepsilon_x, \varepsilon_y, \gamma_{xy})\).
- Return type:
ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.tresca_equivalent(principal)[source]#
Tresca equivalent stress, the largest minus the smallest principal stress.
- Parameters:
principal (array_like) – Principal stresses [Pa] along the last axis, in any order. Include the zero out-of-plane stress for plane stress.
- Returns:
\(\sigma_{max} - \sigma_{min} = 2\tau_{max}\) [Pa], one value per stress state.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
H. Tresca, “Mémoire sur l’écoulement des corps solides soumis à de fortes pressions,” C. R. Acad. Sci. Paris 59 (1864) 754-758.
Examples
>>> float(tresca_equivalent([100.0, 0.0, -50.0])) 150.0
- engineeringkit.materials.vickers_hardness(load, diagonal)[source]#
Vickers hardness number, \(\mathrm{HV} = 2P\sin(68^\circ)/d^2 \approx 1.8544\,P/d^2\).
- Parameters:
load (float or array_like) – Test load [N], positive.
diagonal (float or array_like) – Mean diagonal of the square indentation \(d\) [m], positive.
- Returns:
HV [kgf/mm^2, conventionally written without units].
- Return type:
float or ndarray
Notes
The 136° pyramid makes geometrically similar dents at every load. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(vickers_hardness(10 * 9.80665, 0.3e-3)), 1) 206.0
- engineeringkit.materials.von_mises_plane_stress(sx, sy, txy)[source]#
Von Mises equivalent stress for plane stress.
\[\sigma_{vM} = \sqrt{\sigma_x^2 - \sigma_x\sigma_y + \sigma_y^2 + 3\tau_{xy}^2}\]- Parameters:
sx (float or array_like) – Normal stresses [Pa].
sy (float or array_like) – Normal stresses [Pa].
txy (float or array_like) – In-plane shear stress [Pa].
- Returns:
Equivalent stress [Pa]; yield is predicted when it reaches the uniaxial yield strength.
- Return type:
float or ndarray
Notes
Assumes an isotropic, pressure-insensitive ductile metal with \(\sigma_z = \tau_{xz} = \tau_{yz} = 0\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
References
R. von Mises, “Mechanik der festen Körper im plastisch-deformablen Zustand,” Nachr. Ges. Wiss. Göttingen, Math.-Phys. Kl. (1913) 582-592.
Examples
>>> round(float(von_mises_plane_stress(0.0, 0.0, 1.0)), 6) 1.732051
- engineeringkit.materials.von_mises_stress(sx, sy, sz, txy=0.0, tyz=0.0, tzx=0.0)[source]#
Von Mises equivalent stress of a three-dimensional stress state.
\[\sigma_{vM} = \sqrt{\tfrac12\left[(\sigma_x - \sigma_y)^2 + (\sigma_y - \sigma_z)^2 + (\sigma_z - \sigma_x)^2\right] + 3(\tau_{xy}^2 + \tau_{yz}^2 + \tau_{zx}^2)} = \sqrt{3J_2}\]- Parameters:
sx (float or array_like) – Normal stresses [Pa].
sy (float or array_like) – Normal stresses [Pa].
sz (float or array_like) – Normal stresses [Pa].
txy (float or array_like, optional) – Shear stresses [Pa].
tyz (float or array_like, optional) – Shear stresses [Pa].
tzx (float or array_like, optional) – Shear stresses [Pa].
- Returns:
Equivalent stress [Pa], unchanged by a hydrostatic stress.
- Return type:
float or ndarray
Notes
With \(\sigma_z = \tau_{yz} = \tau_{zx} = 0\) it reduces to
von_mises_plane_stress(). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.Examples
>>> float(von_mises_stress(100.0, 100.0, 100.0)) 0.0
- engineeringkit.materials.weibull_failure_probability(stress, sigma_0, m, volume=1.0, reference_volume=1.0)[source]#
Probability that a uniformly stressed brittle part fails.
\[P_f = 1 - \exp\left[-\frac{V}{V_0}\left(\frac{\sigma}{\sigma_0}\right)^m\right]\]- Parameters:
stress (float or array_like) – Uniform tensile stress [Pa], nonnegative.
sigma_0 (float or array_like) – Characteristic strength of the reference volume (63.2% fail) [Pa], positive.
m (float or array_like) – Weibull modulus [-], positive (5 to 20 for ceramics, above 30 for metals).
volume (float or array_like, optional) – Stressed volume \(V\) [m^3], positive.
reference_volume (float or array_like, optional) – Volume \(V_0\) at which
sigma_0was measured [m^3], positive.
- Returns:
Failure probability [-].
- Return type:
float or ndarray
Notes
Evaluated as
engineeringkit.reliability.weibull_cdf()with scale \(\sigma_0(V_0/V)^{1/m}\). Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.References
W. Weibull, “A statistical theory of the strength of materials,” Ingeniörsvetenskapsakademiens Handlingar 151 (Stockholm, 1939).
Examples
>>> round(float(weibull_failure_probability(300e6, 300e6, 10)), 4) 0.6321
- engineeringkit.materials.weibull_mean_strength(sigma_0, m, volume=1.0, reference_volume=1.0)[source]#
Mean strength \(\sigma_0(V_0/V)^{1/m}\,\Gamma(1 + 1/m)\).
- Parameters:
sigma_0 (float or array_like) – Characteristic strength of the reference volume [Pa], positive.
m (float or array_like) – Weibull modulus [-], positive.
volume (float or array_like, optional) – As in
weibull_failure_probability()[m^3], positive.reference_volume (float or array_like, optional) – As in
weibull_failure_probability()[m^3], positive.
- Returns:
Mean strength [Pa], from
engineeringkit.reliability.weibull_mttf().- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
- engineeringkit.materials.weibull_size_effect(strength, volume, new_volume, m)[source]#
Strength of a different volume at the same failure probability.
\[\sigma_2 = \sigma_1\left(\frac{V_1}{V_2}\right)^{1/m}\]- Parameters:
strength (float or array_like) – Strength measured on volume
volume[Pa], positive.volume (float or array_like) – Volume of the test pieces [m^3], positive.
new_volume (float or array_like) – Volume of the part [m^3], positive.
m (float or array_like) – Weibull modulus [-], positive.
- Returns:
Strength of the part [Pa]; lower when it is bigger.
- Return type:
float or ndarray
Notes
Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> round(float(weibull_size_effect(400e6, 1e-6, 1e-3, 10)) / 1e6, 1) 200.5
Utilities#
Supporting numerics for engineeringkit.materials’s systems/ modules.
- engineeringkit.materials.utils.power_law_fit(x, y)[source]#
Least-squares fit of \(y = A\,x^p\) on log-log axes.
- Parameters:
x (array_like) – Matching vectors of at least two positive samples, with at least two distinct
x.y (array_like) – Matching vectors of at least two positive samples, with at least two distinct
x.
- Returns:
(A, p), the coefficient (in the units ofyover those of \(x^p\)) and the exponent.- Return type:
tuple of float
Notes
The fit minimises the error in \(\log y\), so every decade of data carries the same weight. Inputs are raw SI numbers with no dimensional metadata; see Materials: structure, elasticity, yield, fatigue, fracture and creep conventions.
Examples
>>> A, p = power_law_fit([1.0, 10.0, 100.0], [3.0, 30.0, 300.0]) >>> round(A, 9), round(p, 9) (3.0, 1.0)
Visualizers#
Matplotlib visualizers for engineeringkit.materials.
- engineeringkit.materials.visualizers.plot_crack_growth(cycles, crack_length, ax=None, label=None)[source]#
Plot crack length in mm against cycles.
- Parameters:
cycles (array_like) – Cycles.
crack_length (array_like) – Matching crack lengths [m].
ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.
label (str, optional) – Legend label.
- Return type:
matplotlib.axes.Axes
- engineeringkit.materials.visualizers.plot_sn_curve(cycles, stress_amplitude, ax=None, label=None, style='-')[source]#
Log-log plot of stress amplitude in MPa against cycles to failure.
- Parameters:
cycles (array_like) – Cycles to failure, positive.
stress_amplitude (array_like) – Matching stress amplitudes [Pa], positive.
ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.
label (str, optional) – Legend label.
style (str) – Matplotlib format string, e.g.
"o"for test points.
- Return type:
matplotlib.axes.Axes
- engineeringkit.materials.visualizers.plot_stress_strain(strain, stress, ax=None, label=None)[source]#
Plot stress in MPa against strain.
- Parameters:
strain (array_like) – Strains [-].
stress (array_like) – Matching stresses [Pa].
ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.
label (str, optional) – Legend label.
- Return type:
matplotlib.axes.Axes
- engineeringkit.materials.visualizers.plot_yield_surfaces(yield_strength, ax=None)[source]#
Draw the Tresca hexagon and the von Mises ellipse in the plane-stress principal plane.
- Parameters:
yield_strength (float) – Uniaxial yield strength [Pa], positive; the axes are scaled by it.
ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.
- Return type:
matplotlib.axes.Axes