use matlab thanks The following table includes experimental data for a stress st
ID: 3782106 • Letter: U
Question
use matlab thanks
The following table includes experimental data for a stress strain test of a granular material: a. Use the saturation-growth-rate model to fit the data using linear regression to represent stress as function of strain. Find the coefficient of determination for this fit in the transformed space and in the original space. b. Fit the data to a fourth order polynomial. Note that the model should ensure zero stress at zero stress. Write down the resulting polynomial. Find the coefficient of determination for this fit. c. Fit die data to the following nonlinear function: y = a_0 x^a_1 e^a-2 x. Use nonlinear regression to define the function Find the coefficient of determination for this fit. d. Plot the original data along with the three fits from parts (a) through (c). Comment on the results.Explanation / Answer
1)
load xyz.dat % load the data file.
stress = xyz(:,1) * 9.81;
strain = xyz(:,2) * 2.54 / 100;
x = stresss;
y = strainn;
xmodel = linspace(min(x), max(x), 100);
%% Determine the polynomial coefficients
N = 1;
P = polyfit(x, y, N)
%% Generate estimates and model
yhat = polyval(P, x);
ymodel = polyval(P, xmodel);
%% Calculate statistics
St = sum(( y - mean(y) ).^2)
Sr = sum(( y - yhat ).^2)
r2 = (St - Sr) / St
%% Generate plots
plot(x, y, 'ko',...
x, yhat, 'ks',...
xmodel, ymodel, 'k-');
xlabel('Stress Value')
ylabel('Strain Value')
---------------
2)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.