Plot electric potential distribution

20 次查看(过去 30 天)
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.

回答(1 个)

David Wilson
David Wilson 2019-11-5
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

类别

Help CenterFile Exchange 中查找有关 Electrical Block Libraries 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by