Plot electric potential distribution

32 visualizaciones (últimos 30 días)
Lisa Nguyen
Lisa Nguyen el 4 de Nov. de 2019
Respondida: David Wilson el 5 de Nov. de 2019
How do I plot electric potential distributions that look similar to this? I have already calculated the Electric potential as a 64x128 matrix (64 electrodes and 128 dipole sources) using V (r, θ)= p*cos(θ)/(4*pi*σ*r^2). I'm just confysed on what commands to use to plot the distriution.

Respuestas (1)

David Wilson
David Wilson el 5 de Nov. de 2019
Well I kind of get what you want, but you do seem to have a singularity at the origin when r=0.
p = 1; sig = 1; % constants that are still a mystery.
V = @(r,theta) min(max(p*cos(theta)./(4*pi*sig*r.^2),-1),1); % Need thresholding here.
npts = 1000;
r = linspace(-1,1,npts)';
phi = linspace(0,2*pi, npts)';
[R, Phi] = meshgrid(r,phi);
E = V(R,Phi);
[X,Y] = pol2cart(Phi,R);
contourf(X,Y,E)
colorbar
and this gives tmp.png

Categorías

Más información sobre Electrical Block Libraries en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by