Question C.2.3: Use MATLAB to fit a straight line to the beam force-deflecti......

Use MATLAB to fit a straight line to the beam force-deflection data given in Example C.2.2, but constrain the line to pass through the origin.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

We can apply (C.1.3), noting here that the measured variable is the deflection x and the independent variable is the force f . Thus (C.1.3) becomes

m \sum\limits_{i=1}^n x_i^2=\sum\limits_{i=1}^n x_i y_i          (C.1.3)

m \sum\limits_{i=1}^n f_i^2=\sum\limits_{i=1}^n f_i x_i            (1)

The 'Blue Check Mark' means that either the MATLAB code/script/answer provided in the answer section has been tested by our team of experts; or the answer in general has be fact checked.

Learn more on how do we answer questions.

Script File

The MATLAB program to solve this equation for m and k is

% Enter the data
x = [0, 0.15, 0.23, 0.35, 0.37, 0.5, 0.57, 0.68, 0.77];
f = (0:100:800);
% Compute m from (1).
m = sum(f.*x)/sum(f.^2);
% Compute the stiffness.
k = 1/m
% Compute J, S, and r squared.
J = sum((m*f-x).^2)
S = sum((x-mean(x)).^2)
r2 = 1 - J/S

The answer is k = 1021 lb/in. The corresponding line is shown in Figure C.2.3. The quality-of-fit values are J = 0.0081, S = 0.5090, and r² = 0.9840, which indicates a good fit.

12

Related Answered Questions

Question: C.2.6

Verified Answer:

First obtain the flow rate data in ml/s by dividin...
Question: C.2.2

Verified Answer:

Note that here X is the dependent variable and f i...
Question: C.1.3

Verified Answer:

The least-squares criterion is J=\sum\limit...
Question: C.1.1

Verified Answer:

These data do not lie close to a straight line whe...
Question: C.1.2

Verified Answer:

Subtracting 10 from all the x values and 11 from a...