Contents
clc;
clear all;
close all;
input info.
Dimensions
dimension=1;
d=dimension;
charge =1;
q=charge;
[x,y]=meshgrid([-d:d/33:d],[-d:d/33:d]);
v=-q./(4.*pi.*sqrt((x+d./2).^2+(y+d./2).^2))+q./(4.*pi.*sqrt((x-d./2).^2+(y-d./2).^2));
Plot result of equipotential contours at high resolution and countours
figure (1);
contour(v,[-1:.005:1]);
title('equipotential contours at high resolution');
figure;
contour3(v,[-1:.005:1]);
title('contours at elevation proportional to voltage for high resolution');
plot equipotential contours at lower resolution to see individual contours easier
figure (2);
contour(v,[-1:.05:1]);
title('equipotential contours at low resolution');
figure;
contour3(v,[-1:.05:1]);
title('contours at elevation proportional to voltage');
plots all four graph on the same page for comparison
figure (3);
subplot(2,2,1);contour(v,[-1:.005:1]);
title('equipotential contours at high resolution');
subplot(2,2,2);contour3(v,[-1:.005:1]);
title('contours at elevation proportional to voltage for high resolution');
subplot(2,2,3);contour(v,[-1:.05:1]);
title('equipotential contours at low resolution');
subplot(2,2,4);contour3(v,[-1:.05:1]);
title('contours at elevation proportional to voltage');
Published with MATLAB® R2015a
No comments:
Post a Comment