Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update membrane_solution3.m
  • Loading branch information
ltd13002 committed Dec 15, 2017
1 parent d8bfefc commit 0221c79
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions Part A/membrane_solution3.m
Expand Up @@ -8,19 +8,6 @@ function [w] = membrane_solution3(T,P)
% output:
% w = vector of displacement of interior nodes

<<<<<<< HEAD
[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
=======
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);
Expand All @@ -32,14 +19,18 @@ 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)')

[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

% Membrane displacement is shown on chart

end
>>>>>>> 3217bec2baefdb9797b60fd7e29f12b838227cd0

0 comments on commit 0221c79

Please sign in to comment.