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
Part E
- Loading branch information
Maliniak
committed
Dec 13, 2017
1 parent
36453c0
commit a59d83a
Showing
3 changed files
with
83 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function [pw_se,w]=SE_diff(T,P,n) | ||
E = 1e12; %Pa | ||
v = .31; | ||
t = .3; %nm | ||
h = 10/(n+1); %nm | ||
w = membrane_solution(T,P,n); | ||
z = zeros(n+2); | ||
z(2:end-1,2:end-1) = reshape(w,[n n]); | ||
num = n + 1; | ||
wbar = zeros(num); | ||
for i = 1:num | ||
for j = 1:num | ||
wbar(i,j) = mean([z(i,j),z(i+1,j),z(i,j+1),z(i+1,j+1)]); | ||
end | ||
end | ||
pw = sum(wbar.*h^2.*P); | ||
dwdx = zeros(num); | ||
dwdy = zeros(num); | ||
% for i = 1:num | ||
% for j = 1:num | ||
% dwdx(j,i) = z(i+1,j)-z(i,j); | ||
% dwdy(j,i) = z(i,j+1)-z(i,j); | ||
% end | ||
% end | ||
dwdx(:,1) = wbar(:,2)-wbar(:,1); | ||
for i = 2:n | ||
dwdx(:,3) = wbar(:,n+1)-wbar(:,n-1); | ||
end | ||
% dwdx(:,4) = wbar(:,4)-wbar(:,3); | ||
dwdy(1,:) = wbar(2,:)-wbar(1,:); | ||
dwdy(2,:) = wbar(3,:)-wbar(1,:); | ||
dwdy(3,:) = wbar(4,:)-wbar(2,:); | ||
|
||
%se = E*t*h^2/(2*(1-v^2)); |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function [pw_se,w]=SE_diff(T,P,n) | ||
E = 1; %TPa Units may need to be changed | ||
v = .31; %Poissons ratio | ||
t = .3; %nm | ||
h = 10/(n+1); %nm | ||
w = membrane_solution(T,P,n); | ||
z = zeros(n+2); | ||
z(2:end-1,2:end-1) = reshape(w,[n n]); | ||
num = n + 1; | ||
wbar = zeros(num); | ||
for i = 1:num | ||
for j = 1:num | ||
wbar(i,j) = mean([z(i,j),z(i+1,j),z(i,j+1),z(i+1,j+1)]); | ||
end | ||
end | ||
pw = sum(sum(wbar.*h^2.*P)); | ||
dwdx = zeros(num); | ||
dwdy = zeros(num); | ||
for i = 1:num | ||
for j = 1:num | ||
dwdx(i,j) = mean([z(i+1,j)-z(i,j),z(i+1,j+1)-z(i,j+1)]); | ||
dwdy(i,j) = mean([z(i,j+1)-z(i,j),z(i+1,j+1)-z(i+1,j)]); | ||
end | ||
end | ||
se = E*t*h^2/(2*(1-v^2))*sum(sum(0.25.*dwdx.^4+.25.*dwdy.^4+0.5.*(dwdx.*dwdy).^2)); | ||
pw_se = pw-se; |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function [w] = membrane_solution(T,P,n) | ||
% T = Tension (microNewton/micrometer) | ||
% P = Pressure (MPa) | ||
% n = # of interior nodes | ||
|
||
od = ones(n^2-1,1); | ||
od(n:n:end) = 0; | ||
k = -4*diag(ones(n^2,1))+diag(ones((n^2)-n,1),n)+diag(ones((n^2)-n,1),-n)+diag(od,1)+diag(od,-1); | ||
|
||
y = -(10/(n+1))^2*(P/T)*ones(n^2,1); | ||
w = k\y; | ||
% Solves for displacement (micrometers) | ||
% Output w is a vector | ||
% Solution represents a 2D data set w(x,y) | ||
|
||
[x,y] = meshgrid(0:10/(n+1):10,0:10/(n+1):10); | ||
z = zeros(size(x)); | ||
z(2:end-1,2:end-1) = reshape(w,[n n]); | ||
surf(x,y,z) | ||
title('Membrane Displacement') | ||
zlabel('Displacement (micrometer)') | ||
% Membrane displacement is shown on chart | ||
end |