# How can I add a square dielectric object into parallel/coplanar capacitance sensor?

3 visualizaciones (últimos 30 días)
Cobus Labuschagne el 18 de Jun. de 2022
Respondida: Ravi el 30 de En. de 2024
My program is below and I am trying to add in a dielctric object into different places outside the capacitor.
I would appreciate any help on adding same.
I understand that Neumann boundaries can be added but I am not sure how to add the relative permittivity of the dielectric.
Thank you very much.
% 2D Poisson Equation for standard parallel plate capacitor using finite differences method
% Poisson eq : d²V(x,y)/dx²+d²V(x,y)/dy²= - ρ/ε
%-------------------------------------------------------------------------%
% PARAMETERS USED IN THIS PROGRAM
%-------------------------------------------------------------------------%
% E = Total electric field matrix using Poisson's equation
% V = Potential matrix
% ρ = volume density of free charges
% ε = permittivity of dielectric medium
%-------------------------------------------------------------------------%
%-------------------------------------------------------------------------%
% INITIAL PARAMETERS USED
%-------------------------------------------------------------------------%
Nx = 201; % Number of X-grids
Ny = 201; % Number of Y-grids
mpx = ceil(Nx/2); % Mid-point of x
mpy = ceil(Ny/2); % Mid point of y
Ni = 750; % Number of iterations for the Poisson solver
V = zeros(Nx,Ny); % Potential (Voltage) matrix
rho = zeros(Nx,Ny) % Linear charge density in coulomb per meter
rho = 201×201
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
epsilon_0 = 8.854E-12 % Permittivty of free space (F/m)
epsilon_0 = 8.8540e-12
T = 0; % Top-wall potential
B = 0; % Bottom-wall potential
L = 0; % Left-wall potential
R = 0; % Right-wall potential
%-------------------------------------------------------------------------%
% Initial Edge potentials
%-------------------------------------------------------------------------%
V(1,:) = L;
V(Nx,:) = R;
V(:,1) = B;
V(:,Ny) = T;
%-------------------------------------------------------------------------%
% Initial Corner potentials
%-------------------------------------------------------------------------%
V(1,1) = 0.5*(V(1,2)+V(2,1));
V(Nx,1) = 0.5*(V(Nx-1,1)+V(Nx,2));
V(1,Ny) = 0.5*(V(1,Ny-1)+V(2,Ny));
V(Nx,Ny) = 0.5*(V(Nx,Ny-1)+V(Nx-1,Ny));
%-------------------------------------------------------------------------%
length_plate = 70; % Length of plate in terms of number of grids
lp = floor(length_plate/2);
position_plate = 15; % Position of plate on x axis
pp1 = mpx+position_plate;
pp2 = mpx-position_plate;
for E = 1:Ni % Number of iterations
for i=2:Nx-1
for j=2:Ny-1
% The next two lines are meant to force the matrix to hold the
% potential values for all iterations
V(pp1,mpy-lp:mpy+lp) = 100;
V(pp2,mpy-lp:mpy+lp) = -100;
V(i,j)=0.25*(V(i+1,j)+V(i-1,j)+V(i,j+1)+V(i,j-1) + rho(i,j)./epsilon_0);
end
end
end
% Take transpose for proper x-y orientation
%V = V';
Ex = -Ex;
Ey = -Ey;
% Electric field Magnitude
E = sqrt(Ex.^2+Ey.^2);
x = (1:Nx)-mpx;
y = (1:Ny)-mpy;
% Charge
Q = Ex.*x.*sqrt(x.^2 + (lp).^2)/9E9
Q = 201×201
1.0e-05 * 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0001 -0.0002 -0.0002
% Contour Display for electric potential
figure(1)
contour_range_V = -101:0.5:101;
contour(x,y,V,contour_range_V,'linewidth',0.5);
axis([min(x) max(x) min(y) max(y)]);
colorbar('location','eastoutside','fontsize',14);
xlabel('x-axis in meters','fontsize',14);
ylabel('y-axis in meters','fontsize',14);
title('Electric Potential distribution, V(x,y) in volts','fontsize',14);
h1=gca;
set(h1,'fontsize',14);
fh1 = figure(1);
set(fh1, 'color', 'white')
% Quiver Display for electric field Lines
figure(2)
contour(x,y,E,'linewidth',0.5);
hold on, quiver(x,y,Ex,Ey,2)
title('Electric field Lines, E (x,y) in V/m','fontsize',14);
axis([min(x) max(x) min(y) max(y)]);
colorbar('location','eastoutside','fontsize',14);
xlabel('x-axis in meters','fontsize',14);
ylabel('y-axis in meters','fontsize',14);
h3=gca;
set(h3,'fontsize',14);
fh3 = figure(3);
set(fh3, 'color', 'white')
hold off
% Graph for capacitance
figure(3)
surf(x,y,Q)
axis([min(x) max(x) min(y) max(y)]);
colorbar('location','eastoutside','fontsize',14);
xlabel('x-axis in meters','fontsize',14);
ylabel('y-axis in meters','fontsize',14);
title('Capacitance distribution, C in C/m','fontsize',14);
h1=gca;
set(h1,'fontsize',14);
fh1 = figure(1);
set(fh1, 'color', 'white')
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Ravi el 30 de En. de 2024
Hi Cobus Labuschagne,
When a dielectric is added, the permittivity of the medium changes. If the relative permittivity of the medium is and permittivity of dielectric is , then the effective permittivity is .
This is how you can add a dielectric. Follow the steps below to add a square dielectric.
1. Define relative permittivity "epsilon_r".
2. Define "epsilon_matrix", a matrix that contains the permittivity values at every grid point. Initialize the matrix to contain all entries equal to "epsilon_0".
3. Define four variables, "diel_x_start", "diel_x_end", "diel_y_start", and "diel_y_end", denoting a square region for the dielectric.
4. Update the entries of the "epsilon_matrix" in the dielectric region.
epsilon_matrix(diel_x_start:diel_x_end, diel_y_start:diel_y_end) = epsilon_r * epsilon_0;
5. Modify the potential calculation equation to incorporate the epsilon_matrix.
V(i,j) = 0.25 * (V(i+1,j) + V(i-1,j) + V(i,j+1) + V(i,j-1) + rho(i,j) / epsilon_matrix(i,j));
In a nutshell, define the relative permittivity, specify the region of dielectric, and update the potential calculation to account for varying permittivity.
Hope this answer helps.
Regards,
Ravi
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Triangulation Representation en Help Center y File Exchange.

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by