Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

05_curve_fitting

Question 2

function [a,fx,r2]=least_squares(Z,y)
% least squares solution for input matrix Z and measurements y
% outputs are:
% a: constants for best-fit function
% fx: function evaluations at xi
% r2: coefficient of determination

a = Z \ y;
fx = Z * a;
e = y - fx;
Sr = std(e);
St = std(y);
r2 = 1 - Sr/St;
end

Coefficient of Determination

  • 0.9801
  • 0.9112
  • 0.9462
  • 0.9219

Part A

  • a = 0.3745 0.9864 0.8456 Question2\

Part B

  • a = 22.4669 1.3627 0.2763 Question2\

Part C

  • a = 4.0046 2.9213 1.5647 Question2\

Part D

  • a = 0.9973 0.5025 Question2\

Question 3

  • A, Thrower# 31

  • B, Thrower# 32

Question 4

function [mean_buckle_load,std_buckle_load,L_mean]=buckle_monte_carlo(E,r_mean,r_std,L_mean,L_std)
N=100;
r = normrnd(r_mean,r_std,[N,1]);
L = normrnd(L_mean,L_std,[N,1]);

Pcr = (pi.^3 .* E .* r.^4) ./ (16 .* L.^2);
mean_buckle_load = mean(Pcr);
std_buckle_load = std(Pcr);

P_test=1000*9.81/100;
sum(2.5<P_test)
L = ((pi^3*E.*r.^4)./(16*Pcr)).^0.5;
L_mean = mean(L)
end
  • A, mean_buckle_load = 176.0834 std_buckle_load = 83.7155

  • B, L = 30.5858m

Question 5

function [Cd_out]=sphere_drag(Re_in,spline_type)
data = [2	0.52
5.8	0.52
16.8	0.52
27.2	0.5
29.9	0.49
33.9	0.44
36.3	0.18
40	0.074
46	0.067
60	0.08
100	0.12
200	0.16
400	0.19];

Cd_out = interp1(data(:,1),data(:,2),Re_in,spline_type);
end

Part B Question5\

Question 6

method value error
analytical 8.3750 0%
1 Gauss Point 8.2292 1.74%
2 Gauss Point 8.3750 0%
3 Gauss Point 8.3750 0%