forked from nin13001/ME3255_FInalProject
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
part C and D done
- Loading branch information
nin13001
committed
Dec 15, 2017
1 parent
3331f14
commit 1c8de35
Showing
6 changed files
with
87 additions
and
4 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function [w] = membrane_solution(T,P,n) | ||
|
||
od = ones(n^2-1,1); | ||
od(n:n:end) = 0; | ||
a = -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 = a\y; | ||
grid on | ||
[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) | ||
title('Membrane Displacement') | ||
xlabel('X (\muM)') | ||
ylabel('Y (\muM)') | ||
zlabel('Displacement (\muM)') | ||
colormap jet | ||
shading interp | ||
disp(w) | ||
end |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function [w] = membrane_solution3(T,P) | ||
|
||
|
||
od = ones(8,1); | ||
od(3:3:end) = 0; | ||
a = -4*diag(ones(9,1))+diag(ones(9-3,1),3)+diag(ones(9-3,1),-3)+diag(od,1)+diag(od,-1); | ||
|
||
|
||
y = -(10/4)^2*(P/T)*ones(9,1); | ||
w = a\y; | ||
|
||
grid on | ||
[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') | ||
xlabel('X (\muM)') | ||
ylabel('Y (\muM)') | ||
zlabel('Displacement (\muM)') | ||
colormap jet | ||
shading interp | ||
disp(w) | ||
|
||
end |
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