Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
.
- Loading branch information
mattmaliniak
committed
Dec 15, 2017
1 parent
f766d1d
commit b9d8712
Showing
5 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
% Part B Script | ||
% From problem statement: | ||
% T=0.006 uN/um | ||
% P=0.001 MPa | ||
[w] = membrane_solution3(0.006,0.001); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
% Part D Script | ||
% From problem statement: | ||
% T=0.006 uN/um | ||
% P=0.001 MPa | ||
% n = 10 nodes | ||
[w] = membrane_solution(0.006,0.001,10) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
% Part F script | ||
% From Problem Statement: | ||
n=[3,20:5:40]; | ||
P=0.001; %MPa | ||
|
||
% Sets vector length so it doesn't change every iteration in for loop | ||
T = zeros(1,length(n)); | ||
ea = zeros(1,length(n)); | ||
|
||
% Uses tension_sol function to solve for the tension for each input | ||
for i = 1:length(n) | ||
[T(i), ea(i)] = tension_sol(P,n(i)); | ||
[T(i), ea(i)] = tension_sol(P,n(i)); | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
% Part G Script | ||
% From Problem Statement | ||
P = linspace(.001,.01,10); | ||
n = 20; | ||
|
||
% Sets vector length so it doesn't change every iteration in for loop | ||
T = zeros(1,length(P)); | ||
wmax = zeros(1,length(P)); | ||
|
||
% Uses tension_sol and membrane_solution functions to solve for the maximum displacement for all iterations | ||
for i = 1:length(P) | ||
T(i) = tension_sol(P(i),n); | ||
w = membrane_solution(T(i),P(i),n); | ||
wmax(i) = max(w); | ||
end | ||
|
||
% Sets up figure for plot | ||
clf | ||
setDefaults | ||
|
||
% Standard Linear Regression with equation P(x) = A*w^2 | ||
x = wmax'; | ||
y = P'; | ||
Z = x.^3; | ||
a = Z\y; | ||
x_fcn = linspace(min(x),max(x)); | ||
plot(x,y,'o',x_fcn,a.*x_fcn.^3) | ||
title('Pressure vs. Maximum Deflection') | ||
Z=x.^3; | ||
a=Z\y; | ||
x_fcn=linspace(min(x),max(x)); | ||
|
||
% Plots regression line with actual points | ||
plot(x,y,'o',x_fcn,a*x_fcn.^3) | ||
title('Pressure vs Maximum Deflection') | ||
xlabel('Maximum Deflection (um)') | ||
ylabel('Pressure (MPa)') | ||
ylabel('Pressure (MPa)') | ||
print('Part g','-dpng') |
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