Lab 203 - Lab 203: Electric Potential Name: William...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 203: Electric Potential Name : William Savastano Object : To calculate the electric potential due to a charge and draw a contour and surface plots of the electric potential using matlab. Theory : For a given charge q the scalar electrostatic potential V at point (x,y) is given by three formulas. >> clear all >> q=1*10^-9; >> esp0=8.85*10^-12 >> k=1./(4*pi*esp0); >> k=1./(4*pi*esp0); >> x=-2.1:0.2:2.1; >> y=-2.1:0.2:2.1 >> [X,Y]=meshgrid(x,y); >> r=sqrt((X-1).^2+(Y-1).^2); >> V=k*q./r; >> [c,h] = contour(x,y,V,20); >> clabel(c,h); xlabel 'x'; ylabel 'y' >> surf(x,y,V) >> [px,py]=gradient(V,.1,.1); >> quiver(x,y,-px,-py,2) >> xlabel 'x'; ylabel 'y'
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4.98105 7.91108 10.8411 13.7711 16.7012 19.6312 22.5612 25.4913 28.4213 31.3513 34.2814 37.2114 40.1414 43.0714 46.0015 48.9315 51.8615 54.7916 57.7216 60.6516 x y -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -4 -2 0 2 4 -4 -2 0 2 4 0 20 40 60 80
Background image of page 2
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 x y >> clear all >> q1=1*10^-9;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/11/2010 for the course PHYS 121 taught by Professor Opyrchal during the Spring '08 term at NJIT.

Page1 / 9

Lab 203 - Lab 203: Electric Potential Name: William...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online