Plot electric potential distribution

31 Ansichten (letzte 30 Tage)
Lisa Nguyen
Lisa Nguyen am 4 Nov. 2019
Beantwortet: David Wilson am 5 Nov. 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.

Antworten (1)

David Wilson
David Wilson am 5 Nov. 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

Kategorien

Mehr zu Electrical Block Libraries finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by