Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Part A-D
  • Loading branch information
ltd13002 committed Dec 13, 2017
1 parent 1c3f719 commit beadb24
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PartB.m
@@ -0,0 +1,2 @@
% Part B Script
[w] = membrane_solution3(0.006,0.001);
Binary file added PartBFigure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions PartD.m
@@ -0,0 +1,2 @@
% Part D Script
[w] = membrane_solution(0.006,0.001,10)
Binary file added PartDFigure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions membrane_solution.m
@@ -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
21 changes: 21 additions & 0 deletions membrane_solution3.asv
@@ -0,0 +1,21 @@
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)

[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')
zlable
% Solution represents a 2D data set w(x,y)
end
23 changes: 23 additions & 0 deletions membrane_solution3.m
@@ -0,0 +1,23 @@
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')
zlabel('Displacement (micrometer)')
% Membrane displacement is shown on chart

end

0 comments on commit beadb24

Please sign in to comment.