FINAL INDEPENDENT PROJECT
- 1) Aim
- To make a suitable curve fit for engineering stress-strain curve for SS 316l
- 2) Objective
- a) To select a suitable order of fit
- b) Split the engineering stress-strain data into equal sets and fit a curve by the split wise method
- c) Create offset point on an engineering stress-strain diagram
- d) Select an approximate yield stress value and youngs modulus of elasticity from by finding the slope of the linear region (approx)
- e) Check the quality of fit by R square value
- f) Use curve fit tool box to check whether the code for fit is right
- 3) Theory and formulas used:
- a ) Engineering stress Vs Engineering strain
- The engineering tension test is widely used to provide basic design information on the strength of materials and as an acceptance test for the specification of materials. In the tension test a specimen is subjected to a continually increasing uniaxial tensile force while simultaneous observations are made of the elongation of the specimen. The shape and magnitude of the stress-strain curve of metal will depend on its composition, heat treatment, prior history of plastic deformation, and the strain rate, temperature, and state of stress imposed during the testing. The parameters, which are used to describe the stress-strain curve of a metal, are the tensile strength, yield strength or yield point, percent elongation, and reduction of area. The first two are strength parameters; the last two indicate ductility
- An engineering stress-strain diagram for a typical alloy is represented below:
- The elastic modulus, E (Young’s modulus) is the slope of the elastic portion of the curve (the steep, linear region) because E is the proportionality constant relating stress and strain during elastic deformation: σ = Eε.
- The 0.2% offset yield strength is the stress value, σ0.2%YS of the intersection of a line (called the offset) constructed parallel to the elastic portion of the curve but offset to the right by a strain of 0.002. It represents the onset of plastic deformation.
- The ultimate tensile strength is the engineering stress value or σuts, at the maximum of the engineering stress-strain curve. It represents the maximum load, for that original area, that the sample can sustain without undergoing the instability of necking, which will lead to fracture.
- b) The tensile test provides load elongation data. On SS316L e tensile tests were carried out at an average room temperature of 25-degree Celsius on Tinius Olsen H25KT (capacity =25KN)
with cross head speed of 1mm/min.The load extension plots are recorded with the help of QMAT Professional software. The tensile specimens are show below: - Engineering stress-strain values are determined from load elongation data as below:
- F= Load applied
- E= Elongation in mm
- Final elongation = initial length +E
- Engineering strain =elongation/ Final length
- Engineering stress = Load applied/original area
- b) Curve fit
-
For a given real data series that constitutes a function, making a graph for the same which is at the closest proximity to real data is called as curve fit process. In simple words a curve fit is the process of adjusting a mathematical function so that it lies as close to a set of given real data points.For any real data set curve fit helps to determine the relationship between the data set and parameter values.
Say there are n data point given: ( x1,y1),(x2,y2)...(xn,yn).The data points can be used to create a polynomial of degree 'n-1' such that it passses through the n points.
The curve fit helps to determine the unknown coefficients in a polynomial.
-
Inbuilt functions in MATLAB
-
Polyfit- Say there are two vectors x and y. The command a=polyfit(x,y,n) helps in initiating a polynomial fit through given set of 'n' data points ( x1,y1),(x2,y2)...(xn,yn) with (n+1) number of coefficients that are powers of x in form of a vector. For ex for n=5 the coefficients are evaluated.
- Polyval- Say there is a vector data set x with coefficients in form of a row vector.The command y=polyval(a,x) evaluates the different values of polynomial at x1,x2..xn and estimates values of y1,y2..yn
- The value of function with the determined coeffiecients are found out
-
Errors and Goodness in fits
Statistical methods can be used to esitmate error in a fit and its goodness.
Error at an ith point , error(i)= | y(i)-value y=f(x) @x=xi|
error(i)=| y(i)-f(xi)|
The statistical method makes use of 4 measurable parameters to determine how good a fit is. These are:
- Sum of squares due to error
- R-Square
- Adjusted R-square
- Root mean square error
Here the method used is R square method and following terms are evaluated to determine the goodness of fit:
a) Error =| y(i)-f(xi)|SSE=∑i=1n(Error(i))2">
ssr=∑i=1n(f(x(i))-Mean)2">b) ssr=n∑i=1(f(x(i))−Mean)2ssr=∑i=1n(f(x(i))-Mean)2
SSE=∑i=1n(Error(i))2">sse=∑i=1n(Y(i)-f(x(i)))2">c) sse=n∑i=1(Y(i)−f(x(i)))2sse=∑i=1n(Y(i)-f(x(i)))2
SSE=∑i=1n(Error(i))2">d) sst=ssr+sse
SSE=∑i=1n(Error(i))2">e) R^2=SSR/SST
-
If R^2 value is greater than 0.95 it is found to be a good fit
- 4) Methodology, Results and Inference :
- The code is written from n=2 till a value of n for which the value of R^sqaure is greater than or equal to 0.95 for a good fit.
- A user defined function is made which evaluates the goodness of fit
-
function [F] = fitness_charctics(ss_ess,pred_ss_ess) mean_ss_ess=mean(ss_ess); ssr=0; sse=0; for i=1:length(ss_ess) sse=sse+(ss_ess(i)-pred_ss_ess(i)).^2; end for i=1:length(ss_ess) ssr=ssr+(mean(ss_ess)-pred_ss_ess(i)).^2; end sst=sse+ssr R_sq=ssr/sst rmse=(sse/length(ss_ess))^0.5 if(R_sq>0.95) disp('Good fit with R_sq > 0.95') else disp('Not Good fit as R_sq <= 0.95') end end
% intially the data is read from the xls file ss_data=xlsread('ss'); [A B C]=xlsread('ss'); % the first column is stored as elongation o ss_E=A(:,1); % the second column values represent the load applied ss_F=A(:,2); L_F=82; ss_area=7.5; % strain developed ss_es=ss_E./L_F; % engineering stress ss_ess=ss_F./ss_area; % curve fit for n=2 is found and the process is repeated till a suitable % fit is found where r^sq value is greater than 0.95 coeff=polyfit(ss_es,ss_ess,2); pred_ss_ess=polyval(coeff,ss_es); figure(1) axis([0 1 0 800]) plot(ss_es,ss_ess,'linewidth',2,'color','b') hold on plot(ss_es,pred_ss_ess,'linewidth',2,'color','r') xlabel('Engineering strain') ylabel('Engineering stress in Mpa') title('Engineering stress Vs Engineering strain') hold off disp('for the curve fit:') fitness_charctics(ss_ess,pred_ss_ess) coeff=polyfit(ss_es,ss_ess,3); pred_ss_ess=polyval(coeff,ss_es); figure(2) axis([0 1 0 800]) plot(ss_es,ss_ess,'linewidth',2,'color','b') hold on plot(ss_es,pred_ss_ess,'linewidth',2,'color','r') xlabel('Engineering strain') ylabel('Engineering stress in Mpa') title('Engineering stress Vs Engineering strain') hold off disp('for the curve fit:') fitness_charctics(ss_ess,pred_ss_ess) coeff=polyfit(ss_es,ss_ess,4); pred_ss_ess=polyval(coeff,ss_es); figure(3) axis([0 1 0 800]) plot(ss_es,ss_ess,'linewidth',2,'color','b') hold on plot(ss_es,pred_ss_ess,'linewidth',2,'color','r') xlabel('Engineering strain') ylabel('Engineering stress in Mpa') title('Engineering stress Vs Engineering strain') hold off disp('for the curve fit:') fitness_charctics(ss_ess,pred_ss_ess) coeff=polyfit(ss_es,ss_ess,5); pred_ss_ess=polyval(coeff,ss_es); figure(4) axis([0 1 0 800]) plot(ss_es,ss_ess,'linewidth',2,'color','b') hold on plot(ss_es,pred_ss_ess,'linewidth',2,'color','r') xlabel('Engineering strain') ylabel('Engineering stress in Mpa') title('Engineering stress Vs Engineering strain') hold off disp('for the curve fit:') fitness_charctics(ss_ess,pred_ss_ess)- The output graph is represented below:
- The output window indicating which value of n gives a R^sq value greater than 0.95 is shown below:
- For a value of N= 5 the curve fit is coming properly. The curve fit tool box is used to find a suitable fit and R^square value. The same was checked with code in matlab which too is demonstrated below with the same user defined function.
-
clear all close all clc ss_data=xlsread('ss'); [A B C]=xlsread('ss'); ss_E=A(:,1); ss_F=A(:,2); L_F=82; ss_area=7.5; ss_es=ss_E./L_F; ss_ess=ss_F./ss_area; %splitting data into four parts ss_es_1=ss_es(1:188); ss_es_2=ss_es(189:376); ss_es_3=ss_es(377:564); ss_es_4=ss_es(565:752); ss_ess_1=ss_ess(1:188); ss_ess_2=ss_ess(189:376); ss_ess_3=ss_ess(377:564); ss_ess_4=ss_ess(565:752); coeff1=polyfit(ss_es_1,ss_ess_1,5); pred_ss_ess1=polyval(coeff1,ss_es_1); coeff2=polyfit(ss_es_2,ss_ess_2,5); pred_ss_ess2=polyval(coeff2,ss_es_2); coeff3=polyfit(ss_es_3,ss_ess_3,5); pred_ss_ess3=polyval(coeff3,ss_es_3); coeff4=polyfit(ss_es_4,ss_ess_4,5); pred_ss_ess4=polyval(coeff4,ss_es_4); figure(1) axis([0 1 0 800]) plot(ss_es,ss_ess,'linewidth',2,'color','b') hold on plot(ss_es_1,pred_ss_ess1,'linewidth',2,'color','r') plot(ss_es_2,pred_ss_ess2,'linewidth',2,'color','r') plot(ss_es_3,pred_ss_ess3,'linewidth',2,'color','r') plot(ss_es_4,pred_ss_ess4,'linewidth',2,'color','r') xlabel('Engineering strain') ylabel('Engineering stress in Mpa') title('Engineering stress Vs Engineering strain -curve fit with n=5') legend('Original data set','curve fit') hold off disp('for the curve fit:') pred_ss_ess(1:188)=pred_ss_ess1 pred_ss_ess(189:376)=pred_ss_ess2 pred_ss_ess(377:564)=pred_ss_ess3 pred_ss_ess(565:752)=pred_ss_ess4 disp('for the curve fit:') fitness_charctics(ss_ess,pred_ss_ess) - plot of above code in matlab:
- Determination of yield strength and youngs modulus of elasticity:
- The yield strength of a material corresponding to a yield point is obtained by the offset method. A Point is made on a plot that corresponds to a definite or stated amount of permanent set, usually 0.2 percent of the original gauge length. In many ductile materials the onset of yield is not always characterized by a horizontal portion of the eng stress-strain curve. The yield strength at 0.2% offset, for example, is obtained by drawing through the point of the horizontal axis of abscissa E = 0.2% , a line parallel to the initial straight-line portion of the stress-strain diagram. The stress Sy corresponding to the point Y obtained in this fashion is defined as the yield strength at 0.2% offset.The point is made on the plot with a command
-
plot(0.002,0,'d','MarkerFaceColor','b') - In the code above for curve fit. The graph obtained by doing so is
- The line from offset point (0.02,0) touches the curve approx at 430 Mpa which is verified with the curve from reference as below as test is done at room temperature of 25 deg cross-checked with reference(https://askzn.co.za/stainless-steel/tech-grade-316.htm)
- It is always better to split the data set into equal portions to determine a better fit.
- The cursor data can be exported to Matlab and E can be found by finding the slope of the line.
- E=256 Mpa verified withh data below from a manufacturer spec sheet
- The R sq value of fit obtained via coding was found to agree with the one obtained from using the curve fit toolbox
- 4) References
- https://core.ac.uk/download/pdf/33381965.pdf
- https://www.sciencedirect.com/science/article/pii/S0741521408000074
- https://blog.minitab.com/en/adventures-in-statistics-2/regression-analysis-how-do-i-interpret-r-squared-and-assess-the-goodness-ofit#:~:text=R-squared is a statistical,multiple determination for multiple regression.&text=100% indicates that the model,response data around its mean.
- https://download.autodesk.com/us/algor/userguides/mergedprojects/setting_up_the_analysis/nonlinear/materials/curve_fitting.htm
drive links
deformation data
https://docs.google.com/spreadsheets/d/10RHJu1PLQQup9XLFFHSpH7z_M1VpW08Dth0dDUrNP9E/edit?usp=sharing
.m file for checking which fit is better
https://drive.google.com/file/d/1hqtJxb7GXAuGhbin7F5cZeFJsavKw9CJ/view?usp=sharing
user-defined curve to check the goodness of fit
https://drive.google.com/file/d/1gFhcOXuFROWUmsoHDRi0HjMMHcSna1m4/view?usp=sharing
https://drive.google.com/file/d/13z1pofCzX1NuBYK3h1Bo2iSAT15c_4vQ/view?usp=sharing