Skip to content
Permalink
1a6137d8d6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Leahy 1
Latest commit c1713ed Dec 13, 2017 History
0 contributors

Users who have contributed to this file

18 lines (15 sloc) 600 Bytes
function [w] = membrane_solution(T,P,n)% Set up initial matrix
% T = given tension (microNewton/micrometer)
% P = given pressure (MPa)
% n = number 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);
% Solve for unknown matrix, w
y = -(10/(n+1))^2*(P/T)*ones(n^2,1); %output vector
w = k\y; %solves for w in micron
[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)
end