Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Leahy committed Dec 10, 2017
1 parent 1a51a21 commit 96d48b1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,58 @@
# 07_final_project
# 07_final_project

### Part A
``` matlab
function [w] = membrane_solution3(T,P) % Set up initial matrix
% T = given tension (microNewton/micrometer)
% P = given 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);
% Solve for unknown matrix, w
y = -(10/4)^2*(P/T)*ones(9,1); %output vector
w = k\y; %solves for w in microm
[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)
end
```

### Part B
``` matlab
[w] = membrane_solution3(0.006,0.001);
```

![3x3 Interior Nodes](./figures/figure1.png)

### Part C
```matlab
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 microm
[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
```

### Part D
``` matlab
[w] = membrane_solution(0.006,0.001,10)
```

![nxn Interior Nodes, n = 10](./figures/figure2.png)
Binary file added figures/figure1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/figure2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 96d48b1

Please sign in to comment.