Plot electric potential distribution

조회 수: 31 (최근 30일)
Lisa Nguyen
Lisa Nguyen 2019년 11월 4일
답변: David Wilson 2019년 11월 5일
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