-
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
cjc13016
committed
Dec 11, 2017
1 parent
96d48b1
commit 8354c38
Showing
1 changed file
with
91 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
function [pw_se,w]=SE_diff(T,P,n) | ||
w = membrane_solution31(T,P,n); | ||
A = zeros(n,n); | ||
h = zeros(n,1); | ||
m = n+1; %Represents the number of nodes | ||
|
||
%Top Left Corner Interior Node | ||
for i = 2+m | ||
A(i,i)=1; | ||
A(i,i-1)=0; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=0; | ||
h(i) = 10; | ||
end | ||
%Top Right Corner Interior Node | ||
for i = m*2-1 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=1; | ||
h(i) = 10; | ||
end | ||
%Bottom Left Corner Interior Node | ||
for i = m*m-(2*m)+1 | ||
A(i,i)=1; | ||
A(i,i-1)=0; | ||
A(i,i+m)=0; | ||
A(i,i+m-1)=0; | ||
h(i) = 10; | ||
end | ||
%Bottom Right Corner Interior Node | ||
for i = (m*m)-m-1 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=0; | ||
A(i,i+m-1)=0; | ||
h(i) = 10; | ||
end | ||
|
||
%The following represent the values for the interior nodes | ||
|
||
%Top Interior Row | ||
for i = 3+m:m*2-2 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=1; | ||
h(i) = 10; | ||
end | ||
%Bottom Interior Row | ||
for i = m*m-(2*m)+2:(m*m)-m-2 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=0; | ||
A(i,i+m-1)=0; | ||
h(i) = 10; | ||
end | ||
%Left Interior Column | ||
for i = (2*m)+2,(2*m)+2:(m*m)-(2*m)+2 | ||
A(i,i)=1; | ||
A(i,i-1)=0; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=0; | ||
h(i) = 10; | ||
end | ||
%Right Interior Column | ||
for i = (3*m)-1,(2*m)+2:(m*m)-(2*m)+2 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=1; | ||
h(i) = 10; | ||
end | ||
%Inerior Nodes | ||
for i = (2*m)+3:(3*m)-2,(2*m)+3:(m*m)-(3*m)+3 | ||
A(i,i)=1; | ||
A(i,i-1)=1; | ||
A(i,i+m)=1; | ||
A(i,i+m-1)=1; | ||
h(i) = 10; | ||
end | ||
|
||
|
||
dw_dx = (A(i,i)-A(i-1)+A(i,i+m)-A(i,i+m-1))/(2.*h); | ||
dw_dx' | ||
|
||
end | ||
|
||
|
||
|
||
|