-
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
3 changed files
with
81 additions
and
54 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
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 |
---|---|---|
@@ -1,25 +1,27 @@ | ||
function [w] = membrane_solution3(T,P) | ||
% Central finite difference approximation of gradient | ||
% with 3x3 (um^2) interior nodes in terms of P & T. | ||
% Input: | ||
% T = tension per unit length (uN/um) | ||
% P = pressure (MPa) | ||
% Output: | ||
% w = displacement vector for interior nodes | ||
|
||
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; | ||
|
||
% | ||
% Find displacement vector w | ||
% which represents 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) | ||
|
||
% Plot gradient of membrane displacement | ||
surf(x,y,z) | ||
title('Gradient of Membrane Displacement') | ||
zlabel('Displacement [um] (micrometers)') | ||
end |