云南大学软件学院实验报告课程:大学物理实验学期:2012-2013学年第一学期任课教师:班级:学号:序号:姓名:成绩:实验4静电场问题1:(1):(2):(3):clear;k=1;q=1;l=1;x=-6:0.1:6;x1p=l:0.1:6;x1n=-6:0.1:-l;x11=-l:0.1:l;E1p=(4*k*q*l.*x1p)./(x1p.^2-l^2).^2;%X大于LE1n=(4*k*q*l.*x1n)./(x1n.^2-l^2).^2;%X小于LE11=-k*q./(x11+l).^2-k*q./(x11-l).^2;%-LXlE2=4*k*q*l./x.^3;%电偶极子figure;plot(x1p,E1p);holdonplot(x11,E11);holdonplot(x1n,E1n);holdonplot(x,E2);gridonplot(-l,0,'ro',-l,0,'r-','MarkerSize',8);%标出负电荷holdonplot(l,0,'ro',l,0,'r+','MarkerSize',8);%标出正电荷ylabel('电场强度:N/C');xlabel('距离:m');title('电场强度分布图');text(1,-50,'点电荷-LXL曲线');text(1,50,'点电荷XL曲线');text(-2.5,-50,'点电荷XL曲线');axis([-66-100100]);(4):问题2:(1):(2):(3):clear;k=1;q=1;l=1;y=-6:0.1:6;y2p=0:0.1:6;y2n=-6:0.1:0;E1=-2*k*q./(y.^2+l^2)*l./sqrt(y.^2+l^2);%点电荷方程E2n=4*k*q*l./y2n.^3;%电偶极子Y0方程E2p=-4*k*q*l./y2p.^3;%电偶极子Y0方程figure;plot(y,E1);holdonplot(y2p,E2p);holdonplot(y2n,E2n);gridonylabel('电场强度:N/C');xlabel('距离:m');title('Y轴电场强度分布图');text(-1,-1,'点电荷曲线');text(-2,-2,'电偶极子曲线');text(2,-2,'电偶极子曲线');axis([-66-1010]);(4):