This project provides a Python-based solution for extrapolating compressive stress-strain data to ideal frictionless conditions (m=0) using linear regression over multiple specimen geometries. The method corrects for friction effects in mechanical testing by analyzing data from specimens with different diameter-to-height ratios.
- Data Cleaning: Removes duplicate strain values and averages corresponding stresses
- Common Range Identification: Finds overlapping strain ranges across multiple datasets
- Cubic Spline Interpolation: Creates smooth stress-strain curves for consistent comparison
- Linear Extrapolation: Extrapolates stress to m=0 condition at each strain point
- Quality Assessment: Calculates R² values to evaluate extrapolation reliability
- Visualization: Generates comprehensive plots of results and analysis
- Data Export: Saves corrected frictionless curve to CSV format
The method assumes linear relationship between stress (σ) and diameter-to-height ratio (m = d/h) at constant strain:
σ(ε, m) = A(ε)·m + σ₀(ε)
Where:
- σ(ε, m) = measured stress at strain ε and geometry m
- A(ε) = slope representing friction sensitivity
- σ₀(ε) = extrapolated stress at m=0 (frictionless condition)
By measuring specimens with different m values and extrapolating to m=0, we obtain the ideal frictionless stress-strain curve.
pip install numpy pandas matplotlib scipyCreate CSV files containing experimental stress-strain data:
data_m1.csv: Data for m = 0.504032 (Al20)data_m2.csv: Data for m = 0.678161 (Al15)data_m3.csv: Data for m = 0.988142 (Al10)
Each CSV should have two columns: Strain and Stress (MPa)
python interpolation.py- friction_corrected_curve.csv: Contains the extrapolated frictionless curve
- Visual plots: Four-panel visualization of results
- Removes duplicate strain values by averaging corresponding stresses
- Returns sorted, cleaned data
- Performs cubic spline interpolation to common strain points
- Identifies overlapping strain range across all datasets
- Main extrapolation function
- Returns extrapolated stress at m=0 and statistical details
- Generates comprehensive visualization:
- Original and extrapolated curves
- Linear extrapolation at sample strains
- Slope variation with strain
- R² quality metrics
- Exports results to CSV format
- Strain: Common strain points
- Stress_m0_MPa: Extrapolated stress at m=0
- Slope_dSigma_dm: Sensitivity of stress to geometry
- R_squared: Quality of linear fit at each strain
- Top-left: Original stress-strain curves and extrapolated m=0 curve
- Top-right: Linear extrapolation at selected strain values
- Bottom-left: Variation of slope (dσ/dm) with strain
- Bottom-right: R² values indicating extrapolation quality

Extrapolation Statistical Summary:
==================================================
Mean R²: 0.9743
Min R²: 0.9214 at strain 0.127
Max R²: 0.9987 at strain 0.358
Mean slope: 145.67 MPa
Output strain range: 0.070 to 0.470
- High R² (>0.95): Reliable extrapolation, linear assumption valid
- Low R² (<0.90): Potential issues with data or linear assumption
- Slope magnitude: Indicates friction sensitivity
- Corrected curve: Represents ideal frictionless material response
- Material property characterization
- Friction effect quantification in compression testing
- Comparative analysis of lubricant effectiveness
- Finite element model calibration
- Quality control in mechanical testing
- Linear relationship between stress and m (valid for small m variations)
- Similar deformation mechanisms across different geometries
- Consistent testing conditions and material homogeneity
- Adequate number of geometry variations (minimum 3 recommended)
- Non-linear extrapolation models
- Uncertainty quantification
- Batch processing for multiple materials
- Integration with FEM software
- Real-time monitoring during testing
This tool was developed for academic research in mechanical property characterization and friction correction in materials testing.