Teg-Men
Junior Member level 2
Hi, I am trying to write a Matlab code that works for charged conducting Plate. Spesifically, the problem is from R.F. Harringston's "Field Computation by Moment Method" Ch2.2
I have following codes, but that does not work for the cases if I choose number of subsections more than one.
Here are codes:
I think the problem is in the function MatrixL2x2. Because I calculate the value for the case #subsection = 1
Here are the actual results:
N = 1 => 31.5 picofarads/meter
N = 3 => 37.3 picofarads/meter
N = 4 => 38.2 picofarads/meter
N = 6 => 39.2 picofarads/meter
As I said, the code can find N=1 case result.
Please ignore comments.
Thanks.
I have following codes, but that does not work for the cases if I choose number of subsections more than one.
Here are codes:
function [x, y] = lengthVectors2x2(length, N)
%AREA2X2 Summary of this function goes here
% Detailed explanation goes here
subLength = length/(N);
for i = 1:N;
x(i) = abs((length+subLength)/2 - i* subLength);
end
y = x;
end
function [Gm] = MatrixG2x2(N,V)
%It calculates Lmn matrix by using point matching
% Enter the N*N matrix size
% Detailed explanation goes here
for m =1:N
Gm(m) =V;
end
Gm = Gm';
end
function [q] = SolutionX2x2(length, N , V)
% V is first
%UNTİTLED3 Summary of this function goes here
% Detailed explanation goes here
f = MatrixL2x2(length, N);
g = MatrixG2x2(N,V);
a = inv(f)*g;
q = 0;
for i = 1:N
q = q + a(i)*((length/N)^2);
end
q = q / V;
q = q / length;
end
function [Lmn] = MatrixL2x2(length, N)
%It calculates Lmn matrix by using point matching
% Enter the N*N matrix size
% Detailed explanation goes here
permitivity = 8.85*1e-12;
[x, y] = LengthVectors2x2(length, N);
for m =1:N;
for n=1:N;
if m == n;
Lmn(m,n) = (0.8814*length/N)/(pi*permitivity);
else
Lmn(m,n) = (length/N)^2/(4*pi*permitivity*sqrt(x(m)^2 + y^2));
end
end
end
end
I think the problem is in the function MatrixL2x2. Because I calculate the value for the case #subsection = 1
Here are the actual results:
N = 1 => 31.5 picofarads/meter
N = 3 => 37.3 picofarads/meter
N = 4 => 38.2 picofarads/meter
N = 6 => 39.2 picofarads/meter
As I said, the code can find N=1 case result.
Please ignore comments.
Thanks.