Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.
  • Loading branch information
ltd13002 committed Dec 15, 2017
1 parent eb672e6 commit 1667a4e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Part A/membrane_solution3.m
Expand Up @@ -16,8 +16,10 @@ function [w] = membrane_solution3(T,P)
z = zeros(size(x));
z(2:end-1,2:end-1) = reshape(w,[3 3]);
surf(x,y,z)
title('Membrane Displacement')
zlabel('Displacement (micrometer)')
title('Membrane Displacement (3 x 3)')
zlabel('Z Position (micron)')
ylabel('Y Position (micron)')
xlabel('X Position (micron)')
% Membrane displacement is shown on chart

end
Binary file modified Part B/PartBFigure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions Part B/membrane_solution3.m
@@ -0,0 +1,25 @@
function [w] = membrane_solution3(T,P)
% T = Tension (microNewton/micrometer)
% P = Pressure (MPa)

od = ones(8,1);
od(3:3:end) = 0;
k = -4*diag(ones(9,1))+diag(ones(9-3,1),3)+diag(ones(9-3,1),-3)+diag(od,1)+diag(od,-1);


y = -(10/4)^2*(P/T)*ones(9,1);
w = k\y;
% Solves for displacement (micrometers)
% Solution represents a 2D data set w(x,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('Membrane Displacement (3 x 3)')
zlabel('Z Position (micron)')
ylabel('Y Position (micron)')
xlabel('X Position (micron)')
% Membrane displacement is shown on chart

end
Binary file modified Part D/PartDFigure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions Part D/membrane_solution.m
@@ -0,0 +1,25 @@
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 (10 x 10)')
zlabel('Z Position (micron)')
ylabel('Y Position (micron)')
xlabel('X Position (micron)')
% Membrane displacement is shown on chart
end

0 comments on commit 1667a4e

Please sign in to comment.