Permalink
Cannot retrieve contributors at this time
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?
ME_3255_Final_Project/partg.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (24 sloc)
810 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Create plot for wmax v pressure | |
clear | |
% range of pressures to be used to find tension T | |
P = linspace(0.001,0.01,10); | |
% find the tension using the 'bisect.m' method | |
for i = 1:length(P) | |
func = @(T) SE_diff(T,P(i),10); | |
[root(i),fx,ea,iter] = bisect(func,0.001,1,.1); | |
end | |
% Calculate each w using every root and pressure value | |
for i = 1:length(root) | |
w = membrane_solution(root(i),P(i),10); | |
w1(:,i) = w; % displays w values as column | |
end | |
% Find final wmax by taking the maximum w value from each | |
% column in the w vector | |
wmax = max(w1); | |
coefficients = polyfit(wmax,P,3); | |
Y = polyval(coefficients,wmax); | |
% plot the w_max vs. the Pressure and include a cubic best fit curve. | |
plot(wmax,P,wmax,Y,'or') | |
xlabel('Max Deflection (um)') | |
ylabel('Pressure (MPa)') | |
title('Pressure vs. Maximum Deflection') |