Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1
  • Loading branch information
cjc13016 committed Dec 15, 2017
1 parent a6aa124 commit 1a6137d
Showing 1 changed file with 2 additions and 52 deletions.
54 changes: 2 additions & 52 deletions README.md
Expand Up @@ -206,75 +206,25 @@ For a given pressure range of 0.001 to 0.01 MPa with 10 steps, determine the mem
Using the given pressure range, the tension is found at each different pressure value using the bisect method. From here, the deflection values at the calculated tensions and given pressures are found by calling the membrane_solution function from part C. The best fit line and coefficient are found using the built-in Matlab functions polyfit and polyval. These return a 4 x 1 matrix of coefficients, but since there is only one x term in the function (x^3), the first value in the matrix is determined to be the coefficient A.

```matlab
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
% This creates a plot for the max_w vs a given pressure
clear
P = linspace(0.001,0.01,10); % Assign the range of pressures used to find T
% In order to find the tension the bisect method is used
=======
clear
P = linspace(0.001,0.01,10);
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
clear
P = linspace(0.001,0.01,10);
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
clear
P = linspace(0.001,0.01,10);
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
for i = 1:length(P)
func = @(T) SE_diff(T,P(i),10);
[root(i),fx,ea,iter] = bisect_final_project(func,0.001,1,.1);
end
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
% Each value of w is calculated using each root and pressure value
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
for i = 1:length(root)
w = membrane_solution(root(i),P(i),10);
w1(:,i) = w;
end
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
w_max = max(w1); % in order to get the w_max we take the maximum w value from each column of the w vector
coefficients = polyfit(w_max,P,3);
Y = polyval(coefficients,w_max);
plot(w_max,P,w_max,Y,'or') % plot the w_max vs. the Pressure and include a cubic best fit curve.
=======
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
% in order to get the w_max we take the maximum w value from each column of the w vector
w_max = max(w1);
coefficients = polyfit(w_max,P,3);
Y = polyval(coefficients,w_max);
% plot the w_max vs. the Pressure and include a cubic best fit curve.
plot(w_max,P,w_max,Y,'or')
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
=======
>>>>>>> 3daf399f8af002d376801f3e913283aac67f17f2
xlabel('Max Deflection (micron)')
ylabel('Pressure (MPa)')
title('Pressure vs. Maximum Deflection')
Expand Down

0 comments on commit 1a6137d

Please sign in to comment.