Skip to content
Permalink
0d5ab3ad02
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
 
 
Cannot retrieve contributors at this time
22 lines (17 sloc) 468 Bytes
function [w] = membrane_solution(T,P,n)
%
% T = tension per unit length (uN/um)
% 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;
%
[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]);