-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,33 @@ | ||
function [pw_se,w] = SE_diff(T,P,n) | ||
E = 1; % 1 TPa ~= 10^6 MPa | ||
v = 0.31; | ||
t = 3*10^-4; | ||
h = 10/(n+1); | ||
|
||
w = membrane_solution(T,P,n); | ||
|
||
z = zeros(n + 2); | ||
z(2:end-1,2:end-1) = reshape(w,[n n]); | ||
|
||
num = n + 1; | ||
wavg = zeros(num); | ||
for i = 1:num | ||
for j = 1:num | ||
wavg(i,j) = mean([z(i,j),z(i+1,j),z(i,j+1),z(i+1,j+1)]); | ||
end | ||
end | ||
|
||
pw = sum(sum(wavg.*h^2.)) | ||
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((1/4).*dwdx.^4+(1/4).*dwdy.^4+(1/4).*(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,28 @@ | ||
function [w] = membrane_solution(T,P,n) | ||
% | ||
% T = tension per unit length (uN/um) | ||
% 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; | ||
|
||
% | ||
[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('Gradient of Membrane Displacement') | ||
zlabel('Displacement [um] (micrometers)') | ||
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function [w] = membrane_solution3(T,P) | ||
% Central finite difference approximation of gradient | ||
% with 3x3 (um^2) interior nodes in terms of P & T. | ||
% T = tension per unit length (uN/um) | ||
% P = pressure (MPa) | ||
|
||
od = ones(8,1); | ||
od(3:3:end) = 0; | ||
k = -4 * diag(ones((3^2),1)) + diag(ones((3^2)-3,1),3) + diag(ones((3^2)-3,1),-3) + diag(od,1) + diag(od,-1); | ||
|
||
% | ||
y = -(10/4)^2*(P/T)*ones(9,1); | ||
% | ||
w = k\y; | ||
|
||
% | ||
[x,y] = meshgrid(0:10/4:10,0:10/4:10); | ||
z = zeros(size(x)); | ||
% | ||
z(2:end-1,2:end-1) = reshape(w,[3 3]); | ||
surf(x,y,z) | ||
|
||
title('Gradient of Membrane Displacement') | ||
zlabel('Displacement [um] (micrometers)') | ||
end |