A finite straight thin wire at a constant potential, find the charge distribution.

20 views (last 30 days)
can anybody please help me how to plot of charge density along the wire and how to plot number of section of wire. i am looking for positive response
thanks

Answers (2)

Nikhil Reddy Pottanigari
Nikhil Reddy Pottanigari on 18 Jun 2020
Hi,
The code implements Plot of Line Charge distribution on a thin wire which is maintained at V volt.
Here parameters are:
V = 1V
Length of wire, L = 1m
Radius of wire, a = 1mm
The Method of moment technique is used.
The basis function used is Triangular Function,
The testing function used is Delta (Point Matching).
For other specification, Parameters can be changed. For smooth variation the Value of section , N has to be increased.
The outer charge is starting from zero because, the triangular basis function is used from L = 0, The outer most triangular function can be made Half triangular to have high charge density at the ends of the wire.
% Matlab Code for solving Electric potential
% Line charge distribution
% Pulse delta
clc
close all
% clear all;
syms m n
L = 1; % Length of wire
lim1 = 0; % Lower limit
lim2 = L; % Upper limit
a = 0.001; % radius of the wire
V = 1; % Potential V = 1 volt
ep_0 = 8.854*1e-12; % permittivity
ep_r = 1; % relative Permittivity
N = 10; % Number of sections
M = N; % Number of testing function
hx = (lim2-lim1)/(N); % Step width of each section
x = lim1:hx:lim2;
dx = hx;
% Definition of testing function
Zmn = zeros(M,N);
Zmn1 = zeros(M,N);
%Basis function
% 1 for (n-1)delx < x < n*delx
% fn = 1;
ii = 1:N;
xm = (ii-0.5)*dx; % Center for delta function
for n = 1:N
for m = 1:N
xb = n*dx; % Section higher limit
xa = (n-1)*dx; % Section lower limit
if m ==n
Zmn(m,n) = 2*log(dx/a);
else
% p = (xb-xm)+sqrt((xb-xm).^2-a^2); % Caluclation of solution matrix num
% q = (xa-xm)+sqrt((xa-xm).^2-a^2); % Caluclation of solution matrix den
% Zmn(m,n) = log(abs(p/q)); % Getting Zmn matrix
% A(i, j)=DELTA/abs(Y(i)-Y(j) )
Zmn(m,n) = dx/(abs(xm(n)-xm(m)));
end
end
end
% Formation of Zmn matrix
% for m = 1:M
% for n = 1:N
% Zmn1(m,n) = Zmn(m,n);
% end
% end
bm = 4*pi*ep_0*ones(M,1); % Constant Matrix
an = Zmn\bm;
f1 = 0;
fvar = 0;
for n = 1:N
xn = lim1+(n-1)*hx;
if n == 1
fvar = an(n)*rectpuls(x-xn,hx);
else
fvar = an(n)*rectpuls(x-xn,hx);
end
f1 = f1+fvar;
end
figure();
plot(x,f1*1e12,'k--','LineWidth', 2);
title('Plot of charge distribution');
xlabel('section of wire');
ylabel('Charge density (pC/m^3)');
legend(['Computed for N section = ',num2str(N)]);
  2 Comments
astronot
astronot on 29 Nov 2020
what if we have two wire one is along with x axis , the other one along with z axis and they are adjoining, basis function is pulse function how can we find ı hope you help me about this

Sign in to comment.


Samiullah Yousaf
Samiullah Yousaf on 21 Aug 2021
Dear staff, can any body help me in plotting the current density vs observation angle withg a general code.m? I m following W.Gibson text book and doing an example topic (*5.3.2 ) (Scattering by an Infinite Cylinder: TE Polarization). Witing for the positive response. Thanks

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!