Last active
June 12, 2021 15:30
-
-
Save maxerbox/c5062a8f87e8d78680a848857e5522fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
close all; | |
clc; | |
% Paramètres géométriques du capteur : | |
R=0.005; %Rayon d'une électrode en m | |
L=0.14; %Distance entre les électrodes en m | |
Uexp=2.47; %Tension en Volt | |
%TODO | |
epsilon = 710e-12; %Permitivité du milieu (comment le matériau est permissif) | |
%TODO | |
gamma = 0.0828; %Conductivité de l'eau en ? (à mesurer) | |
d = 0.20; | |
% Paramètres de la grille de points centrée autour du capteur : | |
Xmin=-1; | |
Xmax=1; | |
Ymin=-1; | |
Ymax=1; | |
dx=0.05; | |
dy=0.05; | |
% Calcul du courant I et de la quantité surfacique de charge Sigma: | |
Init = (Uexp*gamma*2*pi)/(1/R - 1/L); %gamma conductivité de l'eau en | |
Sigma = (Init*epsilon)/(gamma*4*pi*R^2); | |
% Création de la grille de points : | |
[X,Y]=meshgrid(Xmin:dx:Xmax,Ymin:dy:Ymax); | |
% Evaluation en chaque point de la grille de la valeur du potentiel | |
% électrique : | |
[n,m]=size(X); | |
V=zeros(n,m); | |
for i=1:1:n | |
for j=1:1:m | |
R1 = ((X(i,j) - L/2)^2 + Y(i,j)^2)^1/2; | |
R2 = ((X(i,j) + L/2)^2 + Y(i,j)^2)^1/2; | |
R3 = ((X(i,j) + L/2 + 2*d)^2 + Y(i,j)^2)^1/2; | |
R4 = ((X(i,j) + L/2 + 2*d + L)^2 + Y(i,j)^2)^1/2; | |
if (R1 < R) | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(- 1/R + 1/L + 1/(2*d+L) - 1/(2*L + 2*d) ); | |
elseif (R2 < R) | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(1/L - 1/R - 1/(2*d) + 1/(2*d+L)); | |
elseif (R3 < R) | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/(2*d+L) + 1/(2*d) + 1/R - 1/L); | |
elseif (R4 < R) | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/(2*d+2*L) + 1/(2*d+L) + 1/L - 1/R); | |
else | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/R1 + 1/R2 + 1/R3 - 1/R4); | |
end | |
end | |
end | |
% Evaluation en chaque point de la grille du champ électrique : | |
[Ex,Ey]=gradient(V,dx,dy); | |
% Plot : | |
figure(01); | |
contour(X,Y,V); | |
hold on; | |
streamslice(X,Y,Ex,Ey); %A utiliser si sur Matlab | |
%streamline(X,Y, Ex,Ey); %Ne fonctionne pas sur Octave | |
axis equal | |
xlabel('x (m)'); | |
ylabel('y (m)'); | |
hold off | |
d = 0:0.005:0.195; | |
Ipast = zeros(length(d),1); | |
for i = 1:length(d) | |
% Ipast(i) = (Init/4*pi*gamma) * (2/R - 2/L + 1/(L+2*d(i)) - 1/(-L-2*d(i)) - 1/d(i)); | |
% D1 = (-1/R + 1/L + 1/(L+2*d(i)) - 1/(2*L+2*d(i))); | |
% D2 = (-1/L + 1/R + 1/(2*d(i)) - 1/(L+2*d(i))); | |
% Ipast(i) = -(Uexp*gamma*4*pi)/(D1 - D2) - Init; | |
Ipast(i) = (Uexp*4*pi*gamma) * (2/R - 2/L + 1/(L+2*d(i)) - 1/(-L-2*d(i)) - 1/d(i)); | |
end | |
Xexp = fliplr([0.12, 0.115, 0.11, 0.105, 0.10, 0.095, 0.09, 0.085, 0.08, 0.075, 0.07] - 0.064); | |
Uexp = fliplr([3.967, 3.965, 3.961, 3.956, 3.949, 3.938, 3.928, 3.9, 3.852, 3.791, 3.664]); | |
Iexp = -Uexp./(1); | |
figure(11) | |
plot(Xexp, Uexp / 4.1, '-b'); | |
hold on; | |
plot(d, Ipast / 1e3, '-r'); | |
xlabel('d (mètres)'); | |
ylabel('I (ampères)'); |
This file contains hidden or 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
close all; | |
clc; | |
% Paramètres géométriques du capteur : | |
R=0.005; %Rayon d'une électrode en m | |
L=0.140; %Distance entre les électrodes en m | |
Uexp=3.2; %Tension en Volt | |
%TODO | |
epsilon = 710e-12; %Permitivité du milieu (comment le matériau est permissif) | |
%TODO | |
gamma = 0.0941; %Conductivité de l'eau en ? (à mesurer) | |
d = 0.20; | |
% Paramètres de la grille de points centrée autour du capteur : | |
Xmin=-1; | |
Xmax=1; | |
Ymin=-1; | |
Ymax=1; | |
dx=0.05; | |
dy=0.05; | |
% Calcul du courant I et de la quantité surfacique de charge Sigma: | |
Init = (Uexp*gamma*2*pi)/(1/R - 1/L); %gamma conductivité de l'eau en | |
Sigma = (Init*epsilon)/(gamma*4*pi*R^2); | |
% Création de la grille de points : | |
[X,Y]=meshgrid(Xmin:dx:Xmax,Ymin:dy:Ymax); | |
% Evaluation en chaque point de la grille de la valeur du potentiel | |
% électrique : | |
[n,m]=size(X); | |
V=zeros(n,m); | |
for i=1:1:n | |
for j=1:1:m | |
R1 = ((X(i,j) - L/2)^2 + Y(i,j)^2)^1/2; | |
R2 = ((X(i,j) + L/2)^2 + Y(i,j)^2)^1/2; | |
R3 = ((X(i,j) + L/2 + 2*d)^2 + Y(i,j)^2)^1/2; | |
R4 = ((X(i,j) + L/2 + 2*d + L)^2 + Y(i,j)^2)^1/2; | |
if (R1 < R) | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(- 1/R + 1/L + 1/(2*d+L) - 1/(2*L + 2*d) ); | |
elseif (R2 < R) | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(1/L - 1/R - 1/(2*d) + 1/(2*d+L)); | |
elseif (R3 < R) | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/(2*d+L) + 1/(2*d) + 1/R - 1/L); | |
elseif (R4 < R) | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/(2*d+2*L) + 1/(2*d+L) + 1/L - 1/R); | |
else | |
V(i,j) = 0; % A compléter | |
V(i,j) = ((Sigma*R^2)/(epsilon))*(-1/R1 + 1/R2 + 1/R3 - 1/R4); | |
end | |
end | |
end | |
% Evaluation en chaque point de la grille du champ électrique : | |
[Ex,Ey]=gradient(V,dx,dy); | |
% Plot : | |
figure(01); | |
contour(X,Y,V); | |
hold on; | |
streamslice(X,Y,Ex,Ey); %A utiliser si sur Matlab | |
%streamline(X,Y, Ex,Ey); %Ne fonctionne pas sur Octave | |
axis equal | |
xlabel('x (m)'); | |
ylabel('y (m)'); | |
hold off | |
d = 0:0.005:0.195; | |
Ipast = zeros(length(d),1); | |
for i = 1:length(d) | |
% Ipast(i) = (Init/4*pi*gamma) * (2/R - 2/L + 1/(L+2*d(i)) - 1/(-L-2*d(i)) - 1/d(i)); | |
% D1 = (-1/R + 1/L + 1/(L+2*d(i)) - 1/(2*L+2*d(i))); | |
% D2 = (-1/L + 1/R + 1/(2*d(i)) - 1/(L+2*d(i))); | |
% Ipast(i) = -(Uexp*gamma*4*pi)/(D1 - D2) - Init; | |
Ipast(i) = (Uexp*4*pi*gamma) * (2/R - 2/L + 1/(L+2*d(i)) - 1/(-L-2*d(i)) - 1/d(i)); | |
end | |
Xexp = 0:0.01:0.16; | |
Uexp = [3.428 3.758 3.91 3.948 3.961 3.965 3.967 3.968 3.964 3.958 3.955 3.95 3.945 3.94 3.935 3.93 3.927]; | |
Iexp = -Uexp./(1); | |
figure(11) | |
plot(Xexp, Uexp / 2.8, '-b'); | |
hold on; | |
plot(d, Ipast / 1e3, '-r'); | |
xlabel('d (mètres)'); | |
ylabel('I (ampères)'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment