Skip to main content

Crate use_material_elasticity

Crate use_material_elasticity 

Source
Expand description

Primitive elasticity helpers.

Initial calculations assume SI units unless otherwise documented.

§Examples

use use_material_elasticity::{
    ElasticModulus, elastic_deformation, strain_from_modulus, stress_from_modulus,
    youngs_modulus,
};

let modulus = ElasticModulus::new(200_000_000_000.0).unwrap();

assert_eq!(modulus.gigapascals(), 200.0);
assert_eq!(youngs_modulus(400_000_000.0, 0.002).unwrap(), 200_000_000_000.0);
assert_eq!(stress_from_modulus(200_000_000_000.0, 0.002).unwrap(), 400_000_000.0);
assert_eq!(strain_from_modulus(400_000_000.0, 200_000_000_000.0).unwrap(), 0.002);
assert_eq!(elastic_deformation(1_000.0, 2.0, 0.01, 200_000_000_000.0).unwrap(), 0.000_001);

Structs§

ElasticModulus

Enums§

ElasticityError

Functions§

elastic_deformation
Computes axial elastic deformation.
strain_from_modulus
Computes strain from stress and modulus.
stress_from_modulus
Computes stress from modulus and strain.
youngs_modulus
Computes Young’s modulus from stress and strain.