Lab 203 Data

# Lab 203 Data - r2= (X-1).^2+ (Y-1).^2; r =sqrt(r2); V =...

This preview shows page 1. Sign up to view the full content.

q=1*10^(-9); esp0=8.85*10^(-12); k=1./(4*pi*esp0); x= -2.1:0.2:2.1; y=-2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r1 = sqrt((X-1).^2+(Y-1).^2); r2 = sqrt((X-1).^2+(Y+1).^2); r3 = sqrt((X+1).^2+(Y+1).^2); r4 = sqrt((X+1).^2+(Y-1).^2); V1 = k*q./r1; V2 = k*-q./r2; V3 = k*q./r3; V4 = k*-q./r4; Vt = V1 + V2 + V3 + V4; [c,h] = contour(x,y,Vt,10); clabel(c,h); xlabel 'x' ; ylabel 'y' surf(x, y, Vt) [px, py] = gradient(Vt, 0.1, 0.1); quiver(x,y,-px, -py, 2) xlabel 'x' ; ylabel 'y' q=1*10^(-9); esp0=8.85*10^(-12); k=1./(4*pi*esp0); x= -2.1:0.2:2.1; y=-2.1:0.2:2.1; [X, Y] = meshgrid(x,y);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r2= (X-1).^2+ (Y-1).^2; r =sqrt(r2); V = k*q./r; [c,h] = contour(x,y,V,10); clabel(c,h); xlabel 'x' ; ylabel 'y' surf(x, y, V) [px, py] = gradient(V, 0.1, 0.1); quiver(x,y,-px, -py, 2) xlabel 'x' ; ylabel 'y' q=1*10^(-9); esp0=8.85*10^(-12); k=1./(4*pi*esp0); x= -2.1:0.2:2.1; y=-2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r2= (X-1).^2+ (Y-1).^2; r =sqrt(r2); V = k*q./r; [c,h] = contour(x,y,V,10); clabel(c,h); xlabel 'x' ; ylabel 'y' surf(x, y, V) [px, py] = gradient(V, 0.1, 0.1); quiver(x,y,-px, -py, 2) [X, Y] = meshgrid(x,y);...
View Full Document

## This note was uploaded on 03/21/2011 for the course PHYS 111A taught by Professor Universal during the Fall '10 term at NJIT.

Ask a homework question - tutors are online